PHP Soap Api 测试文件
接口文档地址
http://devdocs.magento.com/guides/m1x/api/soap/catalog/catalogProductAttribute/product_attribute.list.html
<?php /** * WeiCot Framework * User: ajiang * WebSite: WWW.WEICOT.COM * Date: 2016/5/25 * Time: 23:16 * Dir:api/MageTest.php * Model: Weioct\Mage\Model\Api */ require "../app/bootstrap.php"; use Weicot\Core\Block as Block; $block=new Block(); $block->addJs("jquery-1.9.1"); $block->addJs("jquery.soap"); $client = new SoapClient('http://m.com/api/soap/?wsdl'); $session = $client->login('123456', '123456'); $result = $client->resources($session); //权限 以及会话 $apicalls = array(); $i = 0; $ii = 0; //获得 产品列表 及图片 $filters = array('sku' => array('neq'=>'')); $products = $client->call($session, 'catalog_product.list',array($filters)); foreach ($products as $product){ $apicalls[$i] = array('catalog_product_attribute_media.list', $product['product_id']); $i++; $apicalls[$i] = array('catalog_product.info', $product['product_id']); $i++; } $productinfo = $client->multiCall($session, $apicalls);; var_dump($productinfo); //var_dump( $result); //筛选产品 $filters = array( 'sku' => array('like'=>'%t%') ); //获得产品 //$products =$client->call($session, 'product.list', array($filters)); //var_dump($products); //获得目录 $CatalogInfo = $client->call($session, 'catalog_category.info', '4'); $resultee = $client->__soapCall($session, 'catalog_category.info', '4'); var_dump($resultee); var_dump($CatalogInfo); //产品列表 $result = $client->call($session, 'catalog_product.list'); var_dump($result); //产品信息 $result = $client->call($session, 'catalog_product.info', '72'); var_dump($result); //带媒体的产品信息 $result = $client->call($session, 'catalog_product_attribute_media.list', '72'); var_dump($result); //获得所有用户列表 //$customer= $client->call($session, 'customer.list', array(array())); //var_dump($customer); echo "<br /><br />"; $client->endSession($session); ?>
Magento SOAP API wrapper for Node.js
接口文档地址
https://www.npmjs.com/package/magento
var MagentoAPI = require('magento'); var magento = new MagentoAPI({ host: 'your.host', port: 80, path: '/api/xmlrpc/', login: 'your_username', pass: 'your_pass' }); magento.login(function(err, sessId) { if (err) { // deal with error return; } // use magento });
Catalog Category Catalog Category Attribute Catalog Product Catalog Product Attribute Catalog Product Attribute Media Catalog Product Attribute Set Catalog Product Custom Option Catalog Product Custom Option Value Catalog Product Downloadable Link Catalog Product Link Catalog Product Tag Catalog Product Tier Price Catalog Product Type Catalog Inventory Stock Item Checkout Cart Checkout Cart Coupon Checkout Cart Customer Checkout Cart Payment Checkout Cart Product Checkout Cart Shipping Core Customer Customer Address Customer Group Directory Country Directory Region Sales Order Sales Order Credit Memo Sales Order Invoice Sales Order Shipment Store
Java 版本
http://inchoo.net/dev-talk/android-development/magento-v2-api-soap-android/