<p>好吧,我不得不拒绝(并学习)我的PHP,但我有答案,如果有任何其他可怜的sap出现,并想使用sud(或一般python)与Magento。</p>
<p>此xml:</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:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body><ns1:call><sessionId xsi:type="xsd:string">bc11488aaae84c841ac237ea7f24ef</sessionId>
<resourcePath xsi:type="xsd:string">sales_order.list</resourcePath>
<args SOAP-ENC:arrayType="ns2:Map[1]" xsi:type="SOAP-ENC:Array">
<item xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:string">order_id</key>
<value xsi:type="ns2:Map">
<item>
<key xsi:type="xsd:string">from</key>
<value xsi:type="xsd:string">11</value>
</item>
<item>
<key xsi:type="xsd:string">to</key>
<value xsi:type="xsd:string">12</value>
</item>
</value>
</item>
</item>
</args>
</ns1:call>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</code></pre>
<p>由以下php创建:</p>
<pre><code>#! /usr/bin/php5
<?php
$client = new SoapClient('http://ip.ip.ip.ip/magento/index.php/api/?wsdl', array('trace'=>TRUE));
$session = $client->login('username', 'password');
$params = array(array(
'order_id' =>
array(
'from' => '10',
'to' => '12')));
$result = $client->call($session, 'sales_order.list', $params);
$resultXML = $client->__getLastRequest();
print($resultXML);
?>
</code></pre>
<p>当然,在Magento的协议的特定实现方面,也有一些与SOAP相关的编码问题——看起来它是设计用来与phpsoap客户机一起工作的,但实际上不是与其他任何东西一起工作的。但这个XML转储确实让我可以四处闲逛,把SUDS连接从地上取下来——如果你有兴趣的话,给我发个消息。哦,还有给“阿兰斯托姆”的帽子。</p>