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

Link to comment
Share on other sites

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);

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.