Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to set WS Username token programmatically in java?

956943Oct 10 2012 — edited Oct 11 2012
Hi,

Jdev Version: 11.1.1.4.0.

I have created a webservice proxy using Jdev from a wsdl.
I need to invoke a service from the client. But for this I need to set the username token in SOAP header to access the service.
The username token is not exposed or generated in the client.
When I run it from SOAP ui, I manually enetered,
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-7" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>1234</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">1111111111</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">XXXXXXXXXXXXXXXXXXXXXXXXXXX</wsse:Nonce>
<wsu:Created>2012-03-02T23:41:44.511Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>

Without the username token I cannot invoke the service from my client code.
How do I add the username token to the generated clients in ADF?

Thanks in advance!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 8 2012
Added on Oct 10 2012
3 comments
5,246 views