Skip to main content
Summary Why Artix JAX-WS does not include Content-Length header in its SOAP messages?
Article Number 15620
Environment All Supported Operating Systems Artix 5.x Artix JAX-WS Runtime
Question/Problem Description Why Artix JAX-WS does not include Content-Length header in its SOAP messages?
When Artix includes Content-Length header in its SOAP messages?
Clarifying Information
Error Message
Defect/Enhancement Number
Cause
Resolution

Artix 5.5 (and CXF) includes the content length of SOAP messages if the client does not request "closure" of the TCP connection upon reply. This helps the client un-marchalling the message from the TCP buffer, when the buffer includes more than one HTTP message.

However, Artix and CXF do not include the "content-length" header in their reply messages if the client sets the HTTP header "connection:close" in its request.

According to the HTTP1.1 specification, an HTTP 1.1 server is not required to include the content length of the message when the client sets the http header "connection" to close.
Section 14.13 about "Content-Length" in http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html states that "...Applications SHOULD use this field to indicate the transfer-length of the message-body, UNLESS this is prohibited by the rules in section 4.4<http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4>. "

And in bullet #5 of 4.4 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.4), it states "By server closing the connection" on the response is one of such rules that Content-Length is not required.

This statement demonstrates that Content-Length header is not required on server closing a connection connection when the client is known to be HTTP 1.1 compliant.

Workaround
Notes
Attachment
Created date: 06 September 2011
Last Modified: 13 February 2013
Last Published: 23 June 2012
First Published date: 09 September 2011

#Orbix
#KnowledgeDocs