title: Call A C# Web Service From PHP Client
body: <p>I have this ASP.Net C# Web Service
  <a href="http://www.emadbook.com/TestWebService/Convert.asmx" rel="nofollow noreferrer">http://www.emadbook.com/TestWebService/Convert.asmx</a></p>
  
  <p>and this is the PHP client code:</p>
  
  <pre><code>    &lt;?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-&gt;call("CelsiusToFahrenheit", array(37));
          echo $result;
      ?&gt;
  </code></pre>
  
  <p>this code return nothing and no errors anybody can modify my code to return a value, I think the main error is in passing a number to the service as I looked on google but I could not find a way of sending number parameter?</p>
  
  <p>Edit:
  I saw this link:
  <a href="https://stackoverflow.com/questions/9711502/call-asp-net-web-service-from-php-with-multiple-parameters">Call asp.net web service from PHP with multiple parameters</a>
  and I modified my code to:</p>
  
  <pre><code>&lt;?php
      //Use C# Web Service:
      $client2 = new SoapClient("http://www.emadbook.com/TestWebService/Convert.asmx?WSDL");
      $params-&gt;Celsius = '37';   
      $result = $client2-&gt;CelsiusToFahrenheit($params)-&gt;CelsiusToFahrenheitResult;
      echo (string)$result;
  ?&gt;
  </code></pre>
  
  <p>and it return a result but before that it show this error:
  Warning: Creating default object from empty value
  pointing to the Params variable creation, so this is good progress but any body can solve the generated error?
  thanks</p>