camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: HOW TO convert SOAPMessage to POJO
Date Wed, 26 Mar 2014 21:09:35 GMT

You would need to capture the SOAP message (wireshark or use the logging interceptors) and
double check that the SOAP message matches what you have configured for the WSS4JInInterceptor.

Another suggestion is to subclass the WSS4JInInterceptor and override the method:

protected boolean checkReceiverResultsAnyOrder(
        List<WSSecurityEngineResult> wsResult, List<Integer> actions
    ) 

to print out information about the actions in the wsResult list there to see what was actually
processed compared to the actions that were configured.   Here’s the full code for the method
as it is now:


    protected boolean checkReceiverResultsAnyOrder(
        List<WSSecurityEngineResult> wsResult, List<Integer> actions
    ) {
        List<Integer> recordedActions = new ArrayList<Integer>(actions.size());
        for (Integer action : actions) {
            recordedActions.add(action);
        }
        
        for (WSSecurityEngineResult result : wsResult) {
            final Integer actInt = (Integer) result.get(WSSecurityEngineResult.TAG_ACTION);
            int act = actInt.intValue();
            if (act == WSConstants.SC || act == WSConstants.BST) {
                continue;
            }
            
            if (!recordedActions.remove(actInt)) {
                return false;
            }
        }

        if (!recordedActions.isEmpty()) {
            return false;
        }

        return true;
    }



Dan





On Mar 26, 2014, at 4:29 PM, chaij <jin.chai@indigoarc.com> wrote:

> Dan -  Your response has been very helpful and concrete enough for me to
> follow through. Really appreciate. I am relatively new to Camel.. has a lot
> to learn.
> 
> I am facing the following issues when use CXF Endpoint POJO mode with WSS4J
> interceptors for security related processing. 
> 
> Please see this post for more details.
> http://camel.465427.n5.nabble.com/Camel-CXF-Proxy-with-WS-Security-td5749223i20.html
> 
> 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:788)[162:org.apache.cxf.cxf-rt-ws-security:2.7.7]
>        at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:336)[162:org.apache.cxf.cxf-rt-ws-security:2.7.7]
>        at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:95)[162:org.apache.cxf.cxf-rt-ws-security:2.7.7]
>        at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)[122:org.apache.cxf.cxf-api:2.7.7]
>        at
> org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:817)[122:org.apache.cxf.cxf-api:2.7.7]
>        at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1606)[130:org.apache.cxf.cxf-rt-transports-http:2.7.7]
>        at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1128)[130:org.apache.cxf.cxf-rt-transports-http:2.7.7]
>        at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:428)[122:org.apache.cxf.cxf-api:2.7.7]
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)[:1.6.0_29]
>        at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)[:1.6.0_29]
>        at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:353)[122:org.apache.cxf.cxf-api:2.7.7]
>        at java.lang.Thread.run(Thread.java:662)[:1.6.0_29]
> 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:363)[162:org.apache.cxf.cxf-rt-ws-security:2.7.7]
>        at
> org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage(WSS4JInInterceptor.java:319)[162:org.apache.cxf.cxf-rt-ws-security:2.7.7]
>        ... 10 more 
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/HOW-TO-convert-SOAPMessage-to-POJO-tp5749392p5749400.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

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


Mime
View raw message