0

I'm developing an Android app for e-commerce by accessing Magento's SOAP V2 API. I want to show all the products with image and info of all the products in Android.

I'm using catalogProductList SOAP V2 API to get products ID from Magento. From product ID's I need to get product images and other info. I can't to do all these things at once. So How can I restrict response of catalogProductList API to get first 10 or 20 products ID's and iterate through the response of SOAP?

-1

You could use the filters for this call, and then use created_at to select a subset of products.

Try this:

$complexFilter->complex_filter = array(
    array(
        'key' => 'CREATED_AT',
        'value' => array('key' => 'from', 'value' => '2012-12-17 00:00:00')
    ), 
    array(
        'key' => 'created_at',
        'value' => array('key' => 'to', 'value' => '2013-01-21 12:02:02')
    ), 
);

I took this code from here: https://stackoverflow.com/a/22874035/1016425

You can also filter by other attribute like SKU or Id:

$filters->complexFilter = array(
    array( 'key' =>'sku', 'value' => array('lt'=>'03969999')),
    array( 'key' => 'sku', 'value' => array('gt'=>'03969000')),
);

Then you can handle the pagination in the app, of course you would need to know how many products you have and how many products you want to show per page. I don't know of any pagination solution out of the box for soap api.

Also you could use the REST api, or if you want create a controller and an action which takes parameters for pagination and implement it yourself and then return the results in json

  • Thanks lloiacono for your reply. I am not looking for subset, I want pagination kind of thing for catolog pruducts in android. I cant load all the products at a time. And how can i use above code in android. – user26406 Jun 2 '15 at 8:58
  • I want to try with REST api. I am able to connect my android app using soap. But how can I connect magento using rest api. I googled i dint get any reference for rest. So any references are there ? please let me know. – user26406 Jun 5 '15 at 5:02
  • Take a look to here, it's very straight forward: magentocommerce.com/api/rest/introduction.html – lloiacono Jun 5 '15 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy