cxf-spring-boot-starter
cxf-spring-boot-starter copied to clipboard
SoapRawClient fails with MTOM
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?
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.