Walt Jones
Walt Jones

Reputation: 1328

Is this a standard or common encoding for a SOAP request?

I'm using a web service where the WSDL describes a single string element in each request and response.

<s:element name="SERVICE">
  <s:complexType>
    <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="SERVICERequest" type="s:string" />
    </s:sequence>
  </s:complexType>
</s:element>

Embedded in that string are a number of plain XML elements that have escaped tags.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope 
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
      <SERVICE xmlns="https://services.transcard.com/">
        &lt;SERVICERequest&gt;
          &lt;SERVICE_REQ&gt;
            &lt;PARAM_1&gt;
              Value1
            &lt;/PARAM_1&gt;
            &lt;PARAM_2&gt;
              Value2
            &lt;/PARAM_2&gt;
            &lt;PARAM_3&gt;
              Value3
            &lt;/PARAM_3&gt;
          &lt;/SERVICE_REQ&gt;
        &lt;/SERVICERequest&gt;
      </SERVICE>
    </soap:Body>
</soap:Envelope>

This is the format of responses from the service, and is the format expected for incoming requests.

Is this common in SOAP interfaces? In practice, it causes the inner parameters to be inaccessible to the SOAP library I'm using. (soap4r) Any feedback from SOAP veterans is appreciated.

Upvotes: 1

Views: 352

Answers (1)

Justin Niessner
Justin Niessner

Reputation: 245489

No. That's not common.

That completely disregards using an actual schema (which defines the data type being returend) and replaces it with a giant string that you're going to have to parse once you get the response.

...Terrible.

Upvotes: 3

Related Questions