Jump to content

how to capture response from php web service


jcworking2000

Recommended Posts

hi all,

 

i am new to php and web service but i am trying to connect to a database using web services in php, i am able to add the web service to my page but just wondering how to capture the response and display it? in the following code, it suppose to print out "hello world". thanks for your help in advance.

 

$xml = "<Process_MM_Test>Hello World</Process_MM_Test>";

ini_set('soap.wsdl_cache_enabled', 0);   

 

$client = new SoapClient("xxx.asmx?wsdl");

$response = $client->__soapCall("Process_MM_Test", array("xml_formatted_string" => $xml));

 

thanks

Looking at the documentation (http://us.php.net/manual/en/soapclient.soapcall.php) it looks like __soapCall should return either a simple value or a associative array.  To see what is being returned by __soapCall, do this:

 

$xml = "<Process_MM_Test>Hello World</Process_MM_Test>";
ini_set('soap.wsdl_cache_enabled', 0);    

$client = new SoapClient("xxx.asmx?wsdl");
$response = $client->__soapCall("Process_MM_Test", array("xml_formatted_string" => $xml));

print_r($response);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.