2

When I run following code in magento root

<?php
$client = new SoapClient('http://localhost/mymagento/index.php/api/v2_soap/index?wsdl=1', array('cache_wsdl' => WSDL_CACHE_NONE));
$session = $client->login('testuser', 'testuser');              
    $result = $client->salesOrderList($session);                    
echo"<pre>";
    print_r($result);
echo"</pre>";
?>

I am getting following error

   Fatal error: Uncaught SoapFault exception: [4] Resource path is not callable. in /var/www/html/mymagento/sales_order.php:9
Stack trace:
#0 /var/www/html/mymagento/sales_order.php(9): SoapClient->__call('salesOrderList', Array)
#1 /var/www/html/mymagento/sales_order.php(9): SoapClient->salesOrderList('98850601ed8aa6f...')
#2 {main}
  thrown in /var/www/html/mymagento/sales_order.php on line 9

But when I run

$result = $client->salesOrderInfo($session,'100000030');   

No error comes.

How to fix this? Please help

5
  • Look on permissions on API account and on hard drive files rights. Commented Nov 13, 2013 at 12:09
  • @Martin I have created a user in admin as testuser and assigned this resources sales and catalog. Can you please explain meaning of permissions on API account? Commented Nov 13, 2013 at 13:00
  • Yes, this is what i mean. Also check permissions on all the files in Magento folder (but this will be not a solution i think). Commented Nov 14, 2013 at 13:18
  • @Martin can this problem be because I am overriding public function info($orderIncrementId) of Mage_Sales_Model_Order_Api_V2 class Commented Nov 14, 2013 at 16:40
  • this in my case was related to the wrong path for model given in api.xml (i was giving the path to file rather it requires a path to directory i.e, mymodel/mymodel not the mymodel/mymodel_file) Commented Apr 24, 2014 at 11:05

2 Answers 2

3

That means you are trying to access a resource which is not available where it should be.Like the class file.

In my project I got this error, one directory was not at proper location.Please check you directory structure which you are creating for the overriding the core files. Or check if the core files directory structure has been disturbed mistakenly.

Sign up to request clarification or add additional context in comments.

1 Comment

To see a good directory structure inchoo.net/magento/magento-api-v2 ; in my case, I had a typo in my API class name
0

In stead of using localhost use IP address of your local system. Default IP address is 127.0.0.1.

So, your code should me like this:

<?php
$client = new SoapClient('http://127.0.0.1/mymagento/index.php/api/v2_soap/index?wsdl=1', array('cache_wsdl' => WSDL_CACHE_NONE));
$session = $client->login('testuser', 'testuser');              
$result = $client->salesOrderList($session);                    
echo"<pre>";
print_r($result);
echo"</pre>";
?>

Try this, hope will help!

6 Comments

Do you think I am not passing any filter value this may be the reason for the problem?
No, use IP address in stead of 'localhost' in first line that is SOAP URL http://127.0.0.1/mymagento/index.php/api/v2_soap/index?wsdl=1
I tried the same thing on my development server other than my loaclhost, I am getting same error. Actually what is meaning of "Resource path is not callable"
open app\code\core\Mage\Sales\etc\wsdl.xml and find salesOrderList operation and posttype is exits or not.
could you please explain what do you mean by "posttype is exits or not"
|

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.