title: Interacting with a soap API without WSDL in PHP
body: <p>Recently got access to a soap API for a hotel management service. They have provided documentation which shows a basic example of a request:</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;    
  &lt;soapenv:Header&gt;       
    &lt;Auth xmlns="http://xxxx/xxxxAPI"&gt;          
    &lt;FromSystemId ID="1"&gt;CompanyName&lt;/FromSystemId&gt;          
      &lt;UserName&gt;username&lt;/UserName&gt;          
      &lt;Password&gt;password&lt;/Password&gt;       
    &lt;/Auth&gt;    
  &lt;/soapenv:Header&gt;    
  &lt;soapenv:Body&gt;       
    &lt;GetRegions Timestamp="2016-04-11" Version="1.0" Lang="en" 
       xmlns="http://xxxx/xxxxAPI"&gt;
    &lt;Country Code="GB" /&gt;  
    &lt;/GetRegions&gt;    
  &lt;/soapenv:Body&gt; 
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>They have also provided a list of functions in their documentation and the parameters required for each of the functions. But i am abit confused on how to perform a request as i have never used a soap API before. They also haven't provided a WSDL, does this matter? </p>
  
  <p>Anyway, here is how i thought to try and perform a request</p>
  
  <pre><code>$soapURL = "http://xxxx/xxxxAPI" ;
  $soapParameters = Array('login' =&gt; "username", 'password' =&gt; "password") ;
  $soapFunction = "getRegions";
  $soapFunctionParameters = Array('countrycode' =&gt; 'GB');
  
  $soapClient = new SoapClient($soapURL, $soapParameters);
  
  $soapResult = $soapClient-&gt;__soapCall($soapFunction, 
  $soapFunctionParameters) ;
  
  if(is_array($soapResult) &amp;&amp; isset($soapResult['someFunctionResult'])) {
      // Process result.
  } else {
      // Unexpected result
      if(function_exists("debug_message")) {
          debug_message("Unexpected soapResult for {$soapFunction}: ".print_r($soapResult, TRUE)) ;
      }
  }
  </code></pre>
  
  <p>Am i going about this the right way? i am unable to test this right now as i haven't received my authentication but wanted to make a start on it now.</p>
  
  <p>Any help would be great.</p>