Monday, December 21, 2009

Nusoap PHP Request (USING WSDL URL)

// example one using WSDL URL
// include nusoap file
require_once('nusoap.php');
// set the wsdl path
$wsdl="http://localhost/server.php?wsdl";
// crate client
$client=new soapclientw($wsdl, 'wsdl');
// set the parameter
$param=array('amount'=>'15.00');
// cal method and echo the resutl
echo $client->call('CalculateOntarioTax', $param);
// echo request and response
echo 'Request ' . htmlspecialchars($client->requestHeaders, ENT_QUOTES) . '';
echo 'Response ' . htmlspecialchars($client->responseHeaders, ENT_QUOTES) . ' ';

No comments: