Search code examples
wso2wso2-api-manager

WSO2 Gateway change payload attribute order in SOAP API


I have exposed a SOAP Service as a REST API in WSO2 API Manager 4.1.0 ,but when i tried to call this API it return a Backend erreur and after a troubleshooting i find that the WSO2 Gateway change the attribute order of my payload which cause an error .

This is what i send to API Gateway:

{
  "ExchangeRates": {
    "ExchangeRatesRequest": {
      "MessageHeader": {
        "InitialRequestId": "42",
        "RequestId": "42",
        "RequestChannel": "US",
        "RequestTime": "42"
      },
      "MessageBody": {
        "IsShowAll": true
      }
    }
  }
}

This is what the API Gateway send to Backend:

<?xml version='1.0' encoding='UTF-8'?> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <web:ExchangeRates xmlns:web="http://services.test.com/">
            <ExchangeRatesRequest>
                <MessageHeader>
                    <RequestId>42</RequestId>
                    <InitialRequestId>42</InitialRequestId>
                    <RequestChannel>US</RequestChannel>
                    <RequestTime>42</RequestTime>
                </MessageHeader>
                <MessageBody>
                    <IsShowAll>true</IsShowAll>
                </MessageBody>
            </ExchangeRatesRequest>
        </web:ExchangeRates>
    </soapenv:Body> </soapenv:Envelope>

As you remarque here the gateway have changed the order of "RequestId" and "InitialRequestId" . How to force the Gateway to maintain the same order of attributes.


Solution

  • This is a known issue in API Manager and we have fixed this for APIM 4.0.0 via an update and fixed for the latest release in 4.2.0