title: PHP SOAP Call Client Functions
body: <p>I need call soap client functions without libraries(nusoap , zendframework , laravel) I only should to work with php native because is a requiriment for the another proyect more important on the future so for the moment I just practice with a simple public Web Service from Here( <a href="http://www.service-repository.com/operation/show?operation=GetCitiesByCountry&amp;portType=GlobalWeatherSoap&amp;id=4" rel="nofollow">http://www.service-repository.com/operation/show?operation=GetCitiesByCountry&amp;portType=GlobalWeatherSoap&amp;id=4</a> ) , but I need Help.I try to call client soap functions but I recive this error:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught SoapFault exception: [soap:Server] System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: Procedure or function 'getWCity' expects parameter '@CountryName', which was not supplied. at WebServicex.GlobalWeather.GetCitiesByCountry(String CountryName) --- End of inner exception stack trace --- in /Applications/XAMPP/xamppfiles/htdocs/php-soap/soap/Client.php:41 Stack trace: #0 /Applications/XAMPP/xamppfiles/htdocs/php-soap/soap/Client.php(41): SoapClient->__soapCall('GetCitiesByCoun...', Array) #1 {main} thrown in /Applications/XAMPP/xamppfiles/htdocs/php-soap/soap/Client.php on line 41</p>
  </blockquote>
  
  <p>This is my server Class:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>class ServerSoap extends SoapServer{
    public function __construct(){
      $params= array('encoding'=&gt;'UTF-8','soap_version' =&gt; SOAP_1_2);
  $wsdl="http://www.webservicex.com/globalweather.asmx?WSDL";
      parent::SoapServer($wsdl,$params);
      parent::addFunction("GetCitiesByCountry");
    }
        public function fault ($code, $string, $actor = null, $details = null, $name = null) {
            throw new SoapFault($code, $string, $actor, $details, $name);
        }
  }
  $server = new ServerSoap();
  $server-&gt;setClass('ServerSoap');
  $server-&gt;handle();</code></pre>
  </div>
  </div>
  </p>
  
  <p>This is my client class:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>class Client extends SoapClient{
    public function __construct(){
  $wsdl_client="http://localhost:8080/php-soap/soap/ServerSoap.php?wsdl";
  $params_client = array(
    'trace' =&gt; TRUE,
    'wsdl'=&gt;TRUE,
    'debug'=&gt;TRUE,
    'cache_wsdl'=&gt;WSDL_CACHE_BOTH
  );
    parent::__construct($wsdl_client,$params_client);
    $this-&gt;server = new SoapServer($wsdl_client,$params_client);
    }
    public function disableClient(){
      $old_location = $this-&gt;instance-&gt;__setLocation();
      return $old_location;
    }
  
  }
  $country="Spain";
  $client = new Client();
  $client-&gt;__soapCall("GetCitiesByCountry", array("CountryName"=&gt;$country));
  echo $client-&gt;__getLastResponse();</code></pre>
  </div>
  </div>
  </p>
  
  <p>Please Help me.</p>