title: PHP SOAPClient equivalent of CURLOPT_FOLLOWLOCATION?
body: <p>I am able to create raw XML and communicate with the server using curl with CURLOPT_FOLLOWLOCATION set to true. According to the service provider 307 redirects are the rule, and the hosts can change at any time.</p>
  
  <p>The XML for this project is massive and verbose.  I do not want to work with raw XML; I want to use SOAPClient. </p>
  
  <p>This SOAPClient code results in <strong>SoapFault "message":protected]=> string(25) "Could not connect to host"</strong></p>
  
  <pre><code>$url = "https://vmi21.example.net/VMIService.asmx";
  $options = [ 'trace' =&gt; 1 ];
  
  $soapClient = new SOAPClient($url . '?wsdl', $options );
  
  try
  {
      $result = $soapClient-&gt;GetCompanyList( $params );
  }
  catch (SoapFault $soapFault)
  {
      var_dump($soapFault);
  }
  </code></pre>
  
  <p>After much debugging I noticed a URL in the trace: </p>
  
  <pre><code>...
  [1]=&gt; string(41) "https://vmi8.example.net/VMIService.asmx"
  ...
  </code></pre>
  
  <p>Assuming that this is where the 307 redirected the curl I set the following in the SOAPClient options, and it worked!</p>
  
  <pre><code>[ 'location' =&gt; 'https://vmi8.example.net/VMIService.asmx' ] 
  </code></pre>
  
  <p>As mentioned above, according to the service provider these hosts can change at any time, which means that this code would probably break frequently.  </p>
  
  <p><strong>Is there any way to tell SOAPClient to follow these redirects like curl does with the CURLOPT_FOLLOWLOCATION option set to true?</strong>  </p>