updated below
Does anyone have an example of proper XML for the Magento SOAP v1 API to do something according to the following lines:
client.call(session_token,'sales_order.list', {'filters':{'order_id':{'eq':12}}})
This is an example of python suds call that doesn't work for me. Indeed, any XML example that filters sales_order.list, catalog_product.list or customer.list will do. I am already working on a version of XMLRPC, but with the python SUP and SOAP v1 API, no matter what filter, I get the whole list that is unfiltered as an answer. Here's what the XML looks like now:
<?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>
Of course, I have already tried a million other options above. I'm just wondering if my calls are correct, and I have a bad circuit, or if the soap server is awkward or what. Thus, if someone has validated XML to try to imitate, this will help a lot.
Thanks!
update:
according to the first answer I received so far, I already tried this format for filters. The documentation for the Magento API, as we know, is different, inconsistent, and incomplete. here is the 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>
or perhaps:
<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>
which is as follows:
{'filter':[{'key':'order_id','value':{'key':'eq','value':'123'}}]}
in python.
And they all return all orders (in the end ...). So, as I said before, if someone can give me some XML to follow, this might be more useful. I'm probably going to start through a Magento source tomorrow and solve my own problem.