Magento API blog Version 1.5.0.1 7 comments


2011.02.24
Magento API blog Version 1.5.0.1

1>

If you are using WAMP following errors can come



Warning: SoapClient::SoapClient(http://shop.annet.com/api/soap/?wsdl) [function.SoapClient-SoapClient]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden ( The ISA Server denied the specified Uniform Resource Locator (URL). ) in C:\wamp\www\SOAP_CALL.php on line 2

Warning: SoapClient::SoapClient() [function.SoapClient-SoapClient]: I/O warning : failed to load external entity "http://magento.supplementmarket.com/api/soap/?wsdl" in C:\wamp\www\SOAP_CALL.php on line 2

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://magento.supplementmarket.com/api/soap/?wsdl' in C:\wamp\www\SOAP_CALL.php:2 Stack trace: #0 C:\wamp\www\SOAP_CALL.php(2): SoapClient->SoapClient('http://magento....') #1 {main} thrown in C:\wamp\www\SOAP_CALL.php on line 2
--------------------------------------

to solve this you need to remove php_soap.dll comment from php.ini and restart wamp

2>

After installation v 1.5.0.1 and after setting System –> web service– > user role
and user
Fatal error: Call to undefined method Mage_Adminhtml_Block_Widget::getrowurl()
in C:\wamp\www\shopannet\app\code\core\Mage\Adminhtml\Block\Widget\Grid.php on line 1622
Used link 4 to solve this

Magento api useful links
[1].https://magento4u.wordpress.com/tag/magento-api-key/

[2].http://activecodeline.net/consuming-web-service-via-soap-in-magento

[3].http://www.magentocommerce.com/boards/viewthread/43818/
app.zip very usefull

[4].http://www.magentocommerce.com/boards/%202010-03-04%2011:36:38%20%3C/td%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3C/tr%3E%20%20%3Ctr%3E%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3Ctd%20height=/viewthread/214093/#t286529
to over come admin error faced to create api user

————————————

PHP FILE TO GET API from magento in array


/*
echo "Calling Magento sales_order.list
";
$proxy = new SoapClient('http://shop.annet.com/index.php/api/soap/?wsdl');
$sessionId = $proxy->login('pk_sales', 'pksales1234567');

echo "session id : ".$sessionId;
$orders = $proxy->call($sessionId, 'sales_order.list', 1);
echo '
<pre>';
print_r($orders);
echo '</pre>
';

foreach ($orders as $order) {
var_dump($proxy->call($sessionId, 'sales_order.info', $order[increment_id]));
}
*/

echo "Calling Magento customer.list
";
$proxy = new SoapClient('http://shop.annet.com/index.php/api/soap/?wsdl');
$sessionId = $proxy->login('pk_customer', 'pk1234567');

echo "session id : ".$sessionId;

//if customer email eqal = pkclient@gmail.com
/*$customers = $proxy->call($sessionId, 'customer.list', array(array('email'=>array('eq'=>'pkclient@gmail.com'))));
*/

//all customers
$customers = $proxy->call($sessionId, 'customer.list',1);

echo '
<pre>';
print_r($customers);
echo '</pre>
';

foreach ($customers as $customer) {
var_dump($proxy->call($sessionId, 'customer.info', $customer[customer_id]));
}

?>


Share on Facebook




About Pragnesh Karia

Pragnesh Karia, Open Source Enthusiast, Software Professional, Software Developer, Technical Lead ,Magento, Joomla ,Joomla LMS , Moodel LMS ,PHP ,Mysql, Ajax, Javascript, Jquery, Linux, Fan of Open Sources , Annet Technologies , SEO Analyst , Mootools


7 thoughts on “Magento API blog Version 1.5.0.1