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">
    <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.

4

1 に答える 1

3

いいえ、それは一般的ではありません。

実際のスキーマ(返されるデータ型を定義する)の使用を完全に無視し、応答を取得したら解析する必要がある巨大な文字列に置き換えます。

...ひどい。

于 2009-10-31T00:08:19.950 に答える