我正在针对两个不同的 Magento Community 1.6.2 安装调用“catalogProductAttributeSetList”,它们以不同的格式返回结果。
服务器 1
WSDL:www.indo-pac.biz/api/v2_soap?wsdl=1 PHPINFO:www.indo-pac.biz/info.php
回应:
<pre><code><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento" 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:catalogProductAttributeSetListResponse>
<result SOAP-ENC:arrayType="ns1:catalogProductAttributeSetEntity[2]" xsi:type="ns1:catalogProductAttributeSetEntityArray">
<item xsi:type="ns1:catalogProductAttributeSetEntity">
<set_id xsi:type="xsd:int">9</set_id>
<name xsi:type="xsd:string">Cameras</name>
</item>
<item xsi:type="ns1:catalogProductAttributeSetEntity">
<set_id xsi:type="xsd:int">4</set_id>
<name xsi:type="xsd:string">Default</name>
</item>
</result>
</ns1:catalogProductAttributeSetListResponse>
</code></pre>
<p>
</p>
** 服务器 2**
WSDL:http://magento.a-dot.co.uk/api/v2_soap?wsdl=1 php信息:http://s33667.gridserver.com/gs-bin/phpinfo.php-stable
<p>Response: </p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP- ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<ns1:catalogProductAttributeSetListResponse>
<result SOAP-ENC:arrayType="ns2:Map[2]" xsi:type="ns1:catalogProductAttributeSetEntityArray">
<item xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:string">set_id</key>
<value xsi:type="xsd:string">4</value>
</item>
<item>
<key xsi:type="xsd:string">name</key>
<value xsi:type="xsd:string">Default</value>
</item>
</item>
<item xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:string">set_id</key>
<value xsi:type="xsd:string">9</value>
</item>
<item>
<key xsi:type="xsd:string">name</key>
<value xsi:type="xsd:string">Ladies Shoes</value>
</item>
</item>
</result>
</ns1:catalogProductAttributeSetListResponse>
</code></pre>
<p>
</p>
谁能解释一下为什么结果不同?要求完全一样。我正在使用soapUI 4.0.1来验证发送的响应(我也使用Java见证了它)
我怀疑服务器上的 SOAP 库不匹配,但如何验证这一点?
谢谢
最佳答案
Magento 的 v2 SOAP API 有两种不同的模式。我的猜测是一台服务器处于“WS-I”模式,而另一台服务器则不是。让相关商店的管理员检查设置:
System -> Configuration -> Services -> Magento Core API -> WS-I Compliance
关于php - Magento 社区 1.6.2 服务器的不同响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9773885/