我正在尝试使用 PHP 的本机 SOAP 库实现的另一个端点来复制传统的 NuSOAP 端点。我通过在每个端点中返回相同的虚拟数组并比较每个端点返回的 xml 进行测试。
以下是旧服务器给出的示例响应
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://localhost/webservices-soap/servicios">
<SOAP-ENV:Body>
<ns1:LeerAtributosResponse xmlns:ns1="http://localhost/webservices-soap/servicios">
<return xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="tns:ParamValue[2]">.
<item xsi:type="tns:ParamValue">
<parametro xsi:type="xsd:string">hola</parametro>
<valor xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[3]">
<item xsi:type="xsd:string">5</item>
<item xsi:type="xsd:string">6</item>
<item xsi:type="xsd:string">7</item>
</valor>
</item>
<item xsi:type="tns:ParamValue">
<parametro xsi:type="xsd:string">chau</parametro>
<valor xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="xsd:string[0]"/>
</item>
</return>
</ns1:LeerAtributosResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Run Code Online (Sandbox Code Playgroud)
这是新实现给出的响应:
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://localhost:8000/soap/servicios" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:LeerAtributosResponse>
<return SOAP-ENC:arrayType="ns1:ParamValue[2]" xsi:type="ns1:ArrayOfParamValue">
<item xsi:type="ns1:ParamValue">
<parametro xsi:type="xsd:string">hola</parametro>
<valor SOAP-ENC:arrayType="xsd:string[3]" xsi:type="ns1:ArrayOfString">
<item xsi:type="xsd:string">5</item>
<item xsi:type="xsd:string">6</item>
<item xsi:type="xsd:string">7</item>
</valor>
</item>
<item xsi:type="ns1:ParamValue">
<parametro …Run Code Online (Sandbox Code Playgroud)