cxf-spring-boot-starter icon indicating copy to clipboard operation
cxf-spring-boot-starter copied to clipboard

SoapRawClient fails with MTOM

Open jgoldhammer opened this issue 5 years ago • 1 comments

When the CXF server enables MTOM, the SoapRawClient will fail to parse the xml.

@WebService
@MTOM(threshold = 2 * 1024 * 1024)
public class XXXEndpoint implements XXXServicePortType {

Reason: CXF always sends multipart http request. That means that the xml parser will fail.

Outbound Message:

--uuid:052ebfc6-8d20-4545-8d26-93fa4573631c
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <[email protected]>

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>Message part {http://www.codecentric.de/namespace/weatherservice/general}GetCityForecastByZIP was not recognized.  (Does it exist in service WSDL?)</faultstring></soap:Fault></soap:Body></soap:Envelope>
--uuid:052ebfc6-8d20-4545-8d26-93fa4573631c--

Any idea what to do here? We could parse the message, but maybe you have experience how to it?

jgoldhammer avatar May 22 '19 06:05 jgoldhammer

The SoapRawClient is based on Apache's httpclient from the httpcomponents project: https://hc.apache.org/ It should be able to handle MTOM also, but I don't really have a example scenario for testing - could you provide an example WSDL/Request/Response so we could build a test case for that?

There's already a example WSDL used inside this starter for testing (https://github.com/codecentric/cxf-spring-boot-starter/tree/master/src/test/resources/wsdl) - including multiple XSD-imports like https://www.bipro.net/ is using it too. It would be really great to enhance the test suite - then we could implement a solution for sure.

jonashackt avatar May 24 '19 12:05 jonashackt