title: Which method (POST/GET) is using in the SoapClient to send HTTP requests?
body: <p>I don't know if I'm asking a correct question! But I think its answer will guide me to solve my problem...</p>
  
  <p>I'm trying to call a function by SoapClient,... It is a simplified version of my code:</p>
  
  <pre><code>class SOAP_AuthStruct {
      function __construct($user, $pass) {
          $this-&gt;Username = strval($user);
          $this-&gt;Password = strval($pass);
      }
  }
  
  
  $soap_loc = "SET TO SOAP PATH";
  
  $soap_opts = array (
          'location'   =&gt;  $soap_loc,
          'style'      =&gt;  SOAP_DOCUMENT,
          'use'        =&gt;  SOAP_LITERAL,
          'cache_wsdl' =&gt;  WSDL_CACHE_NONE,
          'exceptions' =&gt;  FALSE,
          'trace'      =&gt;  TRUE
  );
  
  
  $testclient = new SoapClient("soapcall.wsdl", $soap_opts);
  
  $soap_auth = new SOAP_AuthStruct("USERNAME", "PASSWORD");
  $soap_header = new SoapHeader($soap_ns,'AuthHeader',$soap_auth,FALSE);
  
  // $a_param is filled with essential values
  $soap_param = array("CreateTransaction" =&gt; $a_param);
  
  
  try {
      $result = $testclient-&gt;__soapCall("CreateTransaction", $soap_param, NULL, $soap_header, $output_headers);
  
      echo $testclient-&gt;__getLastRequest();
      echo "\n\n";
      echo $testclient-&gt;__getLastResponse(); 
      echo "\n\n";
      echo $testclient-&gt;__getLastResponseHeaders(); 
      echo "\n\n";
  
  } catch (SoapFault $fault) {
  
      trigger_error("SOAP Fault: (faultcode: {$fault-&gt;faultcode}, faultstring: {$fault-&gt;faultstring})", E_USER_ERROR);
  
  }
  </code></pre>
  
  <p>I have a sample of correct request format, and the getLastRequest() function shows that the request has the correct format...</p>
  
  <p>but in response I have this Error Message:</p>
  
  <pre><code>HTTP/1.1 405 Method Not Allowed
  X-Mashery-Responder: XXXXX.mashery.com
  Allow: GET, HEAD, OPTIONS, TRACE
  Content-Type: text/html
  Server: Microsoft-IIS/7.5
  X-Powered-By: ASP.NET
  Date: Tue, 12 Apr 2011 18:34:29 GMT
  Accept-Ranges: bytes
  Content-Length: 1293
  </code></pre>
  
  <p>I think (and I'm not sure about it!) that may be SoapClient use POST Method to send request, and I can't find it in the response header: "Allow: GET, HEAD, OPTIONS, TRACE"</p>
  
  <p>Please let me know if you have any solution to my problem! and Also the answer to my question! </p>
  
  <p>Many Thanks in advance for your help and your time ;)</p>
  
  <p><strong>--------------------------------------------</strong></p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>OK, Now I know that it is sending POST Request!</p>
  
  <p>I added this line to my code (after calling function)</p>
  
  <pre><code>echo $testclient-&gt;__getLastRequestHeaders();
  </code></pre>
  
  <p>and it returned: </p>
  
  <pre><code>POST /RimWebAPI/?api_key=APIKEY&amp;sig=SIGNATURE   HTTP/1.1
  Host: something.com
  Connection: Keep-Alive
  User-Agent: PHP-SOAP/5.1.6
  Content-Type: text/xml; charset=utf-8
  SOAPAction: "SOAP ACTION"
  Content-Length: 2344
  </code></pre>
  
  <p>I'm still working on it, but I would appreciate any help or quide!</p>