On Tue November 10 2009 11:20:26 am bschuette wrote:
> Got it,
> 
> I mixed the policy-driven configuration with my own wss4j interceptors.
> Removing them and adding the proper configuration to the jaxws:client did
> the trick.
> Quite simple!

Thanks for the update.  Was just about to ask for the soap message and such to 
try and compare with the stack trace.   Glad it was just a config issue.  :-)

Dan


> 
> bschuette wrote:
> > Hi there,
> >
> > using CXF 2.2.4, I have to implement a  client against an Axis2 server
> > using the follwing policy snippet:
> >
> > <sp:X509Token
> > sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/Inc
> >ludeToken/Always"> <wsp:Policy>
> >        <sp:RequireDerivedKeys/>
> >        <sp:WssX509V3Token10 />
> >     </wsp:Policy>
> > </sp:X509Token>
> >
> > Security actions used are Signature and Encryption.
> >
> > According the docs, I configure my client through cxf.xml using the
> > createdByApi option:
> >
> > <jaxws:client
> >             name="{http://com.foo/fooService}FooPort";
> >             createdFromAPI="true" wsdlLocation="wsdl/fooService.wsdl">
> > ... <!-- WS-Security in- and out-interceptors -->
> >
> > Calling the client, I get the following exception:
> >
> > org.apache.ws.security.WSSecurityException: General security error;
> > nested exception is:
> >         org.apache.ws.security.conversation.ConversationException: Error
> > in key derivation
> >         at
> > org.apache.ws.security.processor.DerivedKeyTokenProcessor.deriveKey(Deriv
> >edKeyTokenProcessor.java:117) at
> > org.apache.ws.security.processor.DerivedKeyTokenProcessor.handleToken(Der
> >ivedKeyTokenProcessor.java:86) at
> > org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityE
> >ngine.java:326) at
> > org.apache.ws.security.WSSecurityEngine.processSecurityHeader(WSSecurityE
> >ngine.java:243) at
> > org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JIn
> >Interceptor.java:198) at
> > org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JIn
> >Interceptor.java:77) at
> > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCh
> >ain.java:236) at
> > org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:664)
> >         at
> > org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespo
> >nseInternal(HTTPConduit.java:2160) at
> > org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleRespo
> >nse(HTTPConduit.java:2040) at
> > org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPC
> >onduit.java:1965) at
> > org.apache.cxf.io.CacheAndWriteOutputStream.postClose(CacheAndWriteOutput
> >Stream.java:47) at
> > org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:188)
> >         at
> > org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> >         at
> > org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:627)
> >         at
> > org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingIn
> >terceptor.handleMessage(MessageSenderInterceptor.java:62) at
> > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorCh
> >ain.java:236) at
> > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:478) at
> > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:308) at
> > org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:260) at
> > org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> >         at
> > org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> >         at ...bla...
> >        Caused by:
> > org.apache.ws.security.conversation.ConversationException: Error in key
> > derivation
> >         at
> > org.apache.ws.security.conversation.dkalgo.P_SHA1.createKey(P_SHA1.java:6
> >5) at
> > org.apache.ws.security.processor.DerivedKeyTokenProcessor.deriveKey(Deriv
> >edKeyTokenProcessor.java:114) ... 24 more
> > Caused by: java.lang.IllegalArgumentException: Missing argument
> >         at javax.crypto.spec.SecretKeySpec.<init>(DashoA12275)
> >         at
> > org.apache.ws.security.conversation.dkalgo.P_SHA1.P_hash(P_SHA1.java:86)
> >         at
> > org.apache.ws.security.conversation.dkalgo.P_SHA1.createKey(P_SHA1.java:5
> >5) ... 25 more
> >
> >
> > Any hints?
> 

-- 
Daniel Kulp
[email protected]
http://www.dankulp.com/blog

Reply via email to