以下に更新
Magento SOAP v1 APIが次のように何かを行うための適切なXMLの例を持っている人はいますか?
client.call(session_token,'sales_order.list', {'filters':{'order_id':{'eq':12}}})
これは、私には機能しないpythonsuds呼び出しの例です。実際、sales_order.list、catalog_product.list、またはcustomer.listをフィルタリングするXMLの例ならどれでもかまいません。私はすでにXMLRPCバージョンで動作していますが、PythonのSUDSとSOAP v1 APIを使用すると、フィルターに関係なく、リスト全体が応答としてフィルター処理されなくなります。XMLは現在次のようになっています。
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns4="urn:Magento" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header/>
<ns1:Body>
<ns4:call>
<sessionId xsi:type="ns2:string">6634e1bd1004557677222fd81e809884</sessionId>
<resourcePath xsi:type="ns2:string">sales_order.list</resourcePath>
<args xsi:type="ns0:args">
<filters xsi:type="ns2:filters">
<order_id xsi:type="ns2:order_id">
<eq xsi:type="ns2:string">7</eq>
</order_id>
</filters>
</args>
</ns4:call>
</ns1:Body>
もちろん、私はすでに上記の他の何百万ものバリエーションを試しました。呼び出しが正しくてスキーマが悪いのか、それとも石鹸サーバーが不安定なのか、それとも何なのか、疑問に思っています。したがって、誰かがエミュレートしようとする証明された正しいXMLを持っている場合、それは大いに役立ちます。
ありがとう!
アップデート:
私がこれまでに受け取った最初の答えによると、私は実際にフィルターに対してそのフォーマットをすでに試しました。Magento APIのドキュメントは、私たちが知っているように、多様で、矛盾しており、不完全です。XMLは次のとおりです。
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns4="urn:Magento" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header/>
<ns1:Body>
<ns4:call>
<sessionId xsi:type="ns2:string">93c7aaab38adaab5db732b211e5b</sessionId>
<resourcePath xsi:type="ns2:string">sales_order.list</resourcePath>
<args xsi:type="ns0:args">
<filter xsi:type="ns2:filter">
<value xsi:type="ns2:string">123</value>
<key xsi:type="ns2:string">order_id</key>
</filter>
</args>
</ns4:call>
</ns1:Body>
</SOAP-ENV:Envelope>
またはおそらく:
<ns1:Body>
<ns4:call>
<sessionId xsi:type="ns2:string">93c74cb7ef0baaaaab5db732b211e5b</sessionId>
<resourcePath xsi:type="ns2:string">sales_order.list</resourcePath>
<args xsi:type="ns0:args">
<filter xsi:type="ns2:filter">
<value xsi:type="ns2:value">
<value xsi:type="ns2:string">123</value>
<key xsi:type="ns2:string">eq</key>
</value>
<key xsi:type="ns2:string">order_id</key>
</filter>
</args>
</ns4:call>
</ns1:Body>
</SOAP-ENV:Envelope>
これは次のようになります:
{'filter':[{'key':'order_id','value':{'key':'eq','value':'123'}}]}
Pythonで。
そして、それらはまだすべての注文を返します(最終的には...)。したがって、前述したように、誰かが実際にエミュレートするXMLを提供してくれる場合は、それがより役立つ可能性があります。明日はMagentoのソースを調べて、自分の問題を解決する予定です。