tags:

views:

24

answers:

0

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)

I tried a bunch of settings like

$client = new SoapClient("https://www.ad-juster.com/api_sandbox/api/dre-api.wsdl", array('compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 9));

But it doesn't work. I also tried almost every combination of php's Zlib functions, and only gzfile() worked.

This is my very hackey work around that I really dont like:

$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' => 'https://www.ad-juster.com/api_sandbox/api/'));

Can anyone recommend a better way to do this?