title: PHP SoapClient get gzip wsdl
body: <p>My SoapClient cant open a gzipped wsdl file directly. Feel free to take a look at the WSDL your self, I think its public (https://www.ad-juster.com/api_sandbox/api/dre-api.wsdl)</p>
  
  <p>I tried a bunch of settings like</p>
  
  <pre><code>$client = new SoapClient("https://www.ad-juster.com/api_sandbox/api/dre-api.wsdl", array('compression' =&gt; SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 9));
  </code></pre>
  
  <p>But it doesn't work. I also tried almost every combination of php's Zlib functions, and only gzfile() worked.</p>
  
  <p>This is my very hackey work around that I really dont like:</p>
  
  <pre><code>$file  = fopen('/tmp/tmp.wsdl', 'w+');
  $input = gzfile('https://www.ad-juster.com/api_sandbox/api/dre-api.wsdl');
  foreach ($input as $line) {
    fwrite($file, $line);
  }
  fclose($file);
  $client = new SoapClient('/tmp/tmp.wsdl', array('location' =&gt; 'https://www.ad-juster.com/api_sandbox/api/'));
  </code></pre>
  
  <p>Can anyone recommend a better way to do this?</p>