views:

34

answers:

1

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"&gt;
    <soap:Body>
      <SERVICE xmlns="https://services.transcard.com/"&gt;
        &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.

+3  A: 

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.

Justin Niessner