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 How to get userName token from WSPasswordCallback Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "How to get userName token from WSPasswordCallback" Watch "How to get userName token from WSPasswordCallback" New topic
Author

How to get userName token from WSPasswordCallback

sarathy natarajan
Greenhorn

Joined: Aug 22, 2012
Posts: 2
Hi,

I am new to axis and using rampart to authenticate the username and cleartext password passed in the SOAPHeader using the WSPasswordCallback.
How can this userName token be made available to the AXIS service? I see that the MessageContext is available in the service which can be used to retrieve the SOAPHeaders. However it will have to be parsed again to retrieve the userName token. Is there a way to get the UserName token used by the callback in the service?
I am interested in learning the best practice to do this.

Here is the services.xml

<service name="SomeWebService"
targetNamespace="http://com.mycom/SomeWebService/service/"> >
<description>Generic Service</description>
<parameter name="ServiceClass" locked="false">com.mycom.service.SomeWebService</parameter>
<operation name="callService">
<messageReceiver class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>

<module ref="rampart" />

<parameter name="InflowSecurity">
<action>
<items>UsernameToken</items>

<passwordCallbackClass>
com.mycom.service.PWHandlerServer
</passwordCallbackClass>
</action>
</parameter>

</service>


Any help would be appreciated.

Best Regards,
-sarathy
sarathy natarajan
Greenhorn

Joined: Aug 22, 2012
Posts: 2
I found the answer for my question here: http://wso2.org/library/169
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to get userName token from WSPasswordCallback
 
Similar Threads
WSHandler: cannot create instance of password callback
WSE security authentication problem.
Dynamically add ws-security to a service
Axis2, client handler not getting called
Configure OutflowSecurity in axis2.xml to include UsernameToken and Timestamp?