WSS4J can do this. http://ws.apache.org/wss4j/
I used a deployment descriptor (.wsdd file) something like:
<globalConfiguration>
<requestFlow>
<handler type="java:org.apache.ws.axis.security.WSDoAllSender">
<parameter name="action" value="UsernameToken" />
<parameter name="passwordType" value="PasswordDigest" />
<!-- or "PasswordText" -->
</handler>
</requestFlow>
</globalConfiguration>
- John Kristian
-----Original Message-----
From: herbison [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 21, 2007 12:46 PM
To: [email protected]
Subject: Axis 1.4 Security using UsernameToken
I'm tring to access a .NET service, using code generated by wsdl2java,
where
I have to set the UsernameToken fields Username and Password in the soap
header. How is this done?!! I've been going around in circles all
morning
and nothing seems to get me any closer in setting the soap fields. This
is
what the client looks like now:
String id="user";
String key="password";
PWCallback pwCallback = new PWCallback();
pwCallback.setUsername(id);
pwCallback.setPassword(key);
ClaimProcessorLocator loc = new ClaimProcessorLocator();
Remote remote = loc.getPort( Claim.class);
Stub axisPort = (Stub)remote;
axisPort._setProperty(UsernameToken.PASSWORD_TYPE,
WSConstants.PASSWORD_DIGEST);
axisPort._setProperty(WSHandlerConstants.USER, id);
axisPort._setProperty(WSHandlerConstants.PW_CALLBACK_REF, pwCallback);
IClaim iclaim = (IClaim) loc.getBasicHttpBinding_IClaim();
Claim claim = iclaim.getClaim();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]