Probably not as you require to have multiple users authenticated. You can still have rampart configuration with policy... in services.xml without credentials.
Programmatically you'll need to do it as Amila indicated, that is using org.apache.axis2.client.Options from the org.apache.axis2.client.ServiceClient Options serviceOptions = serviceClient.getOptions(); serviceOptions.setUserName(username); serviceOptions.setPassword(password); remember to setOptions in ServiceClient. serviceClient.setOptions(serviceOptions); The callback in <ramp:passwordCallbackClass>your callback class</ramp:passwordCallbackClass> can authenticate user. Thanks. Brando From: jing [mailto:t...@nceas.ucsb.edu] Sent: Wednesday, September 14, 2011 11:55 AM To: java-user@axis.apache.org Subject: Re: Can the policy of rampart support multiple users? Thank you, Amila and Thilina! It is very helpful. Besides the programmatically setting the username, can we set in the configuration file directly? Regards, Jing On 09/14/2011 01:01 AM, Amila Suriarachchi wrote: you can use the options.setUsername method. please refere here[1]. thanks, Amila. [1] http://wso2.org/library/articles/2011/06/securing-web-service-integratio n On Mon, Sep 12, 2011 at 10:50 PM, jing <t...@nceas.ucsb.edu> wrote: Hi, everyone: I am using the username token authentication policy in rampart to secure my axis web service. Here is the segment of the axis configuration in my client side: <wsp:ExactlyOne> <wsp:All> <sp:SupportingTokens> <wsp:Policy> <sp:UsernameToken/> </wsp:Policy> </sp:SupportingTokens> <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy"> <ramp:user>kepler</ramp:user> <ramp:passwordCallbackClass>org.kepler.executionWS.client.PWHandlerClien t</ramp:passwordCallbackClass> </ramp:RampartConfig> </wsp:All> </wsp:ExactlyOne> Can I only use one user in this policy? If i can use multiple users, would you mind telling me how to do so? I tried to repeat <ramp:user>, it seemed not working since I only see one user was printed out in the handle (Callback[] callbacks) method of PWHandlerClient class. Thank you very much. Jing --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org For additional commands, e-mail: java-user-h...@axis.apache.org -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/ --------------------------------------------------------------------- To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org For additional commands, e-mail: java-user-h...@axis.apache.org