Jump to content

Web Service SOAP, Set PHP Variable


sanchez77

Recommended Posts

Curious how to set a returned value from a web service to a php variable?

 

$tid=  $_POST['tid'];
$client = new SoapClient("http://www.sitename.com/WebSvc.asmx?WSDL"); 
$result = $client->getName(array('tid'=>$tid));
echo json_encode($result);

 

Returns this:

{"getNameResult":{"count":1,"results":{"TaggedText":{"tid":"001","text":"John Smith"}}}}

 

How do I set a php variable $RetName to equal John Smith? I tried

 

$RetName = $text;

 

But that didn't work. Any help is apprecaited.

 

Thanks,

sanchez

 

 

Link to comment
https://forums.phpfreaks.com/topic/258541-web-service-soap-set-php-variable/
Share on other sites

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.