0

We are using wso2 api manager (2.1.0) to manage our SOAP apis. The reponse message of a our web service has content type "application/dime". We change axis2.xml to use binary-relay (builder and formatter) with that content type.

<messageFormatter contentType="application/dime"                          
   class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>

<messageBuilder contentType="application/dime"
   class="org.wso2.carbon.relay.BinaryRelayBuilder"/>

The response SOAP message is not expanded, so we have a return envelope like this

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
    <ns:binary xmlns:ns="http://ws.apache.org/commons/ns/payload">DCAAAAApACkAAAJxdXVpZDo3MTRDNk...U9GCgA=</ns:binary>
</soapenv:Body>
</soapenv:Envelope> 

We saw the same behaviour with wso2 enterprise integrator (6.1.1).

Is there any configuration that we have to do to enable expanding of response SOAP message in api manager or enterprise integrator? Would we do something else?

Community
  • 1
  • 1

2 Answers2

0

maybe the Content-Type in the API Manager is not preserved, look at this: WSO2 api manager not propagating content type header for multipart form data you can set the property http.headers.preserve to preserve Content-Type.

0

The APIM is working as expected in this scenario. You have set the binary formatters for your content type. So APIM,ESB treat your payload as a binary content and pass the same binary content inside a soap envelop.

You need to define the correct formatter and builder for your content type "application/dime". Refer [1] on how Message Builders and Formatters work. Identify the correct formatter and builder for your type.

[1] - https://docs.wso2.com/display/ESB500/Working+with+Message+Builders+and+Formatters

vinod
  • 151
  • 7
  • I tried the same configuration with WSO2 ESB 5.0.0.0 and everything works perfectly. The SOAP envelope has been expanded from the binary field. It seems that the behavior has changed between ESB 5.0.0 and EI 6.1.1 (and APIM 2.1.0), as I said with the most recent products the SOAP envelope is not expanded and the binary field, containing the SOAP envelope converted into binary, is returned. – Mario Giammona Nov 10 '17 at 08:45
  • I tried the same configuration with WSO2 API Manager 2.0.0 and it works. It seems that the problem is limited with the last version of API manager and Enterprise Integrator. – Mario Giammona Nov 10 '17 at 10:54