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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -