PHP Webservice using NUSoap Client not working
We need to communicate with the .NET webservice url and get the date from the method by passing respective arguments. When trying to use with the NUSOAP library in the reponse i got the error as result in the response node.
So i tried the sample w3schools temperature convert webservice link and tested it. While doing this, i got the same error result. I have pasted the code below for your reference:
$client = new nusoap_client('http://www.w3schools.com/webservices/tempconvert.asmx',false);
$soapaction = "http://tempuri.org/CelsiusToFahrenheit";
$namespace= "http://tempuri.org/";
$client->soap_defencoding = 'UTF-8';
$params = array(
'Celsiu开发者_StackOverflow社区s' => "122"
);
$result = $client->call('CelsiusToFahrenheit', $params,$namespace,$soapaction);
I got the response as below,
<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><CelsiusToFahrenheitResponse xmlns="http://tempuri.org/"><CelsiusToFahrenheitResult>Error</CelsiusToFahrenheitResult></CelsiusToFahrenheitResponse></soap:Body></soap:Envelope>
Can you please let me know where it is wrong in accessing the webservice call. If you need any other details let me know.
Thanks in Advance,
Regards
Srinivasan
found that the webservice call works in php using nusoap
I have made changes in below line to $client = new nusoap_client('http://www.w3schools.com/webservices/tempconvert.asmx',false);
using below code works,
$client = new nusoap_client('http://www.w3schools.com/webservices/tempconvert.asmx?wsdl',true);
精彩评论