Tuesday, March 12, 2013

OSB. chunked transfer encoding

Sendin a request to SOAPUI in automated (testrunner) way, we can see:

Accept-Encoding : gzip,deflate 

the response comes back with

Response Headers: Transfer-Encoding : chunked

For explanations, see http://en.wikipedia.org/wiki/HTTP_compression#Client.2FServer_compression_scheme_negotiation

and http://en.wikipedia.org/wiki/Chunked_transfer_encoding 

"HTTP servers sometimes use compression (gzip) or deflate methods to optimize transmission. How both chunked and gzip encoding interact is dictated by the two-staged encoding of HTTP: first the content stream is encoded as (Content-Encoding: gzip), after which the resulting byte stream is encoded for transfer using another encoder (Transfer-Encoding: chunked). This means that in case both compression and chunked encoding are enabled, the chunk encoding itself is not compressed, and the data in each chunk should not be compressed individually. The remote endpoint can decode the incoming stream by first decoding it with the Transfer-Encoding, followed by the specified Content-Encoding."

How can this "chunked" happen?

Is there any HTTP Business Service along the path?
If yes, we should check if it has got Chunked Streaming Mode disabled:


"Use Chunked Streaming Mode Select this option if you want to use HTTP chunked transfer encoding to send messages.

Note: Do not use chunked streaming with if you use the Follow HTTP Redirects option. Redirection and authentication cannot be handled automatically in chunked mode."

Also check that Chunking Threshold is disabled in SOAPUI :

More on the topic:


Understanding Chunked Streaming 

Oracle documentation states that the Chunked Streaming Mode property should be selected "if you want to use HTTP chunked transfer encoding to send messages." You normally want to enable chunked streaming if possible (with my problem above, it is not possible).

Chunked transfer encoding is an HTTP 1.1 specification, and allows clients to parse dynamic data immediately after the first chunk is read. Note that the Oracle documentation also states not to enable chunked streaming if you use the Follow HTTP Redirects option, as redirection and authentication cannot be handled automatically in chunked mode.

No comments: