SOAP_COMPRESSION_GZIP soap verfication, if it works

Using php5, and I am making soap requests for a wsdl-based web service that does not use a header element.

That's all, I was asked to use gzip compression for my requests for soap.

So now my client looks like this:

$client = new SoapClient('xxxxx.wsdl', array('compression'=> SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP, 'trace' => 1, ) ); 

I searched Google a bit and I found sites saying that I should add gzip compression level (add | 9 ) after SOAP_COMPRESSION_GZIP , but when I do this, I get a loss of soap back

"Content not allowed in prolog"

So I dropped the phone 9)

Question: Ss I am not an expert in soap, with the inscription I do not receive any errors in the outgoing xml request or return request. How do I know if my gzip compression works, and if it is confirmed from the other side?

+4
source share
1 answer

You can check SoapClient :: __ getLastRequestHeaders and check the content headers and content headers. If the request is compressed, the Content-Length value must be less than the payload size

If the web service is not on HTTPS, you can also launch a packet sniffer, such as WireShark, and grab the request and see what exactly was transferred.

+2
source

Source: https://habr.com/ru/post/1307824/


All Articles