Call A C# Web Service From PHP Client -
i have asp.net c# web service http://www.emadbook.com/testwebservice/convert.asmx
and php client code:
<?php //use c# web service: require "lib/nusoap.php"; $client2 = new nusoap_client("http://www.emadbook.com/testwebservice/convert.asmx?wsdl","http://tempuri.org/"); $result = $client2->call("celsiustofahrenheit", array(37)); echo $result; ?>
this code return nothing , no errors can modify code return value, think main error in passing number service looked on google not find way of sending number parameter?
edit: saw link: call asp.net web service php multiple parameters , modified code to:
<?php //use c# web service: $client2 = new soapclient("http://www.emadbook.com/testwebservice/convert.asmx?wsdl"); $params->celsius = '37'; $result = $client2->celsiustofahrenheit($params)->celsiustofahrenheitresult; echo (string)$result; ?>
and return result before show error: warning: creating default object empty value pointing params variable creation, progress body can solve generated error? thanks
this right answer found myself , share other developers
<?php //use c# web service: $client2 = new soapclient("http://www.emadbook.com/testwebservice/convert.asmx?wsdl"); $params = new arrayobject(); $params->celsius = 37; $result = $client2->celsiustofahrenheit($params)->celsiustofahrenheitresult; echo $result; ?>
Comments
Post a Comment