cancel
Showing results for 
Search instead for 
Did you mean: 

How to use different tickets for different users

ribz33
Champ on-the-rise
Champ on-the-rise
Hi,

I'm doing a Portlet using Alfresco WebServices.
My problem is that at the moment im using
AuthenticationUtils.startSession(login,password);
and
RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService(); 

But that is a singleton, so all my users use same ticket.

Now i want that each user use its ticket.

I want store ticket in session but in dont know how i can give ticket when i call my RepositoryService.

Thx in advance.
2 REPLIES 2

ribz33
Champ on-the-rise
Champ on-the-rise
i have found this on wss4j doc but i dont succeed to implement it…  Smiley Sad

Application sets parameters to insert in

Sometimes it is not feasable or not possible to determine parameters and their values during deployment. In this case the application can set paramters during runtime. The WSS4J Axis handlers use the Axis setProperty method to support this feature.

The following code snippet shows an example how to use the dynamic setting of parameters and their values:

   …
Service service = new Service();
Call call = (Call) service.createCall();
   … 
call.setProperty(UsernameToken.PASSWORD_TYPE, WSConstants.PASSWORD_TEXT);
call.setProperty(WSHandlerConstants.USER, "werner");
   …

Use this way if your application dynamically creates a call object. If your application uses stubs generated by Axis' WSDL2Java tool, the application uses the following functions:

    …
PingServiceLocator service = new PingServiceLocator();
    …
PingPort port = (PingPort) service.getPing1();
port._setProperty(UsernameToken.PASSWORD_TYPE, WSConstants.PASSWORD_TEXT);
port._setProperty(WSHandlerConstants.USER, "werner");
    …

Please note that _setProperty is a Axis specific call.
see http://ws.apache.org/wss4j/package.html for more information.

I had seen on WSHandlerConstants API, that :
It is also possible to set the user's name and the according password via the call function, for example:


call.setUsername("name");
call.setPassword("WSS4Java");

to get call i had try this:
RepositoryServiceSoapBindingStub repositoryService = WebServiceFactory.getRepositoryService();
repositoryService._getCall() …

but like that call is null and if i do "createcall" its not working also

I dont have more idea !

if someone have a solution, its welcome Smiley Happy
Bst rgrds

sam69
Champ in-the-making
Champ in-the-making
I am also interrested by this solution. But sorry, I can't really help.
For testing only, I modified the Alfresco webservices client to be able to create several instances, but it's not a good solution for production…