NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Raising a soap client request in PHP


Joined: 29 Sep 2015
Posts: 1
Reply with quote
I need to generate a soap request with a user defined variable in PHP.
The request will throw an ID and the response needs to fetch the relevant details associated with the ID.

A portion of the code snippet is given below :

####################CLIENT SCRIPT##########################################

require_once('nusoap.php');

$c = new soapclient('Call to the web service WSDL');
$stockprice = $c->getConsumerInfo('abcd');

########################################################################

'getConsumerInfo' is the name of the web service that is used to generate the soap request and 'abcd' is the variable that is passed as a parameter.

The server script follows :

#########################################################################

Web service function defined :

require('nusoap.php');

function getConsumerInfo($cons_id)
{
$consno = "xxxxxxxx";
return $consno;
}





$server = new soap_server();

$server->configureWSDL('stockserver', 'urn:consno');

$server->register("getConsumerInfo",
array('cons_id' => 'xsd:string'),
array('return' => 'xsd:string'),
'urn:consno',
'urn:consno#getConsumerInfo');

$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)
? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);





#########################################################################
View user's profileFind all posts by sorcaranirbanSend private message
Raising a soap client request in PHP
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic