You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by herbison <he...@nortel.com> on 2007/03/21 20:45:35 UTC

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();

-- 
View this message in context: http://www.nabble.com/Axis-1.4-Security-using-UsernameToken-tf3443206.html#a9601255
Sent from the Axis - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: Axis 1.4 Security using UsernameToken

Posted by John Kristian <jk...@netflix.com>.
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:herbison@nortel.com] 
Sent: Wednesday, March 21, 2007 12:46 PM
To: axis-user@ws.apache.org
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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis 1.4 Security using UsernameToken

Posted by Ruchith Fernando <ru...@gmail.com>.
Rampart works with Axis2 not Axis 1.x.

Thanks,
Ruchith

On 3/22/07, John Kristian <jk...@netflix.com> wrote:
> Rampart can do this, but not easily.  Search this mailing list for
> 'Rampart' to find some problems.
> http://ws.apache.org/axis2/modules/rampart/1_0/security-module.html
>
> I sincerely hope someone knows a better way.
>
> - John Kristian
>
> -----Original Message-----
> From: herbison [mailto:herbison@nortel.com]
> Sent: Wednesday, March 21, 2007 12:46 PM
> To: axis-user@ws.apache.org
> 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: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
www.ruchith.org
www.wso2.org

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: Axis 1.4 Security using UsernameToken

Posted by John Kristian <jk...@netflix.com>.
Rampart can do this, but not easily.  Search this mailing list for
'Rampart' to find some problems.
http://ws.apache.org/axis2/modules/rampart/1_0/security-module.html

I sincerely hope someone knows a better way.

- John Kristian

-----Original Message-----
From: herbison [mailto:herbison@nortel.com] 
Sent: Wednesday, March 21, 2007 12:46 PM
To: axis-user@ws.apache.org
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: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org