php - Can I modify the http headers sent via a SOAP request -
i'm having trouble getting soap compression working , after reading documentation service i've realised it's because they've decided ignore http standard , own thing.
basically need able set content-encoding header to:
content-encoding: accept-gzip,accept-deflate
rather using accept-encoding, they've decided use content-encoding incredibly annoying , there's 0 chance of them changing it. if set compression option in soap client sends
content-encoding: gzip
which causes soap client throw exception saying "unknown content-encoding".
so possible alter http request gets sent using default php soap client?
maye somebody:
$mode = array ( 'soap_version' => 'soap_1_1', // use soap 1.1 client 'keep_alive' => true, 'trace' => 1, 'encoding' =>'utf-8', 'compression' => soap_compression_accept | soap_compression_gzip | soap_compression_deflate, 'exceptions' => true, 'cache_wsdl' => wsdl_cache_none, 'stream_context' => stream_context_create ( array ( 'http' => array('header' => 'content-encoding: xxxxxxx'), ) ) ); // initialize soap client $client = new loenviosoapclient ( $this->wsdl, $mode );
Comments
Post a Comment