My first post to Tomcat list, pardon me if I make any mistakes,

Any help you can provide would be greatly appreciated.

I have a Tomcat Server (V 7.0.54) running under Windows 2008 R2 With
Service Pack 1 (and up to date on Security as well as OS patches). That
server is running a vendor supplied group of applications via .war file as
normal. to receive Soap/XML data from remote computer and process and
return data back to calling application.

The remote calling application hosted by IBM Websphere Application Server
(running Axis2 jars) that is sending XML Soap data via a Post to the Tomcat
Web server on port 8080/8443. If the amount of data is relatively small
(i.e. 14 K) we have no problem receiving the data as Websphere is using
Length Http 1.1 header and Tomcat sends the data to the application with no
issue. However as the data gets larger, Websphere begins using Chunked
Transfer Encoding and apparently Tomcat does not seem to like this as it
returns Http 411 "Length Required" message. I have searched Tomcat site,
and Tomcat indicates that is support Chunked encoding (part of the MUST
supported parts of the HTTP 1.1 RFC standard.

My connector in Tomcat is configured:

    <Connector port="8080" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />

I have tried forcing BIO,NIO, and APR with no luck to see if the
implementations might handle Chunked Encoding differently.

I also have a more complicated 8443 SSL port that also works, until Chunked
encoding is used, and then it also responds with 411 Length Required error.

I am able to replicate the problem by using SoapUI to send the same Soap
formatted XML Data. It works fine sending all sizes of data UNTIL I enable
Chunked Encoding Threshold which is smaller than the XML payload size
(threshold means to not Chunk until data is larger than Threshold), When
Chunking starts, Tomcat responds with 411 Length required.

To finally work around this issue, I have put an Apache 2.4 server in front
of Tomcat, and have enable the mod_proxy_http, and am using an Apache
SetEnv variable setting of : SetEnv proxy-sendcl 1
The proxy-sendcl tells Apache to send the "Length" , and then Tomcat and
application are happy with the data (i.e. no 411 method sent back).

As I stated above, Tomcat indicates it supports Chunked Encoding on it's
site, but it acts as if it is not happy with it.

We have looked at packet traces and it appears that the Chunks are
formatted correctly (we are getting an initial Chunk(s) and then the last
Chunk is zero with Cr Lf following it as it seems to indicate in RFC.

Has anyone else seen this issue and is there any way to alter the Tomcat
behavior with Chunked encoded data?

We found an IBM Websphere article that seems to admit to the problem, but
they indicate that they should not have to offer a method to disable
chunked encoding as some who seem to have encountered this problem suggest.
IBM states that since Http 1.1 mandates support of Chunked Encoding, then
HTTP 1.1. servers should support Chunked encoding correctly. FYI, I took
the time to recreate the problem in C# code, and as soon as I turn on
Chunked Encoding, the 411 errors is present from that application also when
sending data to Tomcat Server.

Thanks,
Jeff

Reply via email to