I am trying to make a simple API call to get some information on an Order. The reason I am trying with SOAP is because a similar API request is returning empty values for some sales attributes so I am trying to see if I get a different result using SOAP but I keep getting
Fatal error: Call to a member function salesOrderInfo() on a non-object in
I've followed the information on the Magento WIKI
But I keep getting this error, I've placed this file in the root of my Magento installation:
orderinfo.php
<?php
$proxy = new SoapClient('http://www.mydomain.com/index.php/api/v2_soap?wsdl=1');
$session = $proxy->login('user', 'password'); // connect to the API
$result = $client->salesOrderInfo($session, '100000064');
var_dump($result);
Best Answer
Simple error. You are using the wrong variable in SalesOrderInfo.
Your current code
Notice: That you set the session Id to $session, but then use $sessionId in salesOrderInfo.
Edit: Another error. $client should be $proxy
Try the following code. This worked for me! Just add your url, and api username and password.