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 Revati Damle <re...@rave-tech.com> on 2006/01/20 15:07:32 UTC

Problem using apache wss4j

Hi,
 
I have to generate following tokens in SOAP envelope.
 
<wst:RequestSecurityToken
xmlns:wst="http://schemas.xmlsoap.org/ws/2004/04/trust">
 
<wst:TokenType>urn:GSO-System-Services:external:1.65:gatewaytoken#Gatewa
yToken</wst:TokenType>
 
<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Is
sue</wst:RequestType>
      <wst:Base>
        <wsse:UsernameToken
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssec
urity-utility-1.0.xsd" 
         wsu:Id="SecurityToken-94d12e0f-400b-4412-bde8-e03357eb0692">
          <wsse:Username>513FDQ37JILL</wsse:Username>
          <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-t
oken-profile-1.0#PasswordDigest">
         NXJ3ynAa8Sy136aifThXJl8vLoE=
          </wsse:Password>
          <wsse:Nonce>4nJy2oD6xC79zatTHvuywg==</wsse:Nonce>
          <wsu:Created>2004-07-01T11:03:10Z</wsu:Created>
        </wsse:UsernameToken>
      </wst:Base>
      <wsp:AppliesTo
xmlns:wsp="http://schemas.xmlsoap.org/ws/2002/12/policy">
        <wsa:EndpointReference>
 
<wsa:Address>urn:GSO-System-Services:external:1.65:GatewayWebServices</w
sa:Address>
        </wsa:EndpointReference>
      </wsp:AppliesTo>
      <wst:LifeTime>
        <wsu:Expires>2004-07-01T15:03:11Z</wsu:Expires>
      </wst:LifeTime>
    </wst:RequestSecurityToken>
 
=============================================================
 
I tried using wss4j library and could generate envelope like following
 
  <wst:RequestSecurityToken
xmlns:wst="http://schemas.xmlsoap.org/ws/2004/04/trust">
 
<wst:TokenType>http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-u
sername-token-profile-1.0#UsernameToken</wst:TokenType>
 
<wst:RequestType>http://schemas.xmlsoap.org/ws/2004/04/security/trust/Is
sue</wst:RequestType>
   <wst:Base>
    <wsse:UsernameToken
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wsse
curity-secext-1.0.xsd">
     <wsse:Username>werner</wsse:Username>
     <wsse:Password
Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-t
oken-profile-1.0#PasswordDigest">8yKFLDyy83B6lBSx++0hGrFQewU=</wsse:Pass
word>
     <wsse:Nonce>CJpdZKrMZ5KE1mywD4gcSA==</wsse:Nonce>
     <wsu:Created
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssec
urity-utility-1.0.xsd">2006-01-20T10:23:41.351Z</wsu:Created>
    </wsse:UsernameToken>
   </wst:Base>
 
   <wst:Lifetime
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssec
urity-utility-1.0.xsd">
    <wsu:Created>2006-01-20T10:23:41Z</wsu:Created>
    <wsu:Expires>2006-01-20T10:27:51Z</wsu:Expires>
   </wst:Lifetime>
 
  </wst:RequestSecurityToken>
 
 
 
I could generate AppliesTo token using AppliesTo class but how can I add
this to my ReuqestSecurityToken?
Any help would be appreciated.
 
 
Revati Damle,
Rave Technologies Ltd,
Mumbai,
Ph: (022)56606600 Ext 318