camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Willem Jiang (JIRA)" <>
Subject [jira] [Commented] (CAMEL-8181) Default SOAPMessage to String Converter does not handle Multiparts as expected
Date Fri, 26 Dec 2014 02:23:13 GMT


Willem Jiang commented on CAMEL-8181:

I don't we need to change the default behaviour of the CxfConverter.soapMessageToString().
If you just want to get the soap part message, you can just set the message body with  message.getSOAPPart(),
and Camel convert can do the reset of work for you.
What if the use wants to write the whole soap message into a log file? 

> Default SOAPMessage to String Converter does not handle Multiparts as expected
> ------------------------------------------------------------------------------
>                 Key: CAMEL-8181
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.14.1
>            Reporter: David Atkins
>            Assignee: Willem Jiang
>            Priority: Minor
> The default SOAPMessage to String converter in org.apache.camel.component.cxf.converter.CxfConverter
uses the SoapMessage#writeTo method to convert it to a String. But when receiving a multipart
(e.g. when using MTOM) this provides all of the message parts, instead of just the message
body as expected, resulting in something like the following appearing on the Exchange Body:
> {code}
> ------=_Part_0_715152323.1390739632718
> Content-Type: text/xml; charset=utf-8
> <soapenv:Envelope xmlns:soapenv="" xmlns:rep="">
>    <soapenv:Header>
>    </soapenv:Header>
>    <soapenv:Body>
>       <rep:inputReportIncident>
>          <incidentId>?</incidentId>
>          <incidentDate>?</incidentDate>
>          <givenName>?</givenName>
>          <familyName>?</familyName>
>          <summary>?</summary>
>          <details>?</details>
>          <email>?</email>
>          <phone>?</phone>
>       </rep:inputReportIncident>
>    </soapenv:Body>
>    </soapenv:Envelope>
> ------=_Part_0_715152323.1390739632718
> Content-Type: application/octet-stream; name=error.log
> Content-Disposition: attachment; name="error.log"; filename="error.log"
> Content-Transfer-Encoding: binary
> Content-ID: <error.log>
> file content here
> {code}
> I can't think of a useful use case for having the message in this format, especially
as the attachments are correctly added to the Exchange's Attachment Map
> I believe the converter should only convert the initial Part to a String, rather than
the whole message. Something like this:
> {code}
> return XMLUtils.toString(new DOMSource(message.getSOAPPart()));
> {code}
> I'll try and find some time to create a patch next week
> Note that this is documented in the following Redhat support case :
from a customer support issue I raised a while back

This message was sent by Atlassian JIRA

View raw message