[
https://issues.apache.org/jira/browse/CAMEL-7471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14011117#comment-14011117
]
Joe Luo commented on CAMEL-7471:
--------------------------------
Here I attached a new CXF mtom junit test CxfMtomConsumerCxfMessageModeTest
here to demonstrate the problem. Here is the code snippet:
{code}
public void configure() {
from(MTOM_ENDPOINT_URI).process(new Processor() {
@SuppressWarnings("unchecked")
public void process(final Exchange exchange) throws
Exception {
Message in = exchange.getIn();
assertEquals("We should not get any attachements
here.", 2, in.getAttachments().size());
assertEquals("Get a wrong Content-Type header",
"application/xop+xml", in.getHeader("Content-Type"));
exchange.getOut().setBody("OK");
}
});
}
{code}
You can see this assertion:
{code}
assertEquals("We should not get any attachements here.", 2,
in.getAttachments().size());
{code}
It has to be 2 here in order to make the junit test case to pass. Which means
that it had 2 attachments in Camel as well as 2 attachments in the Soap message.
> SOAP with attachments not mapped correctly from CXF to Camel for CXF_MESSAGE
> ----------------------------------------------------------------------------
>
> Key: CAMEL-7471
> URL: https://issues.apache.org/jira/browse/CAMEL-7471
> Project: Camel
> Issue Type: Bug
> Components: camel-cxf
> Affects Versions: 2.10.4
> Reporter: Joe Luo
> Attachments: junit_test.diff
>
>
> SOAP with attachments messages are not mapped correctly from CXF to Camel and
> back if using CXF_MESSAGE message format.
> We are having following simple camel route:
> {code}
> <route>
> <from uri="cxf:bean:Endpoint1" />
> <to uri="cxf:bean:Endpoint2" />
> </route>
> {code}
> So mapping between CXF Endpoint 1 and Camel creates attachments in Camel
> exchange and sets the Camel IN message as a soap message. However, it's
> missing a bit of removing the attachments from the message as they are
> already added to the Camel Exchange.
> Mapping from Camel and CXF Endpoint 2 maps Camel IN message (Soap with
> attachments) to CXF and then adds the attachments from Camel exchange which
> results in a messed up soap message that appears to contain twice as many
> attachments and it has messed up MIME boundaries as well as some of them are
> from the input message and some of them are generated during the last mapping.
> As a workaround we have added a Camel processor that clears the attachments
> from the IN Message in Camel .
--
This message was sent by Atlassian JIRA
(v6.2#6252)