title: how to get data form this webservices using php?
body: <p>I want to get respond from this web services. </p>
  
  <p><a href="http://www.w3schools.com/webservices/tempconvert.asmx" rel="nofollow">http://www.w3schools.com/webservices/tempconvert.asmx</a></p>
  
  <p><strong>web_server.php file</strong></p>
  
  <pre><code>&lt;?php
  function celcius($temp){
  
    ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache
  
    $wsdl_path = "http://www.w3schools.com/webservices/tempconvert.asmx"; 
  
    $client = new SoapClient($wsdl_path, array('trace' =&gt; 1)); //creating a SOAP Client
  
    try {
      $result = $client-&gt;CelsiusToFahrenheit(array("Celsius" =&gt; $temp));
      $sxml =  $client-&gt;__getLastResponse();
  
      $xml = simplexml_load_string($sxml);
      echo $xml;
        $xml-&gt;registerXPathNamespace('soap', 'http://schemas.xmlsoap.org/soap/envelope/');
  
       $ret_values = array("Fahrenheit"=&gt;string);
  
       return $ret_values;
  
    }
    catch (SoapFault $exception) {
      echo $exception;      
    } 
  }
  ?&gt;
  </code></pre>
  
  <p><strong>temp_websrvc.php file</strong></p>
  
  <pre><code>&lt;?php
  temp_converter();
  function temp_converter(){
  include 'web_server.php';
  
  $temprature = Array();
  echo celcius("27");
  $temprature = celcius("27");
  
       try{
  
          if($temprature['STATUS'] == 1){
            echo json_encode($temprature);
          }
          else{
            $temprature = array("Fahrenheit" =&gt; "");
            echo json_encode($temprature);
            exit();
          }
      }
      catch(Exception $e){
           echo $e-&gt;getMessage();
      }
  }
  ?&gt;
  </code></pre>