I am trying to consume a soap service in php. This is the code I am using
define('APIURL','https://cgorders.com/v2.1/Service.asmx?WSDL'); $client = new SoapClient(APIURL); $search_query = new StdClass(); $search_query ->CustomerID = CustomerID; $search_query ->ClientPO = $orderID; $search_query ->AccessToken = $cgTokem; //AccessToken; $result = $client->GetOrdersByClientPO($search_query); //echo "<pre>";print_r($result->GetOrdersByClientPOResult->Orders->OrderID);echo "</pre>";exit; if(isset($result->GetOrdersByClientPOResult->Orders->OrderID)) { return($result->GetOrdersByClientPOResult->Orders->OrderID); } else { return(''); }
I am passing appropriate parameters correctly, did not mention them, for security reasons. I am getting Call to undefined method soapclient::GetOrdersByClientPO() . Can anybody help?
Advertisement
Answer
Soap client was not installed over the server, I was testing. After installation, it worked like a charm. Thank you.