我正在使用 Web 服务,其中 WSDL 描述了每个请求和响应中的单个字符串元素。
<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>
该字符串中嵌入了许多带有转义标签的普通 XML 元素。
<?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/">
<SERVICERequest>
<SERVICE_REQ>
<PARAM_1>
Value1
</PARAM_1>
<PARAM_2>
Value2
</PARAM_2>
<PARAM_3>
Value3
</PARAM_3>
</SERVICE_REQ>
</SERVICERequest>
</SERVICE>
</soap:Body>
</soap:Envelope>
这是来自服务的响应格式,也是传入请求的预期格式。
这在 SOAP 接口中很常见吗?实际上,它会导致我正在使用的 SOAP 库无法访问内部参数。(soap4r) 感谢 SOAP 资深人士的任何反馈。