camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Problem Configuring WSS4JInInterceptor using camel-config.xml
Date Thu, 20 Nov 2014 07:21:29 GMT
When you use the Message data format, camel cxf endpoint doesn’t read the request message
which means it doesn’t prepare the SOAP message header for WSS4JInInterceptor to process.
You can change the CXF endpoint data format to CXF_MESSAGE, in this way, camel-cxf call all
the interceptors and you can access the message body just like MESSAGE data format.

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On November 19, 2014 at 8:05:58 PM, Royamit (amitroy005@gmail.com) wrote:
> Hi,
>  
> I am trying to configure WSS4JInInterceptor in my cxf endpoint.
>  
> Below is my camel-config.xml
>  
>  
>  
>  
> > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:camel="http://camel.apache.org/schema/spring"
> xmlns:cxf="http://camel.apache.org/schema/cxf"
> xmlns:context="http://www.springframework.org/schema/context"
> xsi:schemaLocation="
> http://www.springframework.org/schema/beans
> http://www.springframework.org/schema/beans/spring-beans.xsd
> http://www.springframework.org/schema/context
> http://www.springframework.org/schema/context/spring-context.xsd
> http://camel.apache.org/schema/spring
> http://camel.apache.org/schema/spring/camel-spring.xsd
> http://camel.apache.org/schema/cxf
> http://camel.apache.org/schema/cxf/camel-cxf.xsd">
>  
>  
> > location="classpath:incident.properties,file:target/custom.properties"
> ignore-resource-not-found="true"/>
>  
>  
> > class="org.apache.camel.example.cxf.proxy.EnrichBean"/>
>  
> > class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
> > class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
>  
> *> class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
>  
>  
>  
>  
> > value="org.apache.camel.example.cxf.proxy.UTPasswordCallback"/>
>  
>  
> *
>  
>  
> *>  
> address="http://localhost:${proxy.port}/camel-example-cxf-proxy/webservices/versionAdapter"
 
> endpointName="s:VersionHttpSoap11Endpoint"
> serviceName="s:Version"
> wsdlURL="etc/versionAdapter.wsdl"
> xmlns:s="http://axisversion.sample">
>  
>  
>  
>  
>  
>  
>  
>  
>  
> *
>  
>  
>  
>  
> > location="classpath:incident.properties,file:target/custom.properties"/>  
>  
> > uri="http://localhost:${real.port}/axis2/services/Version?bridgeEndpoint=true&throwExceptionOnFailure=false"/>
 
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
>  
> When i invoke my proxy webservice i am getting error. Here is the complete
> error trace..
>  
> INFO: Inbound Message
> ----------------------------
> ID: 1
> Address:
> http://localhost:9080/camel-example-cxf-proxy/webservices/versionAdapter  
> Encoding: UTF-8
> Http-Method: POST
> Content-Type: text/xml;charset=UTF-8
> Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
> Content-Length=[1097], content-type=[text/xml;charset
> =UTF-8], Host=[localhost:9080], SOAPAction=["urn:getVersion"],
> User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
> Payload: *> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelop
> e/">
> > xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-20
> 0401-wss-wssecurity-secext-1.0.xsd"
> xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit
 
> y-1.0.xsd">> wsu:Id="TS-30">2014-11-19T11:53:20Z2014-11-19T12:26:40  
> Z> wsu:Id="UsernameToken-29">opp> sword
> Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">H76Ia3oU5
 
> CYr84Z7ca49tTg6aFE=> EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soa
 
> p-message-security-1.0#Base64Binary">JbhLoh/642uk37hUuCEuNQ==2014-11-19T11:53:20.271Z>
ated>
>  
>  
>  
> *--------------------------------------
> Inside UTPasswordCallback Method @ UTPasswordCallback class
> Wed Nov 19 17:22:43 IST 2014 Inside UTPasswordCallback()-->
> UTPasswordCallback Class
> Nov 19, 2014 5:22:43 PM org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor
> checkActions
> *WARNING: Security processing failed (actions mismatch)*
> Nov 19, 2014 5:22:43 PM org.apache.cxf.phase.PhaseInterceptorChain
> doDefaultLogging
>  
> WARNING: Interceptor for {http://axisversion.sample}Version has thrown
> exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: An error was discovered processing
> the header.
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:809)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:313)
 
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:93)
 
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
 
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
 
> at
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:243)
 
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:261)
 
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
 
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1088)  
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1024)  
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)  
> at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
 
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)  
> at org.eclipse.jetty.server.Server.handle(Server.java:370)
> at
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
 
> at
> org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:982)
 
> at
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1043)
 
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:865)
> at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
> at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)  
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
 
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53) 

> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)  
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)  
> at java.lang.Thread.run(Thread.java:722)
> Caused by: org.apache.wss4j.common.ext.WSSecurityException: An error was
> discovered processing the heade
> r
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:339)
 
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:297)
 
> ... 23 more
>  
> I am unable to figure out what this error is all about and how can i rectify
> this error?
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Problem-Configuring-WSS4JInInterceptor-using-camel-config-xml-tp5759326.html
 
> Sent from the Camel - Users mailing list archive at Nabble.com.
>  


Mime
View raw message