title: Getting magic function to work in PHP Soap Client
body: <p>I'm using the PHP Soap Client with a WSDL document.The client is created like this:</p>
  
  <pre><code>$client = new SoapClient('http://eklima.met.no/metdata/MetDataService?WSDL');
  </code></pre>
  
  <p>Now I want to call the function 'getCountyTypes' which takes to parameters 'language' and 'countiesId'.</p>
  
  <pre><code>$args = array(
      'language'=&gt;'no', 
      'countiesId'=&gt;'2'
  );
  </code></pre>
  
  <p>Directly using the function __soapCall works as expected:</p>
  
  <pre><code>$res = $client-&gt;__soapCall('getCountyTypes', $args);
  </code></pre>
  
  <p>Trying to use magic functions does not work:</p>
  
  <pre><code>$res = $client-&gt;getCountyTypes($args);
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>PHP Notice:  Array to string conversion in /Users/jorgen/soaptest.php on line 60
  PHP Fatal error:  Uncaught SoapFault exception: [SOAP-ENV:Client] No mapping found for ':countiesId' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'. [java.lang.IllegalArgumentException] in /Users/jorgen/soaptest.php:60
  Stack trace:
  #0 /Users/jorgen/soaptest.php(60): SoapClient-&gt;__call('getCountyTypes', Array)
  #1 /Users/jorgen/soaptest.php(60): MySoapClient-&gt;getCountyTypes(Array)
  #2 {main}
    thrown in /Users/jorgen/soaptest.php on line 60
  </code></pre>
  
  <p>I need some directions on how to use the soap client with magic functions.</p>
  
  <p><strong>Edit:</strong> Added output from var_dump($client->__getFunctions());</p>
  
  <pre><code>array(14) {
    [0]=&gt;
    string(185) "no_met_metdata_Metdata getMetData(string $timeserietypeID, string $format, string $from, string $to, string $stations, string $elements, string $hours, string $months, string $username)"
    [1]=&gt;
    string(106) "ArrayOfno_met_metdata_TimeSerieTypes getTimeserieTypesProperties(string $language, string $timeserieTypes)"
    [2]=&gt;
    string(99) "ArrayOfno_met_metdata_ElementProperties getElementsProperties(string $language, string $elem_codes)"
    [3]=&gt;
    string(93) "ArrayOfno_met_metdata_ElementProperties getElementsFromTimeserieType(string $timeserietypeID)"
    [4]=&gt;
    string(111) "ArrayOfno_met_metdata_ElementProperties getElementsFromTimeserieTypeStation(string $timeserietypeID, int $stnr)"
    [5]=&gt;
    string(97) "ArrayOfno_met_metdata_StationProperties getStationsProperties(string $stations, string $username)"
    [6]=&gt;
    string(111) "ArrayOfno_met_metdata_StationProperties getStationsFromTimeserieType(string $timeserietypeID, string $username)"
    [7]=&gt;
    string(140) "ArrayOfno_met_metdata_StationProperties getStationsFromTimeserieTypeElemCodes(string $timeserietypeID, string $elem_codes, string $username)"
    [8]=&gt;
    string(162) "ArrayOfno_met_metdata_StationProperties getStationsFromTimeserieTypeStationsElemCode(string $timeserietype, string $stations, string $elem_code, string $username)"
    [9]=&gt;
    string(22) "string getDateFormat()"
    [10]=&gt;
    string(89) "ArrayOfno_met_metdata_FlagProperties getFlagProperties(string $language, string $flagsId)"
    [11]=&gt;
    string(110) "ArrayOfno_met_metdata_PrecipitationTypes getPrecipitationTypes(string $language, string $precipitationTypesId)"
    [12]=&gt;
    string(33) "ArrayOfString getValidLanguages()"
    [13]=&gt;
    string(86) "ArrayOfno_met_metdata_CountyTypes getCountyTypes(string $language, string $countiesId)"
  }
  </code></pre>