aspose file tools*
The moose likes Web Services and the fly likes AXIS security - Get identifier/username token to the code. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "AXIS security - Get identifier/username token to the code." Watch "AXIS security - Get identifier/username token to the code." New topic
Author

AXIS security - Get identifier/username token to the code.

Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1527
I implemented security in my web service as per the description in the link below.

http://ws.apache.org/wss4j/axis.html

How can I get the identifier or user name (token & password in the webservice) to the implementation code of the service.

I want to be able to get the username in <mydelegate>SoapBindingImpl.java file. Is it possible?


Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1527
The handle method looks like this



The return type is void... so I cant return anything from here.! !!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42263
    
  64
This sounds a bit odd - the usual way to use WS-Security with Axis2 would be the Rampart module. Is there a specific reason you didn't go that route?


Ping & DNS - my free Android networking tools app
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1527
I may be replying you too early but I see that model is for Axis2 and I am on Axis 1.4 will that still work for me?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42263
    
  64
I don't think something like Rampart was ever available for Axis 1. Any particular reason for using such a long-obsolete framework?
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1527
I got it working for axis 1.4. Import following


and in the code.



This gives us the context. I set the username in handler by saying context.setProperty() and get it back in code using "context.getProperty()"
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42263
    
  64
I strongly suspect that that username and password are for HTTP Basic Authentication - something very different, and rather less secure, than WS-Security. Since Basic Auth sends password pretty much in cleartext, you must use HTTPS along with it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: AXIS security - Get identifier/username token to the code.