[ 
https://issues.apache.org/activemq/browse/CAMEL-2614?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58675#action_58675
 ] 

William Tam commented on CAMEL-2614:
------------------------------------

@clause

The commented line should have been removed.   I'll clean it up.  (Thanks for 
pointing it out).   The retrieving of "boi" have been performed in the previous 
lines.   The idea is to make sure the "boi" is remained as wrapped in PAYLOAD 
mode, so that CXF will not put a wrapper element again when it marshals the 
request.  I'll add some comment in the code, too.


{code}
                 // create a Camel exchange
                 org.apache.camel.Exchange camelExchange = 
endpoint.createExchange();
+                DataFormat dataFormat = endpoint.getDataFormat();
+
+                BindingOperationInfo boi = 
cxfExchange.getBindingOperationInfo();
+                if (dataFormat == DataFormat.PAYLOAD && boi.isUnwrapped()) {
+                    boi = boi.getWrappedOperation();
+                    cxfExchange.put(BindingOperationInfo.class, boi);
+                }
                 
-                BindingOperationInfo boi = 
cxfExchange.get(BindingOperationInfo.class);
+                //BindingOperationInfo boi = 
cxfExchange.get(BindingOperationInfo.class);
                 if (boi != null) {
                     
camelExchange.setProperty(BindingOperationInfo.class.getName(), boi);
                     if (LOG.isTraceEnabled()) {
{code}


> Camel-cxf can't handle multi part message in PAYLOAD mode
> ---------------------------------------------------------
>
>                 Key: CAMEL-2614
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2614
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>            Reporter: William Tam
>            Assignee: William Tam
>             Fix For: 2.3.0
>
>         Attachments: CAMEL-2614.patch
>
>
> If I have a multi part (bare) message defined in WSDL (such as follow), 
> camel-cxf component cannot parse the incoming message in PAYLOAD mode.
> {code}
>       <wsdl:message name="MultiPartStringIntRequest">
>               <wsdl:part name="StringDefaultInput" 
> element="MultiPartStringInt:StringDefaultInputElem" />
>               <wsdl:part name="IntParamIn" 
> element="MultiPartStringInt:IntParamInElem" />
>       </wsdl:message>
> {code}
> I get a stack trace similar to this.
> Mar 12, 2010 7:15:48 PM 
> org.apache.camel.component.cxf.interceptors.AbstractMessageInInterceptor 
> createDOMMessage
> INFO: AbstractMessageInInterceptor Converting Stax Stream to DOM
> Mar 12, 2010 7:15:48 PM 
> org.apache.camel.component.cxf.interceptors.AbstractMessageInInterceptor 
> handleMessage
> INFO: AbstractRoutingMessageInInterceptor Infer BindingOperationInfo.
> Mar 12, 2010 7:15:48 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> WARNING: Interceptor has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Could not read request. Operation 
> {urn:MultiPart/resources/wsdl/MultiPartStringInt/MultiPartStringInt/types}StringDefaultInputElem
>  is unknown.
>                 at 
> org.apache.camel.component.cxf.interceptors.AbstractMessageInInterceptor.handleMessage(AbstractMessageInInterceptor.java:103)
>                 at 
> org.apache.camel.component.cxf.interceptors.DOMInInterceptor.handleMessage(DOMInInterceptor.java:43)
>                 at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
>                 at 
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
>                 at 
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:312)
>                 at 
> org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
>                 at 
> org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
>                 at 
> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
>                 at 
> org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
>                 at 
> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
>                 at org.mortbay.jetty.Server.handle(Server.java:326)
>                 at 
> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:536)
>                 at 
> org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:930)
>                 at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:747)
>                 at 
> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
>                 at 
> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:405)
>                 at 
> org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
>                 at 
> org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to