Before i ask the question, let me just put it this way that i have found couple of close answers to my question. But these answers are fit for the clients implemented in PHP on a server (things are a bit easier this way)

But I am using the latest set of SOAP API's to connect to Magento from an Android client written in Java. I have a set of requirements where i have to filter the products, orders by various parameters.

Unfortunately I am not able to set the filters correctly. Below is a snippet of the SOAP request I am making in one of the cases (the error response i have posted below it).

Please help me in configuring the correct filter.

<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
      <urn:catalogProductList soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
         <sessionId xsi:type="xsd:string">d983bbee001cff69e25fdc75b5ad3394</sessionId>
         <filters xsi:type="urn:filters">
            <!--You may enter the following 2 items in any order-->
            <filter xsi:type="urn:associativeArray" soapenc:arrayType="urn:associativeEntity[]">
                **<key xsi:type="xsd:string">product_id</key>
                <value xsi:type="xsd:string">2</value>**
            <complex_filter xsi:type="urn:complexFilterArray" soapenc:arrayType="urn:complexFilter[]">
         <storeView xsi:type="xsd:string">malaysian</storeView>

Response ---

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
         <faultstring>Call to a member function getAttributeCode() on a non-object</faultstring>

1 Answer 1


Ah, you here pretty close.
The only think that is missing is a wrapper tag for your key-value pair.
The filter tag should look like this:

<filter xsi:type="urn:associativeArray" soapenc:arrayType="urn:associativeEntity[]">
     <item><!-- this is missing on your side -->
        <key xsi:type="xsd:string">product_id</key>
        <value xsi:type="xsd:string">2</value>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.