Consuming DotNet webservice in PHP using nusoap library



This is an example on how I use nusoap library to call DotNet webservice in PHP. 



<?php
    require_once ('lib/nusoap.php');
$client = new nusoap_client('http://192.168.1.1/owsService.asmx?WSDL', 'WSDL');

$params=array('ReciptId'=>'1006119');

$answer = $client->call('getServiceStatusByReciptID', $params);


$error = $client->getError();
if ($error) {
    print_r($client->response);
    print_r($client->getDebug());
    die();
 }

echo $answer["getServiceStatusByReciptIDResult"]["StatusDesc"];


?>


If you need to get all the functions that are available through that web-service you can use the  __getFunctions() function .

<?php
$client = new SoapClient('http://192.168.1.1./owsService.asmx?WSDL');
var_dump($client->__getFunctions());
?>

Comments