You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Charles Moulliard <ch...@gmail.com> on 2013/01/09 17:30:56 UTC

Issue using camel-cxf and wss4j

Hi,

When I try to authenticate an HTTP request using WS-Security with camel-cxf
& wss4j interceptor, I get the following error :

org.apache.camel.spring.Main.main() INFO
[org.apache.camel.spring.SpringCamelContext] - Total 1 routes, of which 1
is started.
org.apache.camel.spring.Main.main() INFO
[org.apache.camel.spring.SpringCamelContext] - Apache Camel 2.10.0
(CamelContext: camel-1) started in 0.993 seconds
qtp370155726-26 INFO
[org.apache.cxf.services.CustomerServiceService.CustomerServicePort.CustomerService]
- Inbound Message
----------------------------
ID: 1
Address: http://127.0.0.1:9090/training/WebService
Encoding: UTF-8
Http-Method: POST
Content-Type: text/xml;charset=UTF-8
Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
Content-Length=[1590], content-type=[text/xml;charset=UTF-8], Host=[
127.0.0.1:9090], SOAPAction=["http://training.fusesource.com/saveCustomer"],
User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
Payload: <soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:tra="
http://training.fusesource.com/">
   <soapenv:Header>
          <wsse:Security xmlns:wsse="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
"
               soap:mustUnderstand="1">
<wsse:UsernameToken xmlns:wsse="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="UsernameToken-1">
<wsse:Username>charles</wsse:Username>
<wsse:Password Type="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest
">TVzWGxNvhlixNVWol8poD9DHxl8=</wsse:Password>
<wsse:Nonce EncodingType="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary
">WsMNSm/C4dzdPS3OhUi94Q==</wsse:Nonce>
<wsu:Created>2013-01-09T15:46:14.908Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <tra:saveCustomer>
         <customer>
            <!--Optional:-->
            <name>?</name>
            <!--Zero or more repetitions:-->
            <address>?</address>
            <numOrders>?</numOrders>
            <revenue>?</revenue>
            <!--Optional:-->
            <test>?</test>
            <!--Optional:-->
            <birthDate>?</birthDate>
            <!--Optional:-->
            <type>?</type>
         </customer>
      </tra:saveCustomer>
   </soapenv:Body>
</soapenv:Envelope>
--------------------------------------
qtp370155726-26 DEBUG [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
- WSS4JInInterceptor: enter handleMessage()
qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
- Security processing failed (actions mismatch)
qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
-
org.apache.ws.security.WSSecurityException: An error was discovered
processing the <wsse:Security> header
at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
at org.eclipse.jetty.server.Server.handle(Server.java:349)
at
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
at
org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
at java.lang.Thread.run(Thread.java:722)
qtp370155726-26 WARN [org.apache.cxf.phase.PhaseInterceptorChain] -
Interceptor for {http://training.fusesource.com/}CustomerServiceService has
thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: An error was discovered processing
the <wsse:Security> header
at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:804)
at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:357)
at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
at org.eclipse.jetty.server.Server.handle(Server.java:349)
at
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
at
org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.ws.security.WSSecurityException: An error was
discovered processing the <wsse:Security> header
at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
... 22 more

    <cxf:cxfEndpoint id="WS"
                     address="http://localhost:9090/training/WebService"
                     serviceClass="com.fusesource.training.CustomerService">
        <cxf:outInterceptors>
            <ref bean="loggingOutInterceptor"/>
        </cxf:outInterceptors>
        <cxf:inInterceptors>
            <ref bean="loggingInInterceptor"/>
            <ref bean="wss4jInInterceptor"/>
        </cxf:inInterceptors>
    </cxf:cxfEndpoint>

    <bean id="loggingOutInterceptor"
class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
    <bean id="loggingInInterceptor"
class="org.apache.cxf.interceptor.LoggingInInterceptor"/>

    <bean id="wss4jInInterceptor"
class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
        <constructor-arg>
            <map>
                <entry key="action" value="UsernameToken"/>
                <entry key="passwordType" value="PasswordDigest"/>
                <entry key="passwordCallbackClass"
value="com.fusesource.training.camel.UTPasswordCallback"/>
            </map>
        </constructor-arg>
    </bean>

It seems that there is an action mismatch during processing of WSS4J.
Does anybody knows how to solve this issue which is perhaps a CXF or
WSS4J question?

Regards,

-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Re: Issue using camel-cxf and wss4j

Posted by Charles Moulliard <ch...@gmail.com>.
Get same issue even If I use camel with cxf 2.7.1 and wss4j 1.6.9.

Surprisingly the example that we have in camel project (that I created a
few years ago) including a unit test succeeds -->
https://github.com/apache/camel/blob/trunk/examples/camel-example-reportincident-wssecurity/src/test/java/org/apache/camel/example/reportincident/ReportIncidentRoutesTest.java


On Wed, Jan 9, 2013 at 8:02 PM, Charles Moulliard <ch...@gmail.com> wrote:

> Will test with 1.6.9.
>
> Until now in debug mode, I see that in the class WSS4JInInterceptor, when
> we handle the message (handleMessage(SoapMessage msg) throws Fault), the
> element is empty (            Element elem =
> WSSecurityUtil.getSecurityHeader(doc.getSOAPPart(), actor); ) even if a
> SOAPHeader with usernameToken + timeStamp has been provided in the
> SOAPEnveloppe
>
>
> On Wed, Jan 9, 2013 at 6:53 PM, Christian Müller <
> christian.mueller@gmail.com> wrote:
>
>> Can you upgrade to wss4j 1.6.9? I had a similar issue...
>> Am 09.01.2013 17:31 schrieb "Charles Moulliard" <ch...@gmail.com>:
>>
>> > Hi,
>> >
>> > When I try to authenticate an HTTP request using WS-Security with
>> camel-cxf
>> > & wss4j interceptor, I get the following error :
>> >
>> > org.apache.camel.spring.Main.main() INFO
>> > [org.apache.camel.spring.SpringCamelContext] - Total 1 routes, of which
>> 1
>> > is started.
>> > org.apache.camel.spring.Main.main() INFO
>> > [org.apache.camel.spring.SpringCamelContext] - Apache Camel 2.10.0
>> > (CamelContext: camel-1) started in 0.993 seconds
>> > qtp370155726-26 INFO
>> >
>> >
>> [org.apache.cxf.services.CustomerServiceService.CustomerServicePort.CustomerService]
>> > - Inbound Message
>> > ----------------------------
>> > ID: 1
>> > Address: http://127.0.0.1:9090/training/WebService
>> > Encoding: UTF-8
>> > Http-Method: POST
>> > Content-Type: text/xml;charset=UTF-8
>> > Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
>> > Content-Length=[1590], content-type=[text/xml;charset=UTF-8], Host=[
>> > 127.0.0.1:9090], SOAPAction=["
>> http://training.fusesource.com/saveCustomer
>> > "],
>> > User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
>> > Payload: <soapenv:Envelope xmlns:soapenv="
>> > http://schemas.xmlsoap.org/soap/envelope/" xmlns:tra="
>> > http://training.fusesource.com/">
>> >    <soapenv:Header>
>> >           <wsse:Security xmlns:wsse="
>> >
>> >
>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
>> > "
>> >                soap:mustUnderstand="1">
>> > <wsse:UsernameToken xmlns:wsse="
>> >
>> >
>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
>> > "
>> > xmlns:wsu="
>> >
>> >
>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
>> > "
>> > wsu:Id="UsernameToken-1">
>> > <wsse:Username>charles</wsse:Username>
>> > <wsse:Password Type="
>> >
>> >
>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest
>> > ">TVzWGxNvhlixNVWol8poD9DHxl8=</wsse:Password>
>> > <wsse:Nonce EncodingType="
>> >
>> >
>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary
>> > ">WsMNSm/C4dzdPS3OhUi94Q==</wsse:Nonce>
>> > <wsu:Created>2013-01-09T15:46:14.908Z</wsu:Created>
>> > </wsse:UsernameToken>
>> > </wsse:Security>
>> >    </soapenv:Header>
>> >    <soapenv:Body>
>> >       <tra:saveCustomer>
>> >          <customer>
>> >             <!--Optional:-->
>> >             <name>?</name>
>> >             <!--Zero or more repetitions:-->
>> >             <address>?</address>
>> >             <numOrders>?</numOrders>
>> >             <revenue>?</revenue>
>> >             <!--Optional:-->
>> >             <test>?</test>
>> >             <!--Optional:-->
>> >             <birthDate>?</birthDate>
>> >             <!--Optional:-->
>> >             <type>?</type>
>> >          </customer>
>> >       </tra:saveCustomer>
>> >    </soapenv:Body>
>> > </soapenv:Envelope>
>> > --------------------------------------
>> > qtp370155726-26 DEBUG
>> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
>> > - WSS4JInInterceptor: enter handleMessage()
>> > qtp370155726-26 WARN
>> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
>> > - Security processing failed (actions mismatch)
>> > qtp370155726-26 WARN
>> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
>> > -
>> > org.apache.ws.security.WSSecurityException: An error was discovered
>> > processing the <wsse:Security> header
>> > at
>> >
>> >
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
>> > at
>> >
>> >
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
>> > at
>> >
>> >
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
>> > at
>> >
>> >
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
>> > at
>> >
>> >
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>> > at
>> >
>> >
>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
>> > at
>> >
>> >
>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
>> > at
>> >
>> >
>> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
>> > at org.eclipse.jetty.server.Server.handle(Server.java:349)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
>> > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
>> > at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
>> > at
>> >
>> >
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
>> > at
>> >
>> >
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
>> > at
>> >
>> >
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
>> > at
>> >
>> >
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
>> > at java.lang.Thread.run(Thread.java:722)
>> > qtp370155726-26 WARN [org.apache.cxf.phase.PhaseInterceptorChain] -
>> > Interceptor for {
>> http://training.fusesource.com/}CustomerServiceServicehas
>> > thrown exception, unwinding now
>> > org.apache.cxf.binding.soap.SoapFault: An error was discovered
>> processing
>> > the <wsse:Security> header
>> > at
>> >
>> >
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:804)
>> > at
>> >
>> >
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:357)
>> > at
>> >
>> >
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
>> > at
>> >
>> >
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
>> > at
>> >
>> >
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>> > at
>> >
>> >
>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
>> > at
>> >
>> >
>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
>> > at
>> >
>> >
>> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
>> > at org.eclipse.jetty.server.Server.handle(Server.java:349)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
>> > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
>> > at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
>> > at
>> >
>> >
>> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
>> > at
>> >
>> >
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
>> > at
>> >
>> >
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
>> > at
>> >
>> >
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
>> > at
>> >
>> >
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
>> > at java.lang.Thread.run(Thread.java:722)
>> > Caused by: org.apache.ws.security.WSSecurityException: An error was
>> > discovered processing the <wsse:Security> header
>> > at
>> >
>> >
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
>> > at
>> >
>> >
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
>> > ... 22 more
>> >
>> >     <cxf:cxfEndpoint id="WS"
>> >                      address="http://localhost:9090/training/WebService
>> "
>> >
>> >  serviceClass="com.fusesource.training.CustomerService">
>> >         <cxf:outInterceptors>
>> >             <ref bean="loggingOutInterceptor"/>
>> >         </cxf:outInterceptors>
>> >         <cxf:inInterceptors>
>> >             <ref bean="loggingInInterceptor"/>
>> >             <ref bean="wss4jInInterceptor"/>
>> >         </cxf:inInterceptors>
>> >     </cxf:cxfEndpoint>
>> >
>> >     <bean id="loggingOutInterceptor"
>> > class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
>> >     <bean id="loggingInInterceptor"
>> > class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
>> >
>> >     <bean id="wss4jInInterceptor"
>> > class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
>> >         <constructor-arg>
>> >             <map>
>> >                 <entry key="action" value="UsernameToken"/>
>> >                 <entry key="passwordType" value="PasswordDigest"/>
>> >                 <entry key="passwordCallbackClass"
>> > value="com.fusesource.training.camel.UTPasswordCallback"/>
>> >             </map>
>> >         </constructor-arg>
>> >     </bean>
>> >
>> > It seems that there is an action mismatch during processing of WSS4J.
>> > Does anybody knows how to solve this issue which is perhaps a CXF or
>> > WSS4J question?
>> >
>> > Regards,
>> >
>> > --
>> > Charles Moulliard
>> > Apache Committer / Sr. Enterprise Architect (RedHat)
>> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>> >
>>
>
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>
>


-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Re: Issue using camel-cxf and wss4j

Posted by Charles Moulliard <ch...@gmail.com>.
Will test with 1.6.9.

Until now in debug mode, I see that in the class WSS4JInInterceptor, when
we handle the message (handleMessage(SoapMessage msg) throws Fault), the
element is empty (            Element elem =
WSSecurityUtil.getSecurityHeader(doc.getSOAPPart(), actor); ) even if a
SOAPHeader with usernameToken + timeStamp has been provided in the
SOAPEnveloppe


On Wed, Jan 9, 2013 at 6:53 PM, Christian Müller <
christian.mueller@gmail.com> wrote:

> Can you upgrade to wss4j 1.6.9? I had a similar issue...
> Am 09.01.2013 17:31 schrieb "Charles Moulliard" <ch...@gmail.com>:
>
> > Hi,
> >
> > When I try to authenticate an HTTP request using WS-Security with
> camel-cxf
> > & wss4j interceptor, I get the following error :
> >
> > org.apache.camel.spring.Main.main() INFO
> > [org.apache.camel.spring.SpringCamelContext] - Total 1 routes, of which 1
> > is started.
> > org.apache.camel.spring.Main.main() INFO
> > [org.apache.camel.spring.SpringCamelContext] - Apache Camel 2.10.0
> > (CamelContext: camel-1) started in 0.993 seconds
> > qtp370155726-26 INFO
> >
> >
> [org.apache.cxf.services.CustomerServiceService.CustomerServicePort.CustomerService]
> > - Inbound Message
> > ----------------------------
> > ID: 1
> > Address: http://127.0.0.1:9090/training/WebService
> > Encoding: UTF-8
> > Http-Method: POST
> > Content-Type: text/xml;charset=UTF-8
> > Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
> > Content-Length=[1590], content-type=[text/xml;charset=UTF-8], Host=[
> > 127.0.0.1:9090], SOAPAction=["
> http://training.fusesource.com/saveCustomer
> > "],
> > User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
> > Payload: <soapenv:Envelope xmlns:soapenv="
> > http://schemas.xmlsoap.org/soap/envelope/" xmlns:tra="
> > http://training.fusesource.com/">
> >    <soapenv:Header>
> >           <wsse:Security xmlns:wsse="
> >
> >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
> > "
> >                soap:mustUnderstand="1">
> > <wsse:UsernameToken xmlns:wsse="
> >
> >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
> > "
> > xmlns:wsu="
> >
> >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
> > "
> > wsu:Id="UsernameToken-1">
> > <wsse:Username>charles</wsse:Username>
> > <wsse:Password Type="
> >
> >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest
> > ">TVzWGxNvhlixNVWol8poD9DHxl8=</wsse:Password>
> > <wsse:Nonce EncodingType="
> >
> >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary
> > ">WsMNSm/C4dzdPS3OhUi94Q==</wsse:Nonce>
> > <wsu:Created>2013-01-09T15:46:14.908Z</wsu:Created>
> > </wsse:UsernameToken>
> > </wsse:Security>
> >    </soapenv:Header>
> >    <soapenv:Body>
> >       <tra:saveCustomer>
> >          <customer>
> >             <!--Optional:-->
> >             <name>?</name>
> >             <!--Zero or more repetitions:-->
> >             <address>?</address>
> >             <numOrders>?</numOrders>
> >             <revenue>?</revenue>
> >             <!--Optional:-->
> >             <test>?</test>
> >             <!--Optional:-->
> >             <birthDate>?</birthDate>
> >             <!--Optional:-->
> >             <type>?</type>
> >          </customer>
> >       </tra:saveCustomer>
> >    </soapenv:Body>
> > </soapenv:Envelope>
> > --------------------------------------
> > qtp370155726-26 DEBUG
> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> > - WSS4JInInterceptor: enter handleMessage()
> > qtp370155726-26 WARN
> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> > - Security processing failed (actions mismatch)
> > qtp370155726-26 WARN
> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> > -
> > org.apache.ws.security.WSSecurityException: An error was discovered
> > processing the <wsse:Security> header
> > at
> >
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
> > at
> >
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
> > at
> >
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
> > at
> >
> >
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> > at
> >
> >
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> > at
> >
> >
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
> > at
> >
> >
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
> > at
> >
> >
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> > at
> >
> >
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
> > at
> >
> >
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
> > at
> >
> >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> > at
> >
> >
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> > at
> >
> >
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
> > at org.eclipse.jetty.server.Server.handle(Server.java:349)
> > at
> >
> >
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
> > at
> >
> >
> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
> > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
> > at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
> > at
> >
> >
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
> > at
> >
> >
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
> > at
> >
> >
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
> > at
> >
> >
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
> > at
> >
> >
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
> > at java.lang.Thread.run(Thread.java:722)
> > qtp370155726-26 WARN [org.apache.cxf.phase.PhaseInterceptorChain] -
> > Interceptor for {
> http://training.fusesource.com/}CustomerServiceServicehas
> > thrown exception, unwinding now
> > org.apache.cxf.binding.soap.SoapFault: An error was discovered processing
> > the <wsse:Security> header
> > at
> >
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:804)
> > at
> >
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:357)
> > at
> >
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
> > at
> >
> >
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> > at
> >
> >
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> > at
> >
> >
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
> > at
> >
> >
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
> > at
> >
> >
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> > at
> >
> >
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
> > at
> >
> >
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
> > at
> >
> >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> > at
> >
> >
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> > at
> >
> >
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
> > at org.eclipse.jetty.server.Server.handle(Server.java:349)
> > at
> >
> >
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
> > at
> >
> >
> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
> > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
> > at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
> > at
> >
> >
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
> > at
> >
> >
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
> > at
> >
> >
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
> > at
> >
> >
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
> > at
> >
> >
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
> > at java.lang.Thread.run(Thread.java:722)
> > Caused by: org.apache.ws.security.WSSecurityException: An error was
> > discovered processing the <wsse:Security> header
> > at
> >
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
> > at
> >
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
> > ... 22 more
> >
> >     <cxf:cxfEndpoint id="WS"
> >                      address="http://localhost:9090/training/WebService"
> >
> >  serviceClass="com.fusesource.training.CustomerService">
> >         <cxf:outInterceptors>
> >             <ref bean="loggingOutInterceptor"/>
> >         </cxf:outInterceptors>
> >         <cxf:inInterceptors>
> >             <ref bean="loggingInInterceptor"/>
> >             <ref bean="wss4jInInterceptor"/>
> >         </cxf:inInterceptors>
> >     </cxf:cxfEndpoint>
> >
> >     <bean id="loggingOutInterceptor"
> > class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
> >     <bean id="loggingInInterceptor"
> > class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
> >
> >     <bean id="wss4jInInterceptor"
> > class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
> >         <constructor-arg>
> >             <map>
> >                 <entry key="action" value="UsernameToken"/>
> >                 <entry key="passwordType" value="PasswordDigest"/>
> >                 <entry key="passwordCallbackClass"
> > value="com.fusesource.training.camel.UTPasswordCallback"/>
> >             </map>
> >         </constructor-arg>
> >     </bean>
> >
> > It seems that there is an action mismatch during processing of WSS4J.
> > Does anybody knows how to solve this issue which is perhaps a CXF or
> > WSS4J question?
> >
> > Regards,
> >
> > --
> > Charles Moulliard
> > Apache Committer / Sr. Enterprise Architect (RedHat)
> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> >
>



-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Re: Issue using camel-cxf and wss4j

Posted by Christian Müller <ch...@gmail.com>.
Can you upgrade to wss4j 1.6.9? I had a similar issue...
Am 09.01.2013 17:31 schrieb "Charles Moulliard" <ch...@gmail.com>:

