xml - php with soap service -
i need use xml file: http://www.mubashermisr.com/mubadelayed/service1.asmx?wsdl
to connect gettopgainers methode use code:
<?php ini_set("soap.wsdl_cache_enabled", "0"); // disabling wsdl cache $wsdl_path = "http://www.mubashermisr.com/mubadelayed/service1.asmx?wsdl"; $parameters = array("username"=>"xxxx","password"=>"xxxx","id"=>"xxxxx"); $client = new soapclient($wsdl_path, array('trace' => 1)); try { $result = $client->gettopgainers($parameters); print_r($result); } catch (soapfault $exception) { echo $exception; } ?>
but following error:
soapfault exception: [soap:server] server unable process request. ---> object reference not set instance of object. in c:\wamp\www\soap\soap.php:24 stack trace: #0 c:\wamp\www\soap\soap.php(24): soapclient->__call('gettopgainers', array) #1 c:\wamp\www\soap\soap.php(24): soapclient->gettopgainers(array) #2 {main}
any appreciated. thanks
<?php ini_set("soap.wsdl_cache_enabled", "0"); // disabling wsdl cache $wsdl_path = "url"; $parameters = array("username"=>"xxx","password"=>"xxx","id"=>"xxx"); $header = new soapheader('namespace', 'auth', $parameters); $client = new soapclient($wsdl_path); $client->__setsoapheaders($header); try { $topgainers = $client->gettopgainers(); // top gainers echo"<pre>"; print_r($topgainers); echo"</pre>"; } catch (soapfault $exception) { echo $exception; } ?>
Comments
Post a Comment