Hi all!

I need to deploy the WSSDoAllSender handler dynamically (in the sense
that is the client application logic to decide if apply the wss security
handler and with witch action).

Suppose that the client deploy file is the following: 

<deployment xmlns="http://xml.apache.org/axis/wsdd/";
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>
 <transport name="http"
pivot="java:org.apache.axis.transport.http.HTTPSender"/>
  <globalConfiguration >
  <requestFlow>
   <handler type="java:org.apache.ws.axis.security.WSDoAllSender" >
    <parameter name="action" value="Timestamp SAMLTokenSigned"/>
    <parameter name="samlPropFile"
value="samlClientTokSign.properties"/>
    <parameter name="signatureKeyIdentifier" value="DirectReference" />
   </handler>
  </requestFlow>
  </globalConfiguration >
</deployment>

With the previous configuration my WS client works well.

Now, to add the wss4j handler dynamically, I create the following
EngineConfiguration with witch I initialize my AxisEngine: 


private EngineConfiguration createClientConfig() 
    { 
         try{
            SimpleProvider clientConfig=new SimpleProvider(); 
            Handler securityHandler= (Handler)new WSDoAllSender();
 
securityHandler.setOption(WSHandlerConstants.ACTION,"Timestamp
SAMLTokenSigned");
 
securityHandler.setOption(WSHandlerConstants.SAML_PROP_FILE,"samlClientT
okSign.properties");
            securityHandler.setOption(WSHandlerConstants.SIG_KEY_ID,
"DirectReference");
            SimpleChain reqHandler=new SimpleChain(); 
            SimpleChain respHandler=new SimpleChain(); 
            reqHandler.addHandler(securityHandler); 
            Handler pivot=(Handler)new HTTPSender(); 
            reqHandler.addHandler(pivot);
            Handler transport=new SimpleTargetedChain(reqHandler, pivot,
respHandler);
 
clientConfig.deployTransport(HTTPTransport.DEFAULT_TRANSPORT_NAME,transp
ort); 
            return clientConfig;   
        } catch (Exception ex){
            //log.error("Couldn't create engine configuration",ex);
            ex.printStackTrace();
            return null;
        }
    }

With the previous dynamically configuration, on the client side I obtain
the following error:

Exception in thread "main" AxisFault
 faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
 faultSubcode: 
 faultString: WSDoAllReceiver: security processing failed; nested
exception is: 
        org.apache.ws.security.WSSecurityException: The signature
verification failed
 faultActor: 
 faultNode: 
 faultDetail: 
        {http://xml.apache.org/axis/}hostname:it015C0073

WSDoAllReceiver: security processing failed; nested exception is: 
        org.apache.ws.security.WSSecurityException: The signature
verification failed
        at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.ja
va:222)
        at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.jav
a:129)
        at
org.apache.axis.encoding.DeserializationContext.endElement(Deserializati
onContext.java:1087)
        at
org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis
patcher.dispatch(Unknown Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unkno
wn Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
        at
org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source)
        at
org.apache.axis.encoding.DeserializationContext.parse(DeserializationCon
text.java:227)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
        at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
        at
org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java
:796)
        at
org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
        at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.j
ava:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        at org.apache.axis.client.Call.invoke(Call.java:2767)
        at org.apache.axis.client.Call.invoke(Call.java:2443)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at
wsSamlTest.client.MyServerOneSoapBindingStub.echo(MyServerOneSoapBinding
Stub.java:103)
        at wsSamlTest.client.WSClient.callMyServerOne(WSClient.java:84)
        at wsSamlTest.client.WSClient.main(WSClient.java:91)


And on the server side I seen the following log: 

16:12:52,217 INFO  [Reference] Verification successful for URI
"#STRSAMLId-4167406"
16:12:52,227 WARN  [Reference] Verification failed for URI
"#id-12366398"
 

Do you have any idea of which is the problem? 

Thanks in advance,
Antonio

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to