We have some large SOAP messages which should be sent to an external party (aprox 15MB). I was wondering if it is possible to enable request compression in a call to pub.client:soapClient. Compression of an HTTP request is not a common setup, as you can never be sure the receiver can handle the compression. That’s why normally, only responses are compressed if the Accept-Encoding header of the request contains “gzip” or “deflate”. However, from the HTTP specs, I understand the Content-Encoding header is also accepted for requests (it’s an Entity header), so we can just set the header “Content-Encoding” of the request to gzip, compress the request itself and send it to the web service provider. The provider should then be able to decompress the request.
This approach is available in other products, such as Apache Axis (using the HTTPConstants.MC_GZIP_REQUEST property), so maybe it is also available for webMethods? If not, would it be hard to create this functionality using a custom Java service? And would this be advisable?
Just want to make sure I understand the situation and what you want to achieve.
I’m interpreting that your web service provider currently do not accept compressed soap body message, and you’d like to enable compression on transport layer hoping that the app server hosting the provider can decompress it before passing to the soap handler.
Thanks for your reply. Currently, the web service provider is not yet set up, we currently are adding some details to an application architecture where Software AG would send messages to different parties, using the same webservice which will be hosted at the different parties. These parties will use different technologies to provide this soap web service, so I want to setup a solution which is widely supported, however, we have the option to request these parties to support/enable additional compression functionalities.
The messages which are being sent to the different parties would have a lot of XML content. It’s not an attachment to the XML, but really just a lot of XML elements, resulting in an XML file of approx 15MB. To decrease the transfer time I want to compress this soap body. I see several options:
Compress the transport layer.
This solution I already used in the past with other technologies to compress the soap response. This is a widely accepted solution, which improved the performance greatly, as in that case, the communication was over a wireless connection. However, now I want to compress the request instead of the response. It would be up to the web service provider to automatically detect the content is compressed, by interpreting the “Content-type” header. I still have to check which technologies accept compressed requests, but a first analysis leads me to believe this is accepted by the majority of the implementors. Before analysing this further, I first need to know if I can even create compressed requests in webMethods.
Compress the SOAP body
I found information about binary message encoding which supports gzip compression, however, I only found information about this in Microsoft documentation, it doesn’t seem to be a widely accepted solution. Is this correct?
Using MTOM (Message Transmission Optimization Mechanism-
This mechanism is used to compress binary data, which would normally be sent using base64 encoding. In my case, I want to send xml data, so this option doesn’t seem to be the most user-friendly solution.
So indeed in short, I would like to enable compression on the transport layer when sending the request to the soap webservice within webMethods.