> Hi,
>
> When I try to authenticate an HTTP request using WS-Security with camel-cxf
> & wss4j interceptor, I get the following error :
>
> org.apache.camel.spring.Main.main() INFO
> [org.apache.camel.spring.SpringCamelContext] - Total 1 routes, of which 1
> is started.
> org.apache.camel.spring.Main.main() INFO
> [org.apache.camel.spring.SpringCamelContext] - Apache Camel 2.10.0
> (CamelContext: camel-1) started in 0.993 seconds
> qtp370155726-26 INFO
>
> [org.apache.cxf.services.CustomerServiceService.CustomerServicePort.CustomerService]
> - Inbound Message
> ----------------------------
> ID: 1
> Address: http://127.0.0.1:9090/training/WebService
> Encoding: UTF-8
> Http-Method: POST
> Content-Type: text/xml;charset=UTF-8
> Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
> Content-Length=[1590], content-type=[text/xml;charset=UTF-8], Host=[
> 127.0.0.1:9090], SOAPAction=["http://training.fusesource.com/saveCustomer
> "],
> User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
> Payload: <soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:tra="
> http://training.fusesource.com/">
>    <soapenv:Header>
>           <wsse:Security xmlns:wsse="
>
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
> "
>                soap:mustUnderstand="1">
> <wsse:UsernameToken xmlns:wsse="
>
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
> "
> xmlns:wsu="
>
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
> "
> wsu:Id="UsernameToken-1">
> <wsse:Username>charles</wsse:Username>
> <wsse:Password Type="
>
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest
> ">TVzWGxNvhlixNVWol8poD9DHxl8=</wsse:Password>
> <wsse:Nonce EncodingType="
>
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary
> ">WsMNSm/C4dzdPS3OhUi94Q==</wsse:Nonce>
> <wsu:Created>2013-01-09T15:46:14.908Z</wsu:Created>
> </wsse:UsernameToken>
> </wsse:Security>
>    </soapenv:Header>
>    <soapenv:Body>
>       <tra:saveCustomer>
>          <customer>
>             <!--Optional:-->
>             <name>?</name>
>             <!--Zero or more repetitions:-->
>             <address>?</address>
>             <numOrders>?</numOrders>
>             <revenue>?</revenue>
>             <!--Optional:-->
>             <test>?</test>
>             <!--Optional:-->
>             <birthDate>?</birthDate>
>             <!--Optional:-->
>             <type>?</type>
>          </customer>
>       </tra:saveCustomer>
>    </soapenv:Body>
> </soapenv:Envelope>
> --------------------------------------
> qtp370155726-26 DEBUG [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> - WSS4JInInterceptor: enter handleMessage()
> qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> - Security processing failed (actions mismatch)
> qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> -
> org.apache.ws.security.WSSecurityException: An error was discovered
> processing the <wsse:Security> header
> at
>
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
> at
>
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
> at
>
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
> at
>
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> at
>
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> at
>
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
> at
>
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
> at
>
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> at
>
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
> at
>
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
> at
>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> at
>
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> at
>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
> at org.eclipse.jetty.server.Server.handle(Server.java:349)
> at
>
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
> at
>
> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
> at
>
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
> at
>
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
> at
>
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
> at
>
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
> at
>
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
> at java.lang.Thread.run(Thread.java:722)
> qtp370155726-26 WARN [org.apache.cxf.phase.PhaseInterceptorChain] -
> Interceptor for {http://training.fusesource.com/}CustomerServiceServicehas
> thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: An error was discovered processing
> the <wsse:Security> header
> at
>
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:804)
> at
>
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:357)
> at
>
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
> at
>
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> at
>
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> at
>
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
> at
>
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
> at
>
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> at
>
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
> at
>
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
> at
>
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> at
>
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> at
>
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
> at org.eclipse.jetty.server.Server.handle(Server.java:349)
> at
>
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
> at
>
> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
> at
>
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
> at
>
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
> at
>
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
> at
>
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
> at
>
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
> at java.lang.Thread.run(Thread.java:722)
> Caused by: org.apache.ws.security.WSSecurityException: An error was
> discovered processing the <wsse:Security> header
> at
>
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
> at
>
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
> ... 22 more
>
>     <cxf:cxfEndpoint id="WS"
>                      address="http://localhost:9090/training/WebService"
>
>  serviceClass="com.fusesource.training.CustomerService">
>         <cxf:outInterceptors>
>             <ref bean="loggingOutInterceptor"/>
>         </cxf:outInterceptors>
>         <cxf:inInterceptors>
>             <ref bean="loggingInInterceptor"/>
>             <ref bean="wss4jInInterceptor"/>
>         </cxf:inInterceptors>
>     </cxf:cxfEndpoint>
>
>     <bean id="loggingOutInterceptor"
> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
>     <bean id="loggingInInterceptor"
> class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
>
>     <bean id="wss4jInInterceptor"
> class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
>         <constructor-arg>
>             <map>
>                 <entry key="action" value="UsernameToken"/>
>                 <entry key="passwordType" value="PasswordDigest"/>
>                 <entry key="passwordCallbackClass"
> value="com.fusesource.training.camel.UTPasswordCallback"/>
>             </map>
>         </constructor-arg>
>     </bean>
>
> It seems that there is an action mismatch during processing of WSS4J.
> Does anybody knows how to solve this issue which is perhaps a CXF or
> WSS4J question?
>
> Regards,
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>

Re: Issue using camel-cxf and wss4j

Posted by Freeman Fang <fr...@gmail.com>.
OK, this issue also discussed on camel mailing list,  it's camel-cxf specific function kick in and change the behavior, [1] just for a better track

[1]http://camel.465427.n5.nabble.com/Issue-using-camel-cxf-and-wss4j-td5725191.html
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

On 2013-1-10, at 下午3:49, Freeman Fang wrote:

> Hi Christian,
> 
> We have the doc here [1] about the ws-security configuration.
> 
> And I spoke too fast, missing SAAJInInterceptor isn't the reason, I rechecked the code, now WSS4JInInterceptor can pull in SAAJInInterceptor automatically.
> Most likely it's a camel-cxf specific issue
> 
> [1]http://cxf.apache.org/docs/ws-security.html
> -------------
> Freeman(Yue) Fang
> 
> Red Hat, Inc. 
> FuseSource is now part of Red Hat
> Web: http://fusesource.com | http://www.redhat.com/
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> http://blog.sina.com.cn/u/1473905042
> weibo: @Freeman小屋
> 
> On 2013-1-10, at 下午3:12, Christian Müller wrote:
> 
>> Is this documented somewhere?
>> 
>> Best,
>> Christian
>> Am 10.01.2013 06:14 schrieb "Freeman Fang" <fr...@gmail.com>:
>> 
>>> Hi Charles,
>>> 
>>> Please also add org.apache.cxf.binding.soap.saaj.SAAJInInterceptor
>>> for <cxf:inInterceptors>
>>> -------------
>>> Freeman(Yue) Fang
>>> 
>>> Red Hat, Inc.
>>> FuseSource is now part of Red Hat
>>> Web: http://fusesource.com | http://www.redhat.com/
>>> Twitter: freemanfang
>>> Blog: http://freemanfang.blogspot.com
>>> http://blog.sina.com.cn/u/1473905042
>>> weibo: @Freeman小屋
>>> 
>>> On 2013-1-10, at 上午3:30, Charles Moulliard wrote:
>>> 
>>>> Hi,
>>>> 
>>>> When I try to authenticate an HTTP request using WS-Security with
>>> camel-cxf
>>>> & wss4j interceptor, I get the following error :
>>>> 
>>>> qtp370155726-26 DEBUG
>>> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
>>>> - WSS4JInInterceptor: enter handleMessage()
>>>> qtp370155726-26 WARN
>>> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
>>>> - Security processing failed (actions mismatch)
>>>> qtp370155726-26 WARN
>>> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
>>>> -
>>>> org.apache.ws.security.WSSecurityException: An error was discovered
>>>> processing the <wsse:Security> header
>>>> at
>>>> 
>>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
>>>> at
>>>> 
>>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
>>>> at
>>>> 
>>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
>>>> at
>>>> 
>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
>>>> at
>>>> 
>>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>>>> at
>>>> 
>>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
>>>> at
>>>> 
>>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
>>>> at
>>>> 
>>> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
>>>> at org.eclipse.jetty.server.Server.handle(Server.java:349)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
>>>> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
>>>> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
>>>> at
>>>> 
>>> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
>>>> at
>>>> 
>>> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
>>>> at
>>>> 
>>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
>>>> at
>>>> 
>>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
>>>> at java.lang.Thread.run(Thread.java:722)
>>>> qtp370155726-26 WARN [org.apache.cxf.phase.PhaseInterceptorChain] -
>>>> Interceptor for {http://training.fusesource.com/}CustomerServiceServicehas
>>>> thrown exception, unwinding now
>>>> org.apache.cxf.binding.soap.SoapFault: An error was discovered processing
>>>> the <wsse:Security> header
>>>> at
>>>> 
>>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:804)
>>>> at
>>>> 
>>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:357)
>>>> at
>>>> 
>>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
>>>> at
>>>> 
>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
>>>> at
>>>> 
>>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>>>> at
>>>> 
>>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
>>>> at
>>>> 
>>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
>>>> at
>>>> 
>>> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
>>>> at org.eclipse.jetty.server.Server.handle(Server.java:349)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
>>>> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
>>>> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
>>>> at
>>>> 
>>> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
>>>> at
>>>> 
>>> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
>>>> at
>>>> 
>>> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
>>>> at
>>>> 
>>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
>>>> at
>>>> 
>>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
>>>> at java.lang.Thread.run(Thread.java:722)
>>>> Caused by: org.apache.ws.security.WSSecurityException: An error was
>>>> discovered processing the <wsse:Security> header
>>>> at
>>>> 
>>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
>>>> at
>>>> 
>>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
>>>> ... 22 more
>>>> 
>>>> even if SOAPEnvelopper message received by CXF contains SOAP Security
>>> Header
>>>> 
>>>> ID: 1
>>>> Address: http://127.0.0.1:9090/training/WebService
>>>> Encoding: UTF-8
>>>> Http-Method: POST
>>>> Content-Type: text/xml;charset=UTF-8
>>>> Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
>>>> Content-Length=[1590], content-type=[text/xml;charset=UTF-8], Host=[
>>>> 127.0.0.1:9090], SOAPAction=["
>>> http://training.fusesource.com/saveCustomer"],
>>>> User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
>>>> Payload: <soapenv:Envelope xmlns:soapenv="
>>>> http://schemas.xmlsoap.org/soap/envelope/" xmlns:tra="
>>>> http://training.fusesource.com/">
>>>>  <soapenv:Header>
>>>>          <wsse:Security xmlns:wsse="
>>>> 
>>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
>>>> "
>>>>               soap:mustUnderstand="1">
>>>> <wsse:UsernameToken xmlns:wsse="
>>>> 
>>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
>>> "
>>>> xmlns:wsu="
>>>> 
>>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
>>> "
>>>> wsu:Id="UsernameToken-1">
>>>> <wsse:Username>charles</wsse:Username>
>>>> <wsse:Password Type="
>>>> 
>>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest
>>>> ">TVzWGxNvhlixNVWol8poD9DHxl8=</wsse:Password>
>>>> <wsse:Nonce EncodingType="
>>>> 
>>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary
>>>> ">WsMNSm/C4dzdPS3OhUi94Q==</wsse:Nonce>
>>>> <wsu:Created>2013-01-09T15:46:14.908Z</wsu:Created>
>>>> </wsse:UsernameToken>
>>>> </wsse:Security>
>>>>  </soapenv:Header>
>>>>  <soapenv:Body>
>>>>     <tra:saveCustomer>
>>>>        <customer>
>>>>           <!--Optional:-->
>>>>           <name>?</name>
>>>>           <!--Zero or more repetitions:-->
>>>>           <address>?</address>
>>>>           <numOrders>?</numOrders>
>>>>           <revenue>?</revenue>
>>>>           <!--Optional:-->
>>>>           <test>?</test>
>>>>           <!--Optional:-->
>>>>           <birthDate>?</birthDate>
>>>>           <!--Optional:-->
>>>>           <type>?</type>
>>>>        </customer>
>>>>     </tra:saveCustomer>
>>>>  </soapenv:Body>
>>>> </soapenv:Envelope>
>>>> --------------------------------------
>>>> 
>>>> CXF & Camel config
>>>> 
>>>>   <cxf:cxfEndpoint id="WS"
>>>>                    address="http://localhost:9090/training/WebService"
>>>> 
>>> serviceClass="com.fusesource.training.CustomerService">
>>>>       <cxf:outInterceptors>
>>>>           <ref bean="loggingOutInterceptor"/>
>>>>        </cxf:outInterceptors>
>>>>       <cxf:inInterceptors>
>>>>           <ref bean="loggingInInterceptor"/>
>>>>           <ref bean="wss4jInInterceptor"/>
>>>>       </cxf:inInterceptors>
>>>>   </cxf:cxfEndpoint>
>>>> 
>>>>   <bean id="loggingOutInterceptor"
>>>> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
>>>>   <bean id="loggingInInterceptor"
>>>> class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
>>>> 
>>>>   <bean id="wss4jInInterceptor"
>>>> class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
>>>>       <constructor-arg>
>>>>           <map>
>>>>               <entry key="action" value="UsernameToken"/>
>>>>               <entry key="passwordType" value="PasswordDigest"/>
>>>>               <entry key="passwordCallbackClass"
>>>> value="com.fusesource.training.camel.UTPasswordCallback"/>
>>>>           </map>
>>>>       </constructor-arg>
>>>>   </bean>
>>>> 
>>>> Version of CXF used : 2.7.1
>>>> WSS4J : 1.6.8
>>>> 
>>>> In debug mode, I can see that in the class WSS4JInInterceptor when we
>>>> handle the message (handleMessage(SoapMessage msg) throws Fault), the
>>>> element is null ( Element elem =
>>>> WSSecurityUtil.getSecurityHeader(doc.getSOAPPart(),
>>>> actor); ) like also wsResult.
>>>> 
>>>> Does anybody knows how to solve this issue and why SoapHeaders have been
>>>> removed ?
>>>> 
>>>> Regards,
>>>> 
>>>> Charles Moulliard
>>>> Apache Committer / Sr. Enterprise Architect (RedHat)
>>>> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>>> 
>>> 
> 


Re: Issue using camel-cxf and wss4j

Posted by Freeman Fang <fr...@gmail.com>.
Hi Christian,

We have the doc here [1] about the ws-security configuration.

And I spoke too fast, missing SAAJInInterceptor isn't the reason, I rechecked the code, now WSS4JInInterceptor can pull in SAAJInInterceptor automatically.
Most likely it's a camel-cxf specific issue

[1]http://cxf.apache.org/docs/ws-security.html
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

On 2013-1-10, at 下午3:12, Christian Müller wrote:

> Is this documented somewhere?
> 
> Best,
> Christian
> Am 10.01.2013 06:14 schrieb "Freeman Fang" <fr...@gmail.com>:
> 
>> Hi Charles,
>> 
>> Please also add org.apache.cxf.binding.soap.saaj.SAAJInInterceptor
>> for <cxf:inInterceptors>
>> -------------
>> Freeman(Yue) Fang
>> 
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Web: http://fusesource.com | http://www.redhat.com/
>> Twitter: freemanfang
>> Blog: http://freemanfang.blogspot.com
>> http://blog.sina.com.cn/u/1473905042
>> weibo: @Freeman小屋
>> 
>> On 2013-1-10, at 上午3:30, Charles Moulliard wrote:
>> 
>>> Hi,
>>> 
>>> When I try to authenticate an HTTP request using WS-Security with
>> camel-cxf
>>> & wss4j interceptor, I get the following error :
>>> 
>>> qtp370155726-26 DEBUG
>> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
>>> - WSS4JInInterceptor: enter handleMessage()
>>> qtp370155726-26 WARN
>> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
>>> - Security processing failed (actions mismatch)
>>> qtp370155726-26 WARN
>> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
>>> -
>>> org.apache.ws.security.WSSecurityException: An error was discovered
>>> processing the <wsse:Security> header
>>> at
>>> 
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
>>> at
>>> 
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
>>> at
>>> 
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
>>> at
>>> 
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
>>> at
>>> 
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>>> at
>>> 
>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
>>> at
>>> 
>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
>>> at
>>> 
>> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
>>> at
>>> 
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
>>> at
>>> 
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
>>> at
>>> 
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
>>> at
>>> 
>> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
>>> at
>>> 
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
>>> at org.eclipse.jetty.server.Server.handle(Server.java:349)
>>> at
>>> 
>> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
>>> at
>>> 
>> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
>>> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
>>> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
>>> at
>>> 
>> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
>>> at
>>> 
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
>>> at
>>> 
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
>>> at
>>> 
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
>>> at
>>> 
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
>>> at java.lang.Thread.run(Thread.java:722)
>>> qtp370155726-26 WARN [org.apache.cxf.phase.PhaseInterceptorChain] -
>>> Interceptor for {http://training.fusesource.com/}CustomerServiceServicehas
>>> thrown exception, unwinding now
>>> org.apache.cxf.binding.soap.SoapFault: An error was discovered processing
>>> the <wsse:Security> header
>>> at
>>> 
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:804)
>>> at
>>> 
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:357)
>>> at
>>> 
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
>>> at
>>> 
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
>>> at
>>> 
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>>> at
>>> 
>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
>>> at
>>> 
>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
>>> at
>>> 
>> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
>>> at
>>> 
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
>>> at
>>> 
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
>>> at
>>> 
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
>>> at
>>> 
>> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
>>> at
>>> 
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
>>> at org.eclipse.jetty.server.Server.handle(Server.java:349)
>>> at
>>> 
>> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
>>> at
>>> 
>> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
>>> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
>>> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
>>> at
>>> 
>> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
>>> at
>>> 
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
>>> at
>>> 
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
>>> at
>>> 
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
>>> at
>>> 
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
>>> at java.lang.Thread.run(Thread.java:722)
>>> Caused by: org.apache.ws.security.WSSecurityException: An error was
>>> discovered processing the <wsse:Security> header
>>> at
>>> 
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
>>> at
>>> 
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
>>> ... 22 more
>>> 
>>> even if SOAPEnvelopper message received by CXF contains SOAP Security
>> Header
>>> 
>>> ID: 1
>>> Address: http://127.0.0.1:9090/training/WebService
>>> Encoding: UTF-8
>>> Http-Method: POST
>>> Content-Type: text/xml;charset=UTF-8
>>> Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
>>> Content-Length=[1590], content-type=[text/xml;charset=UTF-8], Host=[
>>> 127.0.0.1:9090], SOAPAction=["
>> http://training.fusesource.com/saveCustomer"],
>>> User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
>>> Payload: <soapenv:Envelope xmlns:soapenv="
>>> http://schemas.xmlsoap.org/soap/envelope/" xmlns:tra="
>>> http://training.fusesource.com/">
>>>  <soapenv:Header>
>>>          <wsse:Security xmlns:wsse="
>>> 
>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
>>> "
>>>               soap:mustUnderstand="1">
>>> <wsse:UsernameToken xmlns:wsse="
>>> 
>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
>> "
>>> xmlns:wsu="
>>> 
>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
>> "
>>> wsu:Id="UsernameToken-1">
>>> <wsse:Username>charles</wsse:Username>
>>> <wsse:Password Type="
>>> 
>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest
>>> ">TVzWGxNvhlixNVWol8poD9DHxl8=</wsse:Password>
>>> <wsse:Nonce EncodingType="
>>> 
>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary
>>> ">WsMNSm/C4dzdPS3OhUi94Q==</wsse:Nonce>
>>> <wsu:Created>2013-01-09T15:46:14.908Z</wsu:Created>
>>> </wsse:UsernameToken>
>>> </wsse:Security>
>>>  </soapenv:Header>
>>>  <soapenv:Body>
>>>     <tra:saveCustomer>
>>>        <customer>
>>>           <!--Optional:-->
>>>           <name>?</name>
>>>           <!--Zero or more repetitions:-->
>>>           <address>?</address>
>>>           <numOrders>?</numOrders>
>>>           <revenue>?</revenue>
>>>           <!--Optional:-->
>>>           <test>?</test>
>>>           <!--Optional:-->
>>>           <birthDate>?</birthDate>
>>>           <!--Optional:-->
>>>           <type>?</type>
>>>        </customer>
>>>     </tra:saveCustomer>
>>>  </soapenv:Body>
>>> </soapenv:Envelope>
>>> --------------------------------------
>>> 
>>> CXF & Camel config
>>> 
>>>   <cxf:cxfEndpoint id="WS"
>>>                    address="http://localhost:9090/training/WebService"
>>> 
>> serviceClass="com.fusesource.training.CustomerService">
>>>       <cxf:outInterceptors>
>>>           <ref bean="loggingOutInterceptor"/>
>>>        </cxf:outInterceptors>
>>>       <cxf:inInterceptors>
>>>           <ref bean="loggingInInterceptor"/>
>>>           <ref bean="wss4jInInterceptor"/>
>>>       </cxf:inInterceptors>
>>>   </cxf:cxfEndpoint>
>>> 
>>>   <bean id="loggingOutInterceptor"
>>> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
>>>   <bean id="loggingInInterceptor"
>>> class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
>>> 
>>>   <bean id="wss4jInInterceptor"
>>> class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
>>>       <constructor-arg>
>>>           <map>
>>>               <entry key="action" value="UsernameToken"/>
>>>               <entry key="passwordType" value="PasswordDigest"/>
>>>               <entry key="passwordCallbackClass"
>>> value="com.fusesource.training.camel.UTPasswordCallback"/>
>>>           </map>
>>>       </constructor-arg>
>>>   </bean>
>>> 
>>> Version of CXF used : 2.7.1
>>> WSS4J : 1.6.8
>>> 
>>> In debug mode, I can see that in the class WSS4JInInterceptor when we
>>> handle the message (handleMessage(SoapMessage msg) throws Fault), the
>>> element is null ( Element elem =
>>> WSSecurityUtil.getSecurityHeader(doc.getSOAPPart(),
>>> actor); ) like also wsResult.
>>> 
>>> Does anybody knows how to solve this issue and why SoapHeaders have been
>>> removed ?
>>> 
>>> Regards,
>>> 
>>> Charles Moulliard
>>> Apache Committer / Sr. Enterprise Architect (RedHat)
>>> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>> 
>> 


Re: Issue using camel-cxf and wss4j

Posted by Christian Müller <ch...@gmail.com>.
Is this documented somewhere?

Best,
Christian
Am 10.01.2013 06:14 schrieb "Freeman Fang" <fr...@gmail.com>:

> Hi Charles,
>
> Please also add org.apache.cxf.binding.soap.saaj.SAAJInInterceptor
> for <cxf:inInterceptors>
> -------------
> Freeman(Yue) Fang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://fusesource.com | http://www.redhat.com/
> Twitter: freemanfang
> Blog: http://freemanfang.blogspot.com
> http://blog.sina.com.cn/u/1473905042
> weibo: @Freeman小屋
>
> On 2013-1-10, at 上午3:30, Charles Moulliard wrote:
>
> > Hi,
> >
> > When I try to authenticate an HTTP request using WS-Security with
> camel-cxf
> > & wss4j interceptor, I get the following error :
> >
> > qtp370155726-26 DEBUG
> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> > - WSS4JInInterceptor: enter handleMessage()
> > qtp370155726-26 WARN
> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> > - Security processing failed (actions mismatch)
> > qtp370155726-26 WARN
> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> > -
> > org.apache.ws.security.WSSecurityException: An error was discovered
> > processing the <wsse:Security> header
> > at
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
> > at
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
> > at
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
> > at
> >
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> > at
> >
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> > at
> >
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
> > at
> >
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
> > at
> >
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> > at
> >
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
> > at
> >
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
> > at
> >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> > at
> >
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> > at
> >
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
> > at org.eclipse.jetty.server.Server.handle(Server.java:349)
> > at
> >
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
> > at
> >
> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
> > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
> > at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
> > at
> >
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
> > at
> >
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
> > at
> >
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
> > at
> >
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
> > at
> >
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
> > at java.lang.Thread.run(Thread.java:722)
> > qtp370155726-26 WARN [org.apache.cxf.phase.PhaseInterceptorChain] -
> > Interceptor for {http://training.fusesource.com/}CustomerServiceServicehas
> > thrown exception, unwinding now
> > org.apache.cxf.binding.soap.SoapFault: An error was discovered processing
> > the <wsse:Security> header
> > at
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:804)
> > at
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:357)
> > at
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
> > at
> >
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> > at
> >
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> > at
> >
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
> > at
> >
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
> > at
> >
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> > at
> >
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
> > at
> >
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
> > at
> >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> > at
> >
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> > at
> >
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
> > at org.eclipse.jetty.server.Server.handle(Server.java:349)
> > at
> >
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
> > at
> >
> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
> > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
> > at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
> > at
> >
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
> > at
> >
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
> > at
> >
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
> > at
> >
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
> > at
> >
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
> > at java.lang.Thread.run(Thread.java:722)
> > Caused by: org.apache.ws.security.WSSecurityException: An error was
> > discovered processing the <wsse:Security> header
> > at
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
> > at
> >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
> > ... 22 more
> >
> > even if SOAPEnvelopper message received by CXF contains SOAP Security
> Header
> >
> > ID: 1
> > Address: http://127.0.0.1:9090/training/WebService
> > Encoding: UTF-8
> > Http-Method: POST
> > Content-Type: text/xml;charset=UTF-8
> > Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
> > Content-Length=[1590], content-type=[text/xml;charset=UTF-8], Host=[
> > 127.0.0.1:9090], SOAPAction=["
> http://training.fusesource.com/saveCustomer"],
> > User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
> > Payload: <soapenv:Envelope xmlns:soapenv="
> > http://schemas.xmlsoap.org/soap/envelope/" xmlns:tra="
> > http://training.fusesource.com/">
> >   <soapenv:Header>
> >           <wsse:Security xmlns:wsse="
> >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
> > "
> >                soap:mustUnderstand="1">
> > <wsse:UsernameToken xmlns:wsse="
> >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
> "
> > xmlns:wsu="
> >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
> "
> > wsu:Id="UsernameToken-1">
> > <wsse:Username>charles</wsse:Username>
> > <wsse:Password Type="
> >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest
> > ">TVzWGxNvhlixNVWol8poD9DHxl8=</wsse:Password>
> > <wsse:Nonce EncodingType="
> >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary
> > ">WsMNSm/C4dzdPS3OhUi94Q==</wsse:Nonce>
> > <wsu:Created>2013-01-09T15:46:14.908Z</wsu:Created>
> > </wsse:UsernameToken>
> > </wsse:Security>
> >   </soapenv:Header>
> >   <soapenv:Body>
> >      <tra:saveCustomer>
> >         <customer>
> >            <!--Optional:-->
> >            <name>?</name>
> >            <!--Zero or more repetitions:-->
> >            <address>?</address>
> >            <numOrders>?</numOrders>
> >            <revenue>?</revenue>
> >            <!--Optional:-->
> >            <test>?</test>
> >            <!--Optional:-->
> >            <birthDate>?</birthDate>
> >            <!--Optional:-->
> >            <type>?</type>
> >         </customer>
> >      </tra:saveCustomer>
> >   </soapenv:Body>
> > </soapenv:Envelope>
> > --------------------------------------
> >
> > CXF & Camel config
> >
> >    <cxf:cxfEndpoint id="WS"
> >                     address="http://localhost:9090/training/WebService"
> >
> serviceClass="com.fusesource.training.CustomerService">
> >        <cxf:outInterceptors>
> >            <ref bean="loggingOutInterceptor"/>
> >         </cxf:outInterceptors>
> >        <cxf:inInterceptors>
> >            <ref bean="loggingInInterceptor"/>
> >            <ref bean="wss4jInInterceptor"/>
> >        </cxf:inInterceptors>
> >    </cxf:cxfEndpoint>
> >
> >    <bean id="loggingOutInterceptor"
> > class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
> >    <bean id="loggingInInterceptor"
> > class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
> >
> >    <bean id="wss4jInInterceptor"
> > class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
> >        <constructor-arg>
> >            <map>
> >                <entry key="action" value="UsernameToken"/>
> >                <entry key="passwordType" value="PasswordDigest"/>
> >                <entry key="passwordCallbackClass"
> > value="com.fusesource.training.camel.UTPasswordCallback"/>
> >            </map>
> >        </constructor-arg>
> >    </bean>
> >
> > Version of CXF used : 2.7.1
> > WSS4J : 1.6.8
> >
> > In debug mode, I can see that in the class WSS4JInInterceptor when we
> > handle the message (handleMessage(SoapMessage msg) throws Fault), the
> > element is null ( Element elem =
> > WSSecurityUtil.getSecurityHeader(doc.getSOAPPart(),
> > actor); ) like also wsResult.
> >
> > Does anybody knows how to solve this issue and why SoapHeaders have been
> > removed ?
> >
> > Regards,
> >
> > Charles Moulliard
> > Apache Committer / Sr. Enterprise Architect (RedHat)
> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>
>

Re: Issue using camel-cxf and wss4j

Posted by Freeman Fang <fr...@gmail.com>.
Hi Charles,

Please also add org.apache.cxf.binding.soap.saaj.SAAJInInterceptor 
for <cxf:inInterceptors>
-------------
Freeman(Yue) Fang

Red Hat, Inc. 
FuseSource is now part of Red Hat
Web: http://fusesource.com | http://www.redhat.com/
Twitter: freemanfang
Blog: http://freemanfang.blogspot.com
http://blog.sina.com.cn/u/1473905042
weibo: @Freeman小屋

On 2013-1-10, at 上午3:30, Charles Moulliard wrote:

> Hi,
> 
> When I try to authenticate an HTTP request using WS-Security with camel-cxf
> & wss4j interceptor, I get the following error :
> 
> qtp370155726-26 DEBUG [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> - WSS4JInInterceptor: enter handleMessage()
> qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> - Security processing failed (actions mismatch)
> qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> -
> org.apache.ws.security.WSSecurityException: An error was discovered
> processing the <wsse:Security> header
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
> at org.eclipse.jetty.server.Server.handle(Server.java:349)
> at
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
> at
> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
> at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
> at java.lang.Thread.run(Thread.java:722)
> qtp370155726-26 WARN [org.apache.cxf.phase.PhaseInterceptorChain] -
> Interceptor for {http://training.fusesource.com/}CustomerServiceService has
> thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: An error was discovered processing
> the <wsse:Security> header
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:804)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:357)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
> at org.eclipse.jetty.server.Server.handle(Server.java:349)
> at
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
> at
> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
> at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
> at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
> at java.lang.Thread.run(Thread.java:722)
> Caused by: org.apache.ws.security.WSSecurityException: An error was
> discovered processing the <wsse:Security> header
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
> ... 22 more
> 
> even if SOAPEnvelopper message received by CXF contains SOAP Security Header
> 
> ID: 1
> Address: http://127.0.0.1:9090/training/WebService
> Encoding: UTF-8
> Http-Method: POST
> Content-Type: text/xml;charset=UTF-8
> Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
> Content-Length=[1590], content-type=[text/xml;charset=UTF-8], Host=[
> 127.0.0.1:9090], SOAPAction=["http://training.fusesource.com/saveCustomer"],
> User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
> Payload: <soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:tra="
> http://training.fusesource.com/">
>   <soapenv:Header>
>           <wsse:Security xmlns:wsse="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
> "
>                soap:mustUnderstand="1">
> <wsse:UsernameToken xmlns:wsse="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
> xmlns:wsu="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> wsu:Id="UsernameToken-1">
> <wsse:Username>charles</wsse:Username>
> <wsse:Password Type="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest
> ">TVzWGxNvhlixNVWol8poD9DHxl8=</wsse:Password>
> <wsse:Nonce EncodingType="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary
> ">WsMNSm/C4dzdPS3OhUi94Q==</wsse:Nonce>
> <wsu:Created>2013-01-09T15:46:14.908Z</wsu:Created>
> </wsse:UsernameToken>
> </wsse:Security>
>   </soapenv:Header>
>   <soapenv:Body>
>      <tra:saveCustomer>
>         <customer>
>            <!--Optional:-->
>            <name>?</name>
>            <!--Zero or more repetitions:-->
>            <address>?</address>
>            <numOrders>?</numOrders>
>            <revenue>?</revenue>
>            <!--Optional:-->
>            <test>?</test>
>            <!--Optional:-->
>            <birthDate>?</birthDate>
>            <!--Optional:-->
>            <type>?</type>
>         </customer>
>      </tra:saveCustomer>
>   </soapenv:Body>
> </soapenv:Envelope>
> --------------------------------------
> 
> CXF & Camel config
> 
>    <cxf:cxfEndpoint id="WS"
>                     address="http://localhost:9090/training/WebService"
>                     serviceClass="com.fusesource.training.CustomerService">
>        <cxf:outInterceptors>
>            <ref bean="loggingOutInterceptor"/>
>         </cxf:outInterceptors>
>        <cxf:inInterceptors>
>            <ref bean="loggingInInterceptor"/>
>            <ref bean="wss4jInInterceptor"/>
>        </cxf:inInterceptors>
>    </cxf:cxfEndpoint>
> 
>    <bean id="loggingOutInterceptor"
> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
>    <bean id="loggingInInterceptor"
> class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
> 
>    <bean id="wss4jInInterceptor"
> class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
>        <constructor-arg>
>            <map>
>                <entry key="action" value="UsernameToken"/>
>                <entry key="passwordType" value="PasswordDigest"/>
>                <entry key="passwordCallbackClass"
> value="com.fusesource.training.camel.UTPasswordCallback"/>
>            </map>
>        </constructor-arg>
>    </bean>
> 
> Version of CXF used : 2.7.1
> WSS4J : 1.6.8
> 
> In debug mode, I can see that in the class WSS4JInInterceptor when we
> handle the message (handleMessage(SoapMessage msg) throws Fault), the
> element is null ( Element elem =
> WSSecurityUtil.getSecurityHeader(doc.getSOAPPart(),
> actor); ) like also wsResult.
> 
> Does anybody knows how to solve this issue and why SoapHeaders have been
> removed ?
> 
> Regards,
> 
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com


Fwd: Issue using camel-cxf and wss4j

Posted by Charles Moulliard <ch...@gmail.com>.
Hi,

When I try to authenticate an HTTP request using WS-Security with camel-cxf
& wss4j interceptor, I get the following error :

qtp370155726-26 DEBUG [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
- WSS4JInInterceptor: enter handleMessage()
qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
- Security processing failed (actions mismatch)
qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
-
org.apache.ws.security.WSSecurityException: An error was discovered
processing the <wsse:Security> header
at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
 at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
 at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
 at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
 at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
 at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
 at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
 at org.eclipse.jetty.server.Server.handle(Server.java:349)
at
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
 at
org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
 at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
 at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
 at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
 at java.lang.Thread.run(Thread.java:722)
qtp370155726-26 WARN [org.apache.cxf.phase.PhaseInterceptorChain] -
Interceptor for {http://training.fusesource.com/}CustomerServiceService has
thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: An error was discovered processing
the <wsse:Security> header
at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:804)
 at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:357)
at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
 at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
at
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
 at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
at
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
 at
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
at
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
 at
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
 at
org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
 at org.eclipse.jetty.server.Server.handle(Server.java:349)
at
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
 at
org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
 at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
at
org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
 at
org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
at
org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
 at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
 at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.ws.security.WSSecurityException: An error was
discovered processing the <wsse:Security> header
 at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
 ... 22 more

even if SOAPEnvelopper message received by CXF contains SOAP Security Header

ID: 1
Address: http://127.0.0.1:9090/training/WebService
Encoding: UTF-8
Http-Method: POST
Content-Type: text/xml;charset=UTF-8
Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
Content-Length=[1590], content-type=[text/xml;charset=UTF-8], Host=[
127.0.0.1:9090], SOAPAction=["http://training.fusesource.com/saveCustomer"],
User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
Payload: <soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:tra="
http://training.fusesource.com/">
   <soapenv:Header>
           <wsse:Security xmlns:wsse="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
"
                soap:mustUnderstand="1">
<wsse:UsernameToken xmlns:wsse="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="UsernameToken-1">
 <wsse:Username>charles</wsse:Username>
<wsse:Password Type="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest
">TVzWGxNvhlixNVWol8poD9DHxl8=</wsse:Password>
 <wsse:Nonce EncodingType="
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary
">WsMNSm/C4dzdPS3OhUi94Q==</wsse:Nonce>
 <wsu:Created>2013-01-09T15:46:14.908Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
   </soapenv:Header>
   <soapenv:Body>
      <tra:saveCustomer>
         <customer>
            <!--Optional:-->
            <name>?</name>
            <!--Zero or more repetitions:-->
            <address>?</address>
            <numOrders>?</numOrders>
            <revenue>?</revenue>
            <!--Optional:-->
            <test>?</test>
            <!--Optional:-->
            <birthDate>?</birthDate>
            <!--Optional:-->
            <type>?</type>
         </customer>
      </tra:saveCustomer>
   </soapenv:Body>
</soapenv:Envelope>
--------------------------------------

CXF & Camel config

    <cxf:cxfEndpoint id="WS"
                     address="http://localhost:9090/training/WebService"
                     serviceClass="com.fusesource.training.CustomerService">
        <cxf:outInterceptors>
            <ref bean="loggingOutInterceptor"/>
         </cxf:outInterceptors>
        <cxf:inInterceptors>
            <ref bean="loggingInInterceptor"/>
            <ref bean="wss4jInInterceptor"/>
        </cxf:inInterceptors>
    </cxf:cxfEndpoint>

    <bean id="loggingOutInterceptor"
class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
    <bean id="loggingInInterceptor"
class="org.apache.cxf.interceptor.LoggingInInterceptor"/>

    <bean id="wss4jInInterceptor"
class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
        <constructor-arg>
            <map>
                <entry key="action" value="UsernameToken"/>
                <entry key="passwordType" value="PasswordDigest"/>
                <entry key="passwordCallbackClass"
value="com.fusesource.training.camel.UTPasswordCallback"/>
            </map>
        </constructor-arg>
    </bean>

Version of CXF used : 2.7.1
WSS4J : 1.6.8

In debug mode, I can see that in the class WSS4JInInterceptor when we
handle the message (handleMessage(SoapMessage msg) throws Fault), the
element is null ( Element elem =
WSSecurityUtil.getSecurityHeader(doc.getSOAPPart(),
actor); ) like also wsResult.

Does anybody knows how to solve this issue and why SoapHeaders have been
removed ?

Regards,

Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Re: Issue using camel-cxf and wss4j

Posted by Charles Moulliard <ch...@gmail.com>.
Willem,

That could be nice to create in camel cxf page doc a table describing for
each DataFormat if we keep or skip headers and what is changed according to
CXF interceptors (out and in) ...

MESSAGE should be also marked as DEPRECATED now as it is replaces by RAW

Regards,

Charles


On Thu, Jan 10, 2013 at 11:09 AM, Willem jiang <wi...@gmail.com>wrote:

> I can take care of the document. It looks like we need to do a clean up
> before release Camel 2.11.0.
>
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
> (English)
>           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
>
> On Thursday, January 10, 2013 at 6:04 PM, Claus Ibsen wrote:
>
> > On Thu, Jan 10, 2013 at 10:53 AM, Charles Moulliard <ch007m@gmail.com(mailto:
> ch007m@gmail.com)> wrote:
> > > That works now with this dataformat=CXF_MESSAGE when using Ws-Security
> &
> > > wss4j. Thx.
> >
> >
> >
> > Ah great.
> >
> > Would someone with love for CXF and Camel mind helping with adding
> > docs about these new data formats
> > added to camel-cxf?
> >
> > I dislike when people add important new stuff, that they dont take the
> > time to add docs about it.
> > For example is solves an important issue such as Charles having here.
> >
> > There is a JIRA ticket about the missing pieces I added a while back,
> > when I encountered this the first time.
> > Sorry I am not the main maintainer of camel-cxf so I would like ppl
> > from the CXF side of things to help with the docs
> > as they are the best candidates for that.
> >
> >
> > >
> > > On Thu, Jan 10, 2013 at 10:45 AM, Claus Ibsen <claus.ibsen@gmail.com(mailto:
> claus.ibsen@gmail.com)> wrote:
> > >
> > > > On Thu, Jan 10, 2013 at 10:37 AM, Charles Moulliard <
> ch007m@gmail.com (mailto:ch007m@gmail.com)>
> > > > wrote:
> > > > > I don't find info about this dataFormat (CXF_MESSAGE) in CXF. Does
> it
> > > >
> > > >
> > > > exist
> > > > > ?
> > > >
> > > >
> > > >
> > > > Its in camel-cxf, and was recently added to it (eg within the last 6
> > > > months or so I think)
> > > >
> > > > >
> > > > > On Thu, Jan 10, 2013 at 8:43 AM, Willem jiang <
> willem.jiang@gmail.com (mailto:willem.jiang@gmail.com)
> > > > > wrote:
> > > > >
> > > > > > CXF_MESSAGE
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Charles Moulliard
> > > > > Apache Committer / Sr. Enterprise Architect (RedHat)
> > > > > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > --
> > > > Claus Ibsen
> > > > -----------------
> > > > Red Hat, Inc.
> > > > FuseSource is now part of Red Hat
> > > > Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> > > > Web: http://fusesource.com
> > > > Twitter: davsclaus
> > > > Blog: http://davsclaus.com
> > > > Author of Camel in Action: http://www.manning.com/ibsen
> > >
> > >
> > >
> > >
> > >
> > > --
> > > Charles Moulliard
> > > Apache Committer / Sr. Enterprise Architect (RedHat)
> > > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> >
> >
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > Red Hat, Inc.
> > FuseSource is now part of Red Hat
> > Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> > Web: http://fusesource.com
> > Twitter: davsclaus
> > Blog: http://davsclaus.com
> > Author of Camel in Action: http://www.manning.com/ibsen
>
>
>
>


-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Re: Issue using camel-cxf and wss4j

Posted by Willem jiang <wi...@gmail.com>.
I can take care of the document. It looks like we need to do a clean up before release Camel 2.11.0.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem




On Thursday, January 10, 2013 at 6:04 PM, Claus Ibsen wrote:

> On Thu, Jan 10, 2013 at 10:53 AM, Charles Moulliard <ch007m@gmail.com (mailto:ch007m@gmail.com)> wrote:
> > That works now with this dataformat=CXF_MESSAGE when using Ws-Security &
> > wss4j. Thx.
>  
>  
>  
> Ah great.
>  
> Would someone with love for CXF and Camel mind helping with adding
> docs about these new data formats
> added to camel-cxf?
>  
> I dislike when people add important new stuff, that they dont take the
> time to add docs about it.
> For example is solves an important issue such as Charles having here.
>  
> There is a JIRA ticket about the missing pieces I added a while back,
> when I encountered this the first time.
> Sorry I am not the main maintainer of camel-cxf so I would like ppl
> from the CXF side of things to help with the docs
> as they are the best candidates for that.
>  
>  
> >  
> > On Thu, Jan 10, 2013 at 10:45 AM, Claus Ibsen <claus.ibsen@gmail.com (mailto:claus.ibsen@gmail.com)> wrote:
> >  
> > > On Thu, Jan 10, 2013 at 10:37 AM, Charles Moulliard <ch007m@gmail.com (mailto:ch007m@gmail.com)>
> > > wrote:
> > > > I don't find info about this dataFormat (CXF_MESSAGE) in CXF. Does it
> > >  
> > >  
> > > exist
> > > > ?
> > >  
> > >  
> > >  
> > > Its in camel-cxf, and was recently added to it (eg within the last 6
> > > months or so I think)
> > >  
> > > >  
> > > > On Thu, Jan 10, 2013 at 8:43 AM, Willem jiang <willem.jiang@gmail.com (mailto:willem.jiang@gmail.com)
> > > > wrote:
> > > >  
> > > > > CXF_MESSAGE
> > > >  
> > > >  
> > > >  
> > > >  
> > > > --
> > > > Charles Moulliard
> > > > Apache Committer / Sr. Enterprise Architect (RedHat)
> > > > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> > >  
> > >  
> > >  
> > >  
> > >  
> > > --
> > > Claus Ibsen
> > > -----------------
> > > Red Hat, Inc.
> > > FuseSource is now part of Red Hat
> > > Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> > > Web: http://fusesource.com
> > > Twitter: davsclaus
> > > Blog: http://davsclaus.com
> > > Author of Camel in Action: http://www.manning.com/ibsen
> >  
> >  
> >  
> >  
> >  
> > --
> > Charles Moulliard
> > Apache Committer / Sr. Enterprise Architect (RedHat)
> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>  
>  
>  
>  
>  
> --  
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen




Re: Issue using camel-cxf and wss4j

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jan 10, 2013 at 10:53 AM, Charles Moulliard <ch...@gmail.com> wrote:
> That works now with this dataformat=CXF_MESSAGE when using Ws-Security &
> wss4j. Thx.
>

Ah great.

Would someone with love for CXF and Camel mind helping with adding
docs about these new data formats
added to camel-cxf?

I dislike when people add important new stuff, that they dont take the
time to add docs about it.
For example is solves an important issue such as Charles having here.

There is a JIRA ticket about the missing pieces I added a while back,
when I encountered this the first time.
Sorry I am not the main maintainer of camel-cxf so I would like ppl
from the CXF side of things to help with the docs
as they are the best candidates for that.


>
> On Thu, Jan 10, 2013 at 10:45 AM, Claus Ibsen <cl...@gmail.com> wrote:
>
>> On Thu, Jan 10, 2013 at 10:37 AM, Charles Moulliard <ch...@gmail.com>
>> wrote:
>> > I don't find info about this dataFormat (CXF_MESSAGE) in CXF. Does it
>> exist
>> > ?
>>
>> Its in camel-cxf, and was recently added to it (eg within the last 6
>> months or so I think)
>>
>> >
>> > On Thu, Jan 10, 2013 at 8:43 AM, Willem jiang <willem.jiang@gmail.com
>> >wrote:
>> >
>> >> CXF_MESSAGE
>> >
>> >
>> >
>> >
>> > --
>> > Charles Moulliard
>> > Apache Committer / Sr. Enterprise Architect (RedHat)
>> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> Red Hat, Inc.
>> FuseSource is now part of Red Hat
>> Email: cibsen@redhat.com
>> Web: http://fusesource.com
>> Twitter: davsclaus
>> Blog: http://davsclaus.com
>> Author of Camel in Action: http://www.manning.com/ibsen
>>
>
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Issue using camel-cxf and wss4j

Posted by Charles Moulliard <ch...@gmail.com>.
That works now with this dataformat=CXF_MESSAGE when using Ws-Security &
wss4j. Thx.


On Thu, Jan 10, 2013 at 10:45 AM, Claus Ibsen <cl...@gmail.com> wrote:

> On Thu, Jan 10, 2013 at 10:37 AM, Charles Moulliard <ch...@gmail.com>
> wrote:
> > I don't find info about this dataFormat (CXF_MESSAGE) in CXF. Does it
> exist
> > ?
>
> Its in camel-cxf, and was recently added to it (eg within the last 6
> months or so I think)
>
> >
> > On Thu, Jan 10, 2013 at 8:43 AM, Willem jiang <willem.jiang@gmail.com
> >wrote:
> >
> >> CXF_MESSAGE
> >
> >
> >
> >
> > --
> > Charles Moulliard
> > Apache Committer / Sr. Enterprise Architect (RedHat)
> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
>



-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Re: Issue using camel-cxf and wss4j

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jan 10, 2013 at 10:37 AM, Charles Moulliard <ch...@gmail.com> wrote:
> I don't find info about this dataFormat (CXF_MESSAGE) in CXF. Does it exist
> ?

Its in camel-cxf, and was recently added to it (eg within the last 6
months or so I think)

>
> On Thu, Jan 10, 2013 at 8:43 AM, Willem jiang <wi...@gmail.com>wrote:
>
>> CXF_MESSAGE
>
>
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Issue using camel-cxf and wss4j

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jan 10, 2013 at 4:58 PM, Daniel Kulp <dk...@apache.org> wrote:
>
> On Jan 10, 2013, at 4:37 AM, Charles Moulliard <ch...@gmail.com> wrote:
>> I don't find info about this dataFormat (CXF_MESSAGE) in CXF. Does it exist
>> ?
>
> Yes it exists, but I'm really not exactly happy about how it works.   I'd like to kind of "redo" it, but it would require a lot of internal CXF changes which I haven't had time to figure all out either.
>
> Basically:
>
> MESSAGE/RAW mode sucks from a  CXF standpoint as pretty much all the CXF processing is bypassed. (that's the problem you saw)   What's super confusing about it is that is also REMOVES things that the user may be relying on (like the SAAJ interceptors) that then can result in very strange error messages.  (again what you saw)   Really, I'm unsure why you wouldn't just use a pure HTTP component for most of this OTHER than for the WSDL generation, but even that is kind of doable if you have a static WSDL pre-generated.   In any case, my gut feeling is that a pure http component would perform slightly better.    For the most part, the advantage of this over the other two modes is performance though.   Keeps the raw byte streaming, very little processing.
>
> PAYLOAD does allow all of the proper CXF processing.  Using StAX, it can also do a lot of  "xml streaming", but XML streaming is much slower than byte streaming due to the parsing and such.   HOWEVER, PAYLOAD just gives the contents of the Body.  If you need to route the soap headers and attachments and such along as well, you need to do more work.
>
> I was hoping that CXF_MESSAGE could be somewhere in the middle where you could have CXF process everything correctly, but still be able to route on the full message.   HOWEVER, with the way CXF works internally, we have to build up a full SAAJ model in this case.  Thus, ALL of the streaming does not work in CXF_MESSAGE mode.   This is what I was hoping to somehow change, but would require a ton of work in CXF.   :-(    I'd like to be able to optimize this isn't something closer to how the PAYLOAD mode works with the XML streaming, but definitely requires a lot of work in CXF first.
>
> That said, when using WS-Security, we have to build the full SAAJ model anyway so the broken streaming wouldn't be an issue.
>

Thanks a lot Dan for all this detailed information.
This should come handy to update the docs. So we got some pieces of
this new stuff there.


>
> Dan
>
>
>
>> On Thu, Jan 10, 2013 at 8:43 AM, Willem jiang <wi...@gmail.com>wrote:
>>
>>> CXF_MESSAGE
>>
>>
>>
>>
>> --
>> Charles Moulliard
>> Apache Committer / Sr. Enterprise Architect (RedHat)
>> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Issue using camel-cxf and wss4j

Posted by Willem jiang <wi...@gmail.com>.
+1 for the refactoring of camel-cxf in Camel 3.0.
I think we could put the camel-cxf-transport into CXF, as it is mainly used for CXF.  
And the component just have the dependency of camel-core.

For the other cxf-x components we may do some clean up work at the same time.
--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem


Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Friday, January 11, 2013 at 6:02 PM, Claus Ibsen wrote:

> On Thu, Jan 10, 2013 at 4:58 PM, Daniel Kulp <dkulp@apache.org (mailto:dkulp@apache.org)> wrote:
> >  
> > On Jan 10, 2013, at 4:37 AM, Charles Moulliard <ch007m@gmail.com (mailto:ch007m@gmail.com)> wrote:
> > > I don't find info about this dataFormat (CXF_MESSAGE) in CXF. Does it exist
> > > ?
> >  
> >  
> >  
> > Yes it exists, but I'm really not exactly happy about how it works. I'd like to kind of "redo" it, but it would require a lot of internal CXF changes which I haven't had time to figure all out either.
>  
> I wonder if we should consider putting camel-cxf up for refactor or
> rewrite for Camel 3.0 ?
> In the past we have rewritten components, eg such as the file and ftp
> components. And the JMS got some bigger refactorings as well etc.
>  
> I am saying this as camel-cxf may have gotten a bit big, and there is
> maybe overlap with functionality in CXF itself, that is better handled
> by CXF than in camel-cxf.
>  
> Also I wonder if its possible to separate camel-cxf into WS and RS. So
> people doing either one, have a lighter component.
> And possible if some shared code is needed we can have a camel-cxf-core.
>  
> Most noticeable is the RS part where people who is looking for a
> simple RS may go for camel-restlet over camel-cxf.
> Though its not all just because of the code. But another point is the
> camel-cxf documents is a bit of "mess".
>  
> So maybe with a clean slate, we can both do new documents and new
> components that is lighter and easier to use,
> as well people can easier slice and dice so if they only do RS or WS.
>  
>  
> Any thoughts?
>  
>  
>  
>  
> > Basically:
> >  
> > MESSAGE/RAW mode sucks from a CXF standpoint as pretty much all the CXF processing is bypassed. (that's the problem you saw) What's super confusing about it is that is also REMOVES things that the user may be relying on (like the SAAJ interceptors) that then can result in very strange error messages. (again what you saw) Really, I'm unsure why you wouldn't just use a pure HTTP component for most of this OTHER than for the WSDL generation, but even that is kind of doable if you have a static WSDL pre-generated. In any case, my gut feeling is that a pure http component would perform slightly better. For the most part, the advantage of this over the other two modes is performance though. Keeps the raw byte streaming, very little processing.
> >  
> > PAYLOAD does allow all of the proper CXF processing. Using StAX, it can also do a lot of "xml streaming", but XML streaming is much slower than byte streaming due to the parsing and such. HOWEVER, PAYLOAD just gives the contents of the Body. If you need to route the soap headers and attachments and such along as well, you need to do more work.
> >  
> > I was hoping that CXF_MESSAGE could be somewhere in the middle where you could have CXF process everything correctly, but still be able to route on the full message. HOWEVER, with the way CXF works internally, we have to build up a full SAAJ model in this case. Thus, ALL of the streaming does not work in CXF_MESSAGE mode. This is what I was hoping to somehow change, but would require a ton of work in CXF. :-( I'd like to be able to optimize this isn't something closer to how the PAYLOAD mode works with the XML streaming, but definitely requires a lot of work in CXF first.
> >  
> > That said, when using WS-Security, we have to build the full SAAJ model anyway so the broken streaming wouldn't be an issue.
> >  
> >  
> > Dan
> >  
> >  
> >  
> > > On Thu, Jan 10, 2013 at 8:43 AM, Willem jiang <willem.jiang@gmail.com (mailto:willem.jiang@gmail.com)>wrote:
> > >  
> > > > CXF_MESSAGE
> > >  
> > >  
> > >  
> > >  
> > > --
> > > Charles Moulliard
> > > Apache Committer / Sr. Enterprise Architect (RedHat)
> > > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> >  
> >  
> >  
> > --
> > Daniel Kulp
> > dkulp@apache.org - http://dankulp.com/blog
> > Talend Community Coder - http://coders.talend.com
>  
>  
>  
>  
>  
> --  
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Email: cibsen@redhat.com (mailto:cibsen@redhat.com)
> Web: http://fusesource.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen




Re: Issue using camel-cxf and wss4j

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jan 10, 2013 at 4:58 PM, Daniel Kulp <dk...@apache.org> wrote:
>
> On Jan 10, 2013, at 4:37 AM, Charles Moulliard <ch...@gmail.com> wrote:
>> I don't find info about this dataFormat (CXF_MESSAGE) in CXF. Does it exist
>> ?
>
> Yes it exists, but I'm really not exactly happy about how it works.   I'd like to kind of "redo" it, but it would require a lot of internal CXF changes which I haven't had time to figure all out either.
>

I wonder if we should consider putting camel-cxf up for refactor or
rewrite for Camel 3.0 ?
In the past we have rewritten components, eg such as the file and ftp
components. And the JMS got some bigger refactorings as well etc.

I am saying this as camel-cxf may have gotten a bit big, and there is
maybe overlap with functionality in CXF itself, that is better handled
by CXF than in camel-cxf.

Also I wonder if its possible to separate camel-cxf into WS and RS. So
people doing either one, have a lighter component.
And possible if some shared code is needed we can have a camel-cxf-core.

Most noticeable is the RS part where people who is looking for a
simple RS may go for camel-restlet over camel-cxf.
Though its not all just because of the code. But another point is the
camel-cxf documents is a bit of "mess".

So maybe with a clean slate, we can both do new documents and new
components that is lighter and easier to use,
as well people can easier slice and dice so if they only do RS or WS.


Any thoughts?




> Basically:
>
> MESSAGE/RAW mode sucks from a  CXF standpoint as pretty much all the CXF processing is bypassed. (that's the problem you saw)   What's super confusing about it is that is also REMOVES things that the user may be relying on (like the SAAJ interceptors) that then can result in very strange error messages.  (again what you saw)   Really, I'm unsure why you wouldn't just use a pure HTTP component for most of this OTHER than for the WSDL generation, but even that is kind of doable if you have a static WSDL pre-generated.   In any case, my gut feeling is that a pure http component would perform slightly better.    For the most part, the advantage of this over the other two modes is performance though.   Keeps the raw byte streaming, very little processing.
>
> PAYLOAD does allow all of the proper CXF processing.  Using StAX, it can also do a lot of  "xml streaming", but XML streaming is much slower than byte streaming due to the parsing and such.   HOWEVER, PAYLOAD just gives the contents of the Body.  If you need to route the soap headers and attachments and such along as well, you need to do more work.
>
> I was hoping that CXF_MESSAGE could be somewhere in the middle where you could have CXF process everything correctly, but still be able to route on the full message.   HOWEVER, with the way CXF works internally, we have to build up a full SAAJ model in this case.  Thus, ALL of the streaming does not work in CXF_MESSAGE mode.   This is what I was hoping to somehow change, but would require a ton of work in CXF.   :-(    I'd like to be able to optimize this isn't something closer to how the PAYLOAD mode works with the XML streaming, but definitely requires a lot of work in CXF first.
>
> That said, when using WS-Security, we have to build the full SAAJ model anyway so the broken streaming wouldn't be an issue.
>
>
> Dan
>
>
>
>> On Thu, Jan 10, 2013 at 8:43 AM, Willem jiang <wi...@gmail.com>wrote:
>>
>>> CXF_MESSAGE
>>
>>
>>
>>
>> --
>> Charles Moulliard
>> Apache Committer / Sr. Enterprise Architect (RedHat)
>> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>
> --
> Daniel Kulp
> dkulp@apache.org - http://dankulp.com/blog
> Talend Community Coder - http://coders.talend.com
>



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Issue using camel-cxf and wss4j

Posted by Daniel Kulp <dk...@apache.org>.
On Jan 10, 2013, at 4:37 AM, Charles Moulliard <ch...@gmail.com> wrote:
> I don't find info about this dataFormat (CXF_MESSAGE) in CXF. Does it exist
> ?

Yes it exists, but I'm really not exactly happy about how it works.   I'd like to kind of "redo" it, but it would require a lot of internal CXF changes which I haven't had time to figure all out either.

Basically:

MESSAGE/RAW mode sucks from a  CXF standpoint as pretty much all the CXF processing is bypassed. (that's the problem you saw)   What's super confusing about it is that is also REMOVES things that the user may be relying on (like the SAAJ interceptors) that then can result in very strange error messages.  (again what you saw)   Really, I'm unsure why you wouldn't just use a pure HTTP component for most of this OTHER than for the WSDL generation, but even that is kind of doable if you have a static WSDL pre-generated.   In any case, my gut feeling is that a pure http component would perform slightly better.    For the most part, the advantage of this over the other two modes is performance though.   Keeps the raw byte streaming, very little processing.

PAYLOAD does allow all of the proper CXF processing.  Using StAX, it can also do a lot of  "xml streaming", but XML streaming is much slower than byte streaming due to the parsing and such.   HOWEVER, PAYLOAD just gives the contents of the Body.  If you need to route the soap headers and attachments and such along as well, you need to do more work.   

I was hoping that CXF_MESSAGE could be somewhere in the middle where you could have CXF process everything correctly, but still be able to route on the full message.   HOWEVER, with the way CXF works internally, we have to build up a full SAAJ model in this case.  Thus, ALL of the streaming does not work in CXF_MESSAGE mode.   This is what I was hoping to somehow change, but would require a ton of work in CXF.   :-(    I'd like to be able to optimize this isn't something closer to how the PAYLOAD mode works with the XML streaming, but definitely requires a lot of work in CXF first.

That said, when using WS-Security, we have to build the full SAAJ model anyway so the broken streaming wouldn't be an issue.    


Dan



> On Thu, Jan 10, 2013 at 8:43 AM, Willem jiang <wi...@gmail.com>wrote:
> 
>> CXF_MESSAGE
> 
> 
> 
> 
> -- 
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

-- 
Daniel Kulp
dkulp@apache.org - http://dankulp.com/blog
Talend Community Coder - http://coders.talend.com


Re: Issue using camel-cxf and wss4j

Posted by Charles Moulliard <ch...@gmail.com>.
I don't find info about this dataFormat (CXF_MESSAGE) in CXF. Does it exist
?

On Thu, Jan 10, 2013 at 8:43 AM, Willem jiang <wi...@gmail.com>wrote:

> CXF_MESSAGE




-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Re: Issue using camel-cxf and wss4j

Posted by Charles Moulliard <ch...@gmail.com>.
Different things should be done to improve what we have

Why : The warn message which is created by wss4j has nothing to do with the
existing problem ?

We get this message in the log when we use WS-SECURITTY and camel-cxf with
dataFormat=MESSAGE

qtp370155726-26 DEBUG [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
- WSS4JInInterceptor: enter handleMessage()
qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
- Security processing failed (actions mismatch)
qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
-
org.apache.ws.security.WSSecurityException: An error was discovered
processing the <wsse:Security> header
 at
org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)

This message means that action provided for the interceptor (and in fact
for Apache WSS4J) "UsernameToken Timestamp" in my case were not correct ...

This is ABSOLUTELY false and can be verified in debug mode where it appears
that the actions have been checked. In WSS4JInterceptor class , there is a
missing control because when it detects that this object is null
--> Element elem = WSSecurityUtil.getSecurityHeader(doc.getSOAPPart(),
actor) then no ERROR message is created. So it continues to process the
handle message till it reach this control generating the warning message
because wsResult is also empty

http://grepcode.com/file/repo1.maven.org/maven2/org.apache.cxf/cxf-rt-ws-security/2.2.9/org/apache/cxf/ws/security/wss4j/WSS4JInInterceptor.java#WSS4JInInterceptor.checkActions%28org.apache.cxf.binding.soap.SoapMessage%2Corg.apache.cxf.ws.security.wss4j.RequestData%2Cjava.util.Vector%2Cjava.util.Vector%29

I will raise a ticket regarding to what I describe here to improve CXF.









On Thu, Jan 10, 2013 at 8:43 AM, Willem jiang <wi...@gmail.com>wrote:

> In the MESSAGE data format, camel-cxf will not let the interceptor which
> can build the SOAP message from the input stream to be called.
> So the WSS4JInInterceptor will not work any more.
> I think that is why CXF_MESSAGE is introduced, I will dig the code to see
> if I see the whole picture of it.
>
>
> --
> Willem Jiang
>
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/)
> (English)
>           http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang
> Weibo: 姜宁willem
>
>
>
>
>
> On Thursday, January 10, 2013 at 7:00 AM, Charles Moulliard wrote:
>
> > Find the issue. When we setup camel-cxf endpoint using as
> > DataFormat=MESSAGE, SOAP securityHeaders are removed.
> >
> >
> > On Wed, Jan 9, 2013 at 5:30 PM, Charles Moulliard <ch007m@gmail.com(mailto:
> ch007m@gmail.com)> wrote:
> >
> > > Hi,
> > >
> > > When I try to authenticate an HTTP request using WS-Security with
> > > camel-cxf & wss4j interceptor, I get the following error :
> > >
> > > org.apache.camel.spring.Main.main() INFO
> > > [org.apache.camel.spring.SpringCamelContext] - Total 1 routes, of
> which 1
> > > is started.
> > > org.apache.camel.spring.Main.main() INFO
> > > [org.apache.camel.spring.SpringCamelContext] - Apache Camel 2.10.0
> > > (CamelContext: camel-1) started in 0.993 seconds
> > > qtp370155726-26 INFO
> > >
> [org.apache.cxf.services.CustomerServiceService.CustomerServicePort.CustomerService]
> > > - Inbound Message
> > > ----------------------------
> > > ID: 1
> > > Address: http://127.0.0.1:9090/training/WebService
> > > Encoding: UTF-8
> > > Http-Method: POST
> > > Content-Type: text/xml;charset=UTF-8
> > > Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
> > > Content-Length=[1590], content-type=[text/xml;charset=UTF-8], Host=[
> > > 127.0.0.1:9090], SOAPAction=["
> http://training.fusesource.com/saveCustomer"],
> > > User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
> > > Payload: <soapenv:Envelope xmlns:soapenv="
> > > http://schemas.xmlsoap.org/soap/envelope/" xmlns:tra="
> > > http://training.fusesource.com/">
> > > <soapenv:Header>
> > > <wsse:Security xmlns:wsse="
> > >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
> > > "
> > > soap:mustUnderstand="1">
> > > <wsse:UsernameToken xmlns:wsse="
> > >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
> "
> > > xmlns:wsu="
> > >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
> "
> > > wsu:Id="UsernameToken-1">
> > > <wsse:Username>charles</wsse:Username>
> > > <wsse:Password Type="
> > >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest
> > > ">TVzWGxNvhlixNVWol8poD9DHxl8=</wsse:Password>
> > > <wsse:Nonce EncodingType="
> > >
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary
> > > ">WsMNSm/C4dzdPS3OhUi94Q==</wsse:Nonce>
> > > <wsu:Created>2013-01-09T15:46:14.908Z</wsu:Created>
> > > </wsse:UsernameToken>
> > > </wsse:Security>
> > > </soapenv:Header>
> > > <soapenv:Body>
> > > <tra:saveCustomer>
> > > <customer>
> > > <!--Optional:-->
> > > <name>?</name>
> > > <!--Zero or more repetitions:-->
> > > <address>?</address>
> > > <numOrders>?</numOrders>
> > > <revenue>?</revenue>
> > > <!--Optional:-->
> > > <test>?</test>
> > > <!--Optional:-->
> > > <birthDate>?</birthDate>
> > > <!--Optional:-->
> > > <type>?</type>
> > > </customer>
> > > </tra:saveCustomer>
> > > </soapenv:Body>
> > > </soapenv:Envelope>
> > > --------------------------------------
> > > qtp370155726-26 DEBUG
> > > [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor] -
> WSS4JInInterceptor:
> > > enter handleMessage()
> > > qtp370155726-26 WARN
> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> > > - Security processing failed (actions mismatch)
> > > qtp370155726-26 WARN
> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> > > -
> > > org.apache.ws.security.WSSecurityException: An error was discovered
> > > processing the <wsse:Security> header
> > > at
> > >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
> > > at
> > >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
> > > at
> > >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
> > > at
> > >
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> > > at
> > >
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> > > at
> > >
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
> > > at
> > >
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
> > > at
> > >
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> > > at
> > >
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
> > > at
> > >
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
> > > at
> > >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> > > at
> > >
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> > > at
> > >
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
> > > at org.eclipse.jetty.server.Server.handle(Server.java:349)
> > > at
> > >
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
> > > at
> > >
> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
> > > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
> > > at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
> > > at
> > >
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
> > > at
> > >
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
> > > at
> > >
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
> > > at
> > >
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
> > > at
> > >
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
> > > at java.lang.Thread.run(Thread.java:722)
> > > qtp370155726-26 WARN [org.apache.cxf.phase.PhaseInterceptorChain] -
> > > Interceptor for {
> http://training.fusesource.com/}CustomerServiceServicehas thrown
> exception, unwinding now
> > > org.apache.cxf.binding.soap.SoapFault: An error was discovered
> processing
> > > the <wsse:Security> header
> > > at
> > >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:804)
> > > at
> > >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:357)
> > > at
> > >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
> > > at
> > >
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> > > at
> > >
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> > > at
> > >
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
> > > at
> > >
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
> > > at
> > >
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> > > at
> > >
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
> > > at
> > >
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
> > > at
> > >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> > > at
> > >
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> > > at
> > >
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
> > > at org.eclipse.jetty.server.Server.handle(Server.java:349)
> > > at
> > >
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
> > > at
> > >
> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
> > > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
> > > at
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
> > > at
> > >
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
> > > at
> > >
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
> > > at
> > >
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
> > > at
> > >
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
> > > at
> > >
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
> > > at java.lang.Thread.run(Thread.java:722)
> > > Caused by: org.apache.ws.security.WSSecurityException: An error was
> > > discovered processing the <wsse:Security> header
> > > at
> > >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
> > > at
> > >
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
> > > ... 22 more
> > >
> > > <cxf:cxfEndpoint id="WS"
> > > address="http://localhost:9090/training/WebService"
> > >
> > > serviceClass="com.fusesource.training.CustomerService">
> > > <cxf:outInterceptors>
> > > <ref bean="loggingOutInterceptor"/>
> > > </cxf:outInterceptors>
> > > <cxf:inInterceptors>
> > > <ref bean="loggingInInterceptor"/>
> > > <ref bean="wss4jInInterceptor"/>
> > > </cxf:inInterceptors>
> > > </cxf:cxfEndpoint>
> > >
> > > <bean id="loggingOutInterceptor"
> > > class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
> > > <bean id="loggingInInterceptor"
> > > class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
> > >
> > > <bean id="wss4jInInterceptor"
> > > class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
> > > <constructor-arg>
> > > <map>
> > > <entry key="action" value="UsernameToken"/>
> > > <entry key="passwordType" value="PasswordDigest"/>
> > > <entry key="passwordCallbackClass"
> > > value="com.fusesource.training.camel.UTPasswordCallback"/>
> > > </map>
> > > </constructor-arg>
> > > </bean>
> > >
> > > It seems that there is an action mismatch during processing of WSS4J.
> > > Does anybody knows how to solve this issue which is perhaps a CXF or
> > > WSS4J question?
> > >
> > > Regards,
> > >
> > > --
> > > Charles Moulliard
> > > Apache Committer / Sr. Enterprise Architect (RedHat)
> > > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
> >
> >
> >
> >
> > --
> > Charles Moulliard
> > Apache Committer / Sr. Enterprise Architect (RedHat)
> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>
>
>
>


-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com

Re: Issue using camel-cxf and wss4j

Posted by Willem jiang <wi...@gmail.com>.
In the MESSAGE data format, camel-cxf will not let the interceptor which can build the SOAP message from the input stream to be called.
So the WSS4JInInterceptor will not work any more.
I think that is why CXF_MESSAGE is introduced, I will dig the code to see if I see the whole picture of it.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Thursday, January 10, 2013 at 7:00 AM, Charles Moulliard wrote:

> Find the issue. When we setup camel-cxf endpoint using as
> DataFormat=MESSAGE, SOAP securityHeaders are removed.
>  
>  
> On Wed, Jan 9, 2013 at 5:30 PM, Charles Moulliard <ch007m@gmail.com (mailto:ch007m@gmail.com)> wrote:
>  
> > Hi,
> >  
> > When I try to authenticate an HTTP request using WS-Security with
> > camel-cxf & wss4j interceptor, I get the following error :
> >  
> > org.apache.camel.spring.Main.main() INFO
> > [org.apache.camel.spring.SpringCamelContext] - Total 1 routes, of which 1
> > is started.
> > org.apache.camel.spring.Main.main() INFO
> > [org.apache.camel.spring.SpringCamelContext] - Apache Camel 2.10.0
> > (CamelContext: camel-1) started in 0.993 seconds
> > qtp370155726-26 INFO
> > [org.apache.cxf.services.CustomerServiceService.CustomerServicePort.CustomerService]
> > - Inbound Message
> > ----------------------------
> > ID: 1
> > Address: http://127.0.0.1:9090/training/WebService
> > Encoding: UTF-8
> > Http-Method: POST
> > Content-Type: text/xml;charset=UTF-8
> > Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
> > Content-Length=[1590], content-type=[text/xml;charset=UTF-8], Host=[
> > 127.0.0.1:9090], SOAPAction=["http://training.fusesource.com/saveCustomer"],
> > User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
> > Payload: <soapenv:Envelope xmlns:soapenv="
> > http://schemas.xmlsoap.org/soap/envelope/" xmlns:tra="
> > http://training.fusesource.com/">
> > <soapenv:Header>
> > <wsse:Security xmlns:wsse="
> > http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
> > "
> > soap:mustUnderstand="1">
> > <wsse:UsernameToken xmlns:wsse="
> > http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
> > xmlns:wsu="
> > http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> > wsu:Id="UsernameToken-1">
> > <wsse:Username>charles</wsse:Username>
> > <wsse:Password Type="
> > http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest
> > ">TVzWGxNvhlixNVWol8poD9DHxl8=</wsse:Password>
> > <wsse:Nonce EncodingType="
> > http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary
> > ">WsMNSm/C4dzdPS3OhUi94Q==</wsse:Nonce>
> > <wsu:Created>2013-01-09T15:46:14.908Z</wsu:Created>
> > </wsse:UsernameToken>
> > </wsse:Security>
> > </soapenv:Header>
> > <soapenv:Body>
> > <tra:saveCustomer>
> > <customer>
> > <!--Optional:-->
> > <name>?</name>
> > <!--Zero or more repetitions:-->
> > <address>?</address>
> > <numOrders>?</numOrders>
> > <revenue>?</revenue>
> > <!--Optional:-->
> > <test>?</test>
> > <!--Optional:-->
> > <birthDate>?</birthDate>
> > <!--Optional:-->
> > <type>?</type>
> > </customer>
> > </tra:saveCustomer>
> > </soapenv:Body>
> > </soapenv:Envelope>
> > --------------------------------------
> > qtp370155726-26 DEBUG
> > [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor] - WSS4JInInterceptor:
> > enter handleMessage()
> > qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> > - Security processing failed (actions mismatch)
> > qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> > -
> > org.apache.ws.security.WSSecurityException: An error was discovered
> > processing the <wsse:Security> header
> > at
> > org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
> > at
> > org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
> > at
> > org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
> > at
> > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> > at
> > org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> > at
> > org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
> > at
> > org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
> > at
> > org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> > at
> > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
> > at
> > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
> > at
> > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> > at
> > org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> > at
> > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
> > at org.eclipse.jetty.server.Server.handle(Server.java:349)
> > at
> > org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
> > at
> > org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
> > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
> > at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
> > at
> > org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
> > at
> > org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
> > at
> > org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
> > at
> > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
> > at
> > org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
> > at java.lang.Thread.run(Thread.java:722)
> > qtp370155726-26 WARN [org.apache.cxf.phase.PhaseInterceptorChain] -
> > Interceptor for {http://training.fusesource.com/}CustomerServiceServicehas thrown exception, unwinding now
> > org.apache.cxf.binding.soap.SoapFault: An error was discovered processing
> > the <wsse:Security> header
> > at
> > org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:804)
> > at
> > org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:357)
> > at
> > org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
> > at
> > org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> > at
> > org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
> > at
> > org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
> > at
> > org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
> > at
> > org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> > at
> > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
> > at
> > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
> > at
> > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
> > at
> > org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> > at
> > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
> > at org.eclipse.jetty.server.Server.handle(Server.java:349)
> > at
> > org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
> > at
> > org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
> > at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
> > at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
> > at
> > org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
> > at
> > org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
> > at
> > org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
> > at
> > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
> > at
> > org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
> > at java.lang.Thread.run(Thread.java:722)
> > Caused by: org.apache.ws.security.WSSecurityException: An error was
> > discovered processing the <wsse:Security> header
> > at
> > org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
> > at
> > org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
> > ... 22 more
> >  
> > <cxf:cxfEndpoint id="WS"
> > address="http://localhost:9090/training/WebService"
> >  
> > serviceClass="com.fusesource.training.CustomerService">
> > <cxf:outInterceptors>
> > <ref bean="loggingOutInterceptor"/>
> > </cxf:outInterceptors>
> > <cxf:inInterceptors>
> > <ref bean="loggingInInterceptor"/>
> > <ref bean="wss4jInInterceptor"/>
> > </cxf:inInterceptors>
> > </cxf:cxfEndpoint>
> >  
> > <bean id="loggingOutInterceptor"
> > class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
> > <bean id="loggingInInterceptor"
> > class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
> >  
> > <bean id="wss4jInInterceptor"
> > class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
> > <constructor-arg>
> > <map>
> > <entry key="action" value="UsernameToken"/>
> > <entry key="passwordType" value="PasswordDigest"/>
> > <entry key="passwordCallbackClass"
> > value="com.fusesource.training.camel.UTPasswordCallback"/>
> > </map>
> > </constructor-arg>
> > </bean>
> >  
> > It seems that there is an action mismatch during processing of WSS4J.
> > Does anybody knows how to solve this issue which is perhaps a CXF or
> > WSS4J question?
> >  
> > Regards,
> >  
> > --
> > Charles Moulliard
> > Apache Committer / Sr. Enterprise Architect (RedHat)
> > Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>  
>  
>  
>  
> --  
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com




Re: Issue using camel-cxf and wss4j

Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Jan 10, 2013 at 12:00 AM, Charles Moulliard <ch...@gmail.com> wrote:
> Find the issue. When we setup camel-cxf endpoint using as
> DataFormat=MESSAGE, SOAP securityHeaders are removed.
>

I think there is a new CXF_MESSAGE or something. There was some new
formats added, but never documented.
I logged a ticket about the missing docs.

I think one of the new ones, support both headers + payload in a
streaming like mode.


>
> On Wed, Jan 9, 2013 at 5:30 PM, Charles Moulliard <ch...@gmail.com> wrote:
>
>> Hi,
>>
>> When I try to authenticate an HTTP request using WS-Security with
>> camel-cxf & wss4j interceptor, I get the following error :
>>
>> org.apache.camel.spring.Main.main() INFO
>> [org.apache.camel.spring.SpringCamelContext] - Total 1 routes, of which 1
>> is started.
>> org.apache.camel.spring.Main.main() INFO
>> [org.apache.camel.spring.SpringCamelContext] - Apache Camel 2.10.0
>> (CamelContext: camel-1) started in 0.993 seconds
>> qtp370155726-26 INFO
>> [org.apache.cxf.services.CustomerServiceService.CustomerServicePort.CustomerService]
>> - Inbound Message
>> ----------------------------
>> ID: 1
>> Address: http://127.0.0.1:9090/training/WebService
>> Encoding: UTF-8
>> Http-Method: POST
>> Content-Type: text/xml;charset=UTF-8
>> Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
>> Content-Length=[1590], content-type=[text/xml;charset=UTF-8], Host=[
>> 127.0.0.1:9090], SOAPAction=["http://training.fusesource.com/saveCustomer"],
>> User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
>> Payload: <soapenv:Envelope xmlns:soapenv="
>> http://schemas.xmlsoap.org/soap/envelope/" xmlns:tra="
>> http://training.fusesource.com/">
>>    <soapenv:Header>
>>           <wsse:Security xmlns:wsse="
>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
>> "
>>                soap:mustUnderstand="1">
>> <wsse:UsernameToken xmlns:wsse="
>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
>> xmlns:wsu="
>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
>> wsu:Id="UsernameToken-1">
>>  <wsse:Username>charles</wsse:Username>
>> <wsse:Password Type="
>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest
>> ">TVzWGxNvhlixNVWol8poD9DHxl8=</wsse:Password>
>>  <wsse:Nonce EncodingType="
>> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary
>> ">WsMNSm/C4dzdPS3OhUi94Q==</wsse:Nonce>
>>  <wsu:Created>2013-01-09T15:46:14.908Z</wsu:Created>
>> </wsse:UsernameToken>
>> </wsse:Security>
>>    </soapenv:Header>
>>    <soapenv:Body>
>>       <tra:saveCustomer>
>>          <customer>
>>             <!--Optional:-->
>>             <name>?</name>
>>             <!--Zero or more repetitions:-->
>>             <address>?</address>
>>             <numOrders>?</numOrders>
>>             <revenue>?</revenue>
>>             <!--Optional:-->
>>             <test>?</test>
>>             <!--Optional:-->
>>             <birthDate>?</birthDate>
>>             <!--Optional:-->
>>             <type>?</type>
>>          </customer>
>>       </tra:saveCustomer>
>>    </soapenv:Body>
>> </soapenv:Envelope>
>> --------------------------------------
>> qtp370155726-26 DEBUG
>> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor] - WSS4JInInterceptor:
>> enter handleMessage()
>> qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
>> - Security processing failed (actions mismatch)
>> qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
>> -
>> org.apache.ws.security.WSSecurityException: An error was discovered
>> processing the <wsse:Security> header
>> at
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
>>  at
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
>> at
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
>>  at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
>> at
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>>  at
>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
>> at
>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
>>  at
>> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
>> at
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
>>  at
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
>> at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
>>  at
>> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
>> at
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
>>  at org.eclipse.jetty.server.Server.handle(Server.java:349)
>> at
>> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
>>  at
>> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
>> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
>>  at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
>> at
>> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
>>  at
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
>> at
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
>>  at
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
>> at
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
>>  at java.lang.Thread.run(Thread.java:722)
>> qtp370155726-26 WARN [org.apache.cxf.phase.PhaseInterceptorChain] -
>> Interceptor for {http://training.fusesource.com/}CustomerServiceServicehas thrown exception, unwinding now
>> org.apache.cxf.binding.soap.SoapFault: An error was discovered processing
>> the <wsse:Security> header
>> at
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:804)
>>  at
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:357)
>> at
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
>>  at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
>> at
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>>  at
>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
>> at
>> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
>>  at
>> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
>> at
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
>>  at
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
>> at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
>>  at
>> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
>> at
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
>>  at org.eclipse.jetty.server.Server.handle(Server.java:349)
>> at
>> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
>>  at
>> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
>> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
>>  at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
>> at
>> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
>>  at
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
>> at
>> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
>>  at
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
>> at
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
>>  at java.lang.Thread.run(Thread.java:722)
>> Caused by: org.apache.ws.security.WSSecurityException: An error was
>> discovered processing the <wsse:Security> header
>>  at
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
>> at
>> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
>>  ... 22 more
>>
>>     <cxf:cxfEndpoint id="WS"
>>                      address="http://localhost:9090/training/WebService"
>>
>>  serviceClass="com.fusesource.training.CustomerService">
>>         <cxf:outInterceptors>
>>             <ref bean="loggingOutInterceptor"/>
>>         </cxf:outInterceptors>
>>         <cxf:inInterceptors>
>>             <ref bean="loggingInInterceptor"/>
>>             <ref bean="wss4jInInterceptor"/>
>>         </cxf:inInterceptors>
>>     </cxf:cxfEndpoint>
>>
>>     <bean id="loggingOutInterceptor"
>> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
>>     <bean id="loggingInInterceptor"
>> class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
>>
>>     <bean id="wss4jInInterceptor"
>> class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
>>         <constructor-arg>
>>             <map>
>>                 <entry key="action" value="UsernameToken"/>
>>                 <entry key="passwordType" value="PasswordDigest"/>
>>                 <entry key="passwordCallbackClass"
>> value="com.fusesource.training.camel.UTPasswordCallback"/>
>>             </map>
>>         </constructor-arg>
>>     </bean>
>>
>> It seems that there is an action mismatch during processing of WSS4J.
>> Does anybody knows how to solve this issue which is perhaps a CXF or
>> WSS4J question?
>>
>> Regards,
>>
>> --
>> Charles Moulliard
>> Apache Committer / Sr. Enterprise Architect (RedHat)
>> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>>
>>
>
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Issue using camel-cxf and wss4j

Posted by Charles Moulliard <ch...@gmail.com>.
Find the issue. When we setup camel-cxf endpoint using as
DataFormat=MESSAGE, SOAP securityHeaders are removed.


On Wed, Jan 9, 2013 at 5:30 PM, Charles Moulliard <ch...@gmail.com> wrote:

> Hi,
>
> When I try to authenticate an HTTP request using WS-Security with
> camel-cxf & wss4j interceptor, I get the following error :
>
> org.apache.camel.spring.Main.main() INFO
> [org.apache.camel.spring.SpringCamelContext] - Total 1 routes, of which 1
> is started.
> org.apache.camel.spring.Main.main() INFO
> [org.apache.camel.spring.SpringCamelContext] - Apache Camel 2.10.0
> (CamelContext: camel-1) started in 0.993 seconds
> qtp370155726-26 INFO
> [org.apache.cxf.services.CustomerServiceService.CustomerServicePort.CustomerService]
> - Inbound Message
> ----------------------------
> ID: 1
> Address: http://127.0.0.1:9090/training/WebService
> Encoding: UTF-8
> Http-Method: POST
> Content-Type: text/xml;charset=UTF-8
> Headers: {accept-encoding=[gzip,deflate], connection=[keep-alive],
> Content-Length=[1590], content-type=[text/xml;charset=UTF-8], Host=[
> 127.0.0.1:9090], SOAPAction=["http://training.fusesource.com/saveCustomer"],
> User-Agent=[Apache-HttpClient/4.1.1 (java 1.5)]}
> Payload: <soapenv:Envelope xmlns:soapenv="
> http://schemas.xmlsoap.org/soap/envelope/" xmlns:tra="
> http://training.fusesource.com/">
>    <soapenv:Header>
>           <wsse:Security xmlns:wsse="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
> "
>                soap:mustUnderstand="1">
> <wsse:UsernameToken xmlns:wsse="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
> xmlns:wsu="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
> wsu:Id="UsernameToken-1">
>  <wsse:Username>charles</wsse:Username>
> <wsse:Password Type="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest
> ">TVzWGxNvhlixNVWol8poD9DHxl8=</wsse:Password>
>  <wsse:Nonce EncodingType="
> http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary
> ">WsMNSm/C4dzdPS3OhUi94Q==</wsse:Nonce>
>  <wsu:Created>2013-01-09T15:46:14.908Z</wsu:Created>
> </wsse:UsernameToken>
> </wsse:Security>
>    </soapenv:Header>
>    <soapenv:Body>
>       <tra:saveCustomer>
>          <customer>
>             <!--Optional:-->
>             <name>?</name>
>             <!--Zero or more repetitions:-->
>             <address>?</address>
>             <numOrders>?</numOrders>
>             <revenue>?</revenue>
>             <!--Optional:-->
>             <test>?</test>
>             <!--Optional:-->
>             <birthDate>?</birthDate>
>             <!--Optional:-->
>             <type>?</type>
>          </customer>
>       </tra:saveCustomer>
>    </soapenv:Body>
> </soapenv:Envelope>
> --------------------------------------
> qtp370155726-26 DEBUG
> [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor] - WSS4JInInterceptor:
> enter handleMessage()
> qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> - Security processing failed (actions mismatch)
> qtp370155726-26 WARN [org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor]
> -
> org.apache.ws.security.WSSecurityException: An error was discovered
> processing the <wsse:Security> header
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
>  at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
>  at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>  at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
>  at
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
>  at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
>  at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
>  at org.eclipse.jetty.server.Server.handle(Server.java:349)
> at
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
>  at
> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
>  at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
> at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
>  at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
>  at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
>  at java.lang.Thread.run(Thread.java:722)
> qtp370155726-26 WARN [org.apache.cxf.phase.PhaseInterceptorChain] -
> Interceptor for {http://training.fusesource.com/}CustomerServiceServicehas thrown exception, unwinding now
> org.apache.cxf.binding.soap.SoapFault: An error was discovered processing
> the <wsse:Security> header
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.createSoapFault(WSS4JInInterceptor.java:804)
>  at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:357)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:97)
>  at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:262)
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>  at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:348)
> at
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:312)
>  at
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:72)
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:943)
>  at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:879)
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
>  at
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:110)
>  at org.eclipse.jetty.server.Server.handle(Server.java:349)
> at
> org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:441)
>  at
> org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:936)
> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:801)
>  at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:224)
> at
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:51)
>  at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:586)
> at
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:44)
>  at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:598)
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:533)
>  at java.lang.Thread.run(Thread.java:722)
> Caused by: org.apache.ws.security.WSSecurityException: An error was
> discovered processing the <wsse:Security> header
>  at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.checkActions(WSS4JInInterceptor.java:383)
> at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:333)
>  ... 22 more
>
>     <cxf:cxfEndpoint id="WS"
>                      address="http://localhost:9090/training/WebService"
>
>  serviceClass="com.fusesource.training.CustomerService">
>         <cxf:outInterceptors>
>             <ref bean="loggingOutInterceptor"/>
>         </cxf:outInterceptors>
>         <cxf:inInterceptors>
>             <ref bean="loggingInInterceptor"/>
>             <ref bean="wss4jInInterceptor"/>
>         </cxf:inInterceptors>
>     </cxf:cxfEndpoint>
>
>     <bean id="loggingOutInterceptor"
> class="org.apache.cxf.interceptor.LoggingOutInterceptor"/>
>     <bean id="loggingInInterceptor"
> class="org.apache.cxf.interceptor.LoggingInInterceptor"/>
>
>     <bean id="wss4jInInterceptor"
> class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
>         <constructor-arg>
>             <map>
>                 <entry key="action" value="UsernameToken"/>
>                 <entry key="passwordType" value="PasswordDigest"/>
>                 <entry key="passwordCallbackClass"
> value="com.fusesource.training.camel.UTPasswordCallback"/>
>             </map>
>         </constructor-arg>
>     </bean>
>
> It seems that there is an action mismatch during processing of WSS4J.
> Does anybody knows how to solve this issue which is perhaps a CXF or
> WSS4J question?
>
> Regards,
>
> --
> Charles Moulliard
> Apache Committer / Sr. Enterprise Architect (RedHat)
> Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com
>
>


-- 
Charles Moulliard
Apache Committer / Sr. Enterprise Architect (RedHat)
Twitter : @cmoulliard | Blog : http://cmoulliard.blogspot.com