I need to send MTOM encoded request from WSO2 ESB proxy service. I'm setting parameters:
<property name="enableMTOM" value="true" scope="axis2" type="STRING"/>
<property name="messageType" value="multipart/related" scope="axis2" type="STRING"/>
and it works fine.
Headers of the request:
POST /alfresco/cmisws/DiscoveryService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: multipart/related; boundary="MIMEBoundary_a62df4c2a350faee72d4e9faf54c07e7135aa06bcf30bf02"; type="application/xop+xml"; start="<0.b62df4c2a350faee72d4e9faf54c07e7135aa06bcf30bf02@apache.org>"; start-info="text/xml"
SOAPAction: "urn:mediate"
Transfer-Encoding: chunked
Host: 127.0.0.1:8181
Connection: Keep-Alive
User-Agent: Synapse-PT-HttpComponents-NIO
67b
--MIMEBoundary_a62df4c2a350faee72d4e9faf54c07e7135aa06bcf30bf02
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.b62df4c2a350faee72d4e9faf54c07e7135aa06bcf30bf02@apache.org>
But I need to call my proxy service as HTTP GET. So when I need to send MTOM encoded request from proxy service, I'm setting additional attribute format="soap11" in the endpoint definition. And message is no longer MTOM encoded - Content-Type is text/xml.
POST /alfresco/cmisws/DiscoveryService HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml
Transfer-Encoding: chunked
Host: 127.0.0.1:8181
Connection: Keep-Alive
User-Agent: Synapse-PT-HttpComponents-NIO
678
--MIMEBoundary_c62df4c2a350faee60d6513af54c07e7035aa06bcf30bf02
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <0.d62df4c2a350faee60d6513af54c07e7035aa06bcf30bf02@apache.org>
Without format="soap11" attribute I'am getting error
SequenceMediator Error while building message
org.apache.axiom.om.OMException: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,530]
Message: The element type "body" must be terminated by the matching end-tag "</body>".
at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
Sequence deffinition:
<sequence xmlns="http://ws.apache.org/ns/synapse" name="GetDocIdFromAlfresco">
<property name="enableMTOM" value="true" scope="axis2" type="STRING"/>
<property name="messageType" value="multipart/related" scope="axis2" type="STRING"/>
<payloadFactory media-type="xml">
.
.
.
</payloadFactory>
<call>
<endpoint>
<address uri="http://localhost:8080/alfresco/cmisws/DiscoveryService" format="soap11"/>
</endpoint>
</call>
<respond/>
</sequence>
How can I send MTOM encoded request from proxy service called as HTTP GET?