Enabling gzip Compression with SOAP4R
It's a one-liner, but info isn't easy to find (as usual with soap4r).
When you generate your local driver with for example
wsdl2ruby.rb --wsdl MyService.wsdl --classdef MyService --type client --force
and you instantiate your proxy driver like so
ms = MyService.new ms.wiredump_dev = STDERR
you simply add
ms.streamhandler.accept_encoding_gzip = true
That's all. No need for custom headers etc.
And: zlib (compression library used by soap4r) is built into Ruby since version 1.8. No need for any gems or other shenenigans.
As an added year-end bonus, here's a list of links that helped me with SOAP and ruby over the years:
Excellent SAP article:
Correct usage of wsdl2ruby (must be wsdl2ruby.rb)
Very Helpful Detailed Article:
linked from here:
Don’t forget to enable wiredump:
fe.wiredump_dev = STDERR
Get rid of NS1:
Posted: 30 December 2010