Webservice request - alphatic order

0
I an consuming a webservice from a third party.  That webservice has a non documented "feature" that demands that the request should be in alphabetic order. For example: This one is ok! <OpportunityManagement>                   <AmountRequested>275000</AmountRequested>                   <Description>VCE Test - SOAPUI CALL</Description>                   <EstCloseDate>2017-03-30T23:59:00</EstCloseDate> <OpportunityManagement> This one is wrong - i don't get a SOAP error... but the data from the description is empty in the other system <OpportunityManagement> <AmountRequested>275000</AmountRequested>   <EstCloseDate>2017-03-30T23:59:00</EstCloseDate>                  <Description>VCE Test - SOAPUI CALL</Description>             <OpportunityManagement>   I'm still debating to get a fix in the other system but i cannot wait any longer. Currently i'm using the default export mapping to create a request - because the request has a complex structure with several list. Is there a simple fix in mendix where i can garantue that the request will be in alphabetic order?
asked
1 answers
1

If the party that publishes the service needs the element in the request to be in a specific order that should be reflected in the wsdl. Based on your question I don't think that they have a fixed sequence in their wsdl or that the sequence is specified incorrect.

In the wsdl you should see the definition of these elements. It should be specified similar to below, the xs:sequence tells the platform to follow the specified fixed order. And will export all elements in sequence as they are specified.


<xs:element name="OpportunityManagement">
  <xs:complexType>
    <xs:sequence>
      <xs:element name="AmountRequested" type="xs:string"/>
      <xs:element name="Description" type="xs:string"/>
      <xs:element name="EstCloseDate" type="xs:string"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>  <AmountRequested>275000</>

 

Since the platform literally follows the wsdl spec I would recommend downloading the wsdl and changing this to the correct sequence. If you want a more detailed suggestion, you could try adding the wsdl to your question.

answered