File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes Programmatically setting user name with Rampart Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Programmatically setting user name with Rampart" Watch "Programmatically setting user name with Rampart" New topic
Author

Programmatically setting user name with Rampart

Bai Shen
Ranch Hand

Joined: Sep 24, 2008
Posts: 323
So I managed to get my web service up and running with Rampart. However, I have to define the user name for the client in the axis2.xml file. I'd like to be able to set this programmatically, but I'm not sure how to go about doing that. I did some searching, but wasn't able to find any solutions other than don't use Rampart. I'm using Axis2 1.4.1 and Rampart 1.4
Bai Shen
Ranch Hand

Joined: Sep 24, 2008
Posts: 323
Ah-hah! Apparently, when Axis2 calls the password handler, you can change the user in the method. You simply call setIdentifier on the WSPasswordCallback. It's the same object that you set the password on. It will override the value set in the axis2.xml file. Not my preferred solution, but it's better than nothing.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Programmatically setting user name with Rampart
 
Similar Threads
Unable to get Rampart setup correctly with Axis2
Axis2/Rampart compatability
Generate Security Header for Axis 2 with xmlbeans
How do you define in your code which key/passw to associate with which application
SOAP Header missing using Rampart w/ Axis2 Generated Stub