axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From janardan <njanardana...@yahoo.com>
Subject Issue with using the Axis2 JAX-WS Client using Rampart
Date Wed, 23 Feb 2011 10:42:14 GMT
Issue with using the Axis2 JAX-WS Client using Rampart
I'm developing my Axis2 JAX-WS Client to consume the web service.
I'm using Axis2 1.5.4 and Rampart 1.5.1
When I ran the client with Axis2 1.4.1 and Rampart 1.4, it worked.
But when I try to use Axis2 1.5.x versions, I'm getting the null pointer 
exception 

 at 
org.apache.ws.security.message.token.X509Security.getX509Certificate(X509Security.java:94)

 at 
org.apache.ws.security.processor.BinarySecurityTokenProcessor.getCertificatesTokenReference(BinarySecurityTokenProcessor.java:109)


When I compare the debug log of both, I could see that, rampart is receiving the 
response.
I could see the statement 
 "*********************** RampartReceiver received"
But after that I could not see the statement 
 "*********************** WSDoAllReceiver recieved".
I could see the WSDoAllReceiver statement in the log which is working(Axis2 
1.4.1+Rampart 1.4).

I'm attaching the debug log.
I'm engaging the rampart module in my client.axis2.xml.
 <module ref="rampart"/>
 <module ref="addressing"/>
 <parameter name="OutflowSecurity">
  <action>
   <items>Timestamp Signature</items>
   <signaturePropFile>crypto.properties</signaturePropFile>
   <user>SRVC_CLAIMS_SIT</user>
   <userCertAlias>SRVC_CLAIMS_SIT</userCertAlias>
   <encryptionUser>SRVC_CLAIMS_SIT</encryptionUser>
   <passwordCallbackClass>clientPasswordProvider</passwordCallbackClass>
   <signatureKeyIdentifier>DirectReference</signatureKeyIdentifier>
   <signatureParts>
   {Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp;

   {Element}{http://www.w3.org/2003/05/soap-envelope}Body
   </signatureParts>
   <optimizeParts>//xenc:EncryptedData/xenc:CipherData/xenc:CipherValue</optimizeParts>

  </action>
 </parameter>
 <parameter name="InflowSecurity">
  <action>
   <items>Timestamp Signature</items>
   <signaturePropFile>crypto.properties</signaturePropFile>
   <passwordCallbackClass>clientPasswordProvider</passwordCallbackClass>
   <signatureKeyIdentifier>IssuerSerial</signatureKeyIdentifier>
   <enableSignatureConfirmation>false</enableSignatureConfirmation>
  </action>
 </parameter>

My policy.xml contains just the below content
 <ramp:RampartConfig xmlns:ramp="http://ws.apache.org/rampart/policy">
 </ramp:RampartConfig>

I'm loading the Policy.xml in the client like this:
 PartyService service = new PartyService();
 PartyServiceInterface stub = service.getPartyServiceInterface(); 
        String target = getEndPointAddress();
        BindingProvider provider = (BindingProvider)stub;
        provider.getRequestContext().put(RampartMessageData.KEY_RAMPART_POLICY, 
loadPolicy("C:/TestJAXWS/META-INF/policy/policy.xml"));
        
provider.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, 
target);
My crypto.properties is like below :
 org.apache.ws.security.crypto.provider=org.apache.ws.security.components.crypto.Merlin

 org.apache.ws.security.crypto.merlin.keystore.password=ABC5JHGFWWEDSWCT
 org.apache.ws.security.crypto.merlin.file=srvc_claims_sit.jks

My WSDL has the below security configuration
 <wsp:UsingPolicy required="true"/>
 <wsp:Policy xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy" 
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
 xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" 
wsu:Id="BTEndpointPolicy">
  <wsp:ExactlyOne>
   <wsp:All>
    <sp:AsymmetricBinding>
     <wsp:Policy>
      <sp:InitiatorToken>
       <wsp:Policy>
        <sp:X509Token 
sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">

         <wsp:Policy>
          <sp:WssX509V3Token10/>
         </wsp:Policy>
        </sp:X509Token>
       </wsp:Policy>
      </sp:InitiatorToken>
      <sp:RecipientToken>
       <wsp:Policy>
        <!-- .NET likes this -->
        <!-- 
        <sp:X509Token 
sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never">

         <wsp:Policy>
          <sp:WssX509V3Token10/>
         </wsp:Policy>
        </sp:X509Token>
        -->
        <!-- .NET doesn't like this -->
        <sp:X509Token 
sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Always">

         <wsp:Policy>
          <sp:RequireEmbeddedTokenReference/>
          <sp:WssX509V3Token10/>
         </wsp:Policy>
        </sp:X509Token>
        
       </wsp:Policy>
      </sp:RecipientToken>
      <sp:AlgorithmSuite>
       <wsp:Policy>
        <sp:Basic256/>
       </wsp:Policy>
      </sp:AlgorithmSuite>
      <sp:Layout>
       <wsp:Policy>
        <sp:Lax/>
       </wsp:Policy>
      </sp:Layout>
      <sp:IncludeTimestamp/>
      <sp:OnlySignEntireHeadersAndBody/>
     </wsp:Policy>
    </sp:AsymmetricBinding>
    <sp:Wss10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
     <wsp:Policy>
      <sp:MustSupportRefKeyIdentifier/>
      <sp:MustSupportRefIssuerSerial/>
     </wsp:Policy>
    </sp:Wss10>
    <wsaw:UsingAddressing required="true"/>
   </wsp:All>
  </wsp:ExactlyOne>
 </wsp:Policy>
 <wsp:Policy xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy" 
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
 wsu:Id="BTRequestSecureMessagePolicy">
  <wsp:ExactlyOne>
   <wsp:All>
    <sp:SignedParts>
     <sp:Body/>
     <sp:Header Name="Timestamp" 
Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>

    </sp:SignedParts>
   </wsp:All>
  </wsp:ExactlyOne>
 </wsp:Policy>
 <wsp:Policy xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy" 
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
 wsu:Id="BTResponseSecureMessagePolicy">
  <wsp:ExactlyOne>
   <wsp:All>
    <sp:SignedParts>
     <sp:Body/>
     <sp:Header Name="Timestamp" 
Namespace="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"/>

    </sp:SignedParts>
   </wsp:All>
  </wsp:ExactlyOne>
 </wsp:Policy>
 <wsp:Policy xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy" 
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
 wsu:Id="BTFaultSecureMessagePolicy">
  <wsp:ExactlyOne>
   <wsp:All>
    <sp:SignedParts/>
   </wsp:All>
  </wsp:ExactlyOne>
 </wsp:Policy>

Can some one please help me in resolving this issue please.


      
Mime
View raw message