Yeah, thats correct.  For instance, if you configure Tomcat to use a chunked transfer encoding, it will send servlet responses to clients in chunks.  The content-length isn't really very useful as chunking it means you don't need to have your whole response in memory when you start the transmission, it can be streamed. 

It is very useful if you are sending large objects around such as files.

rp johns wrote:
Can someone elaborate on exactly what chunked means? I'm using axis1.4 so it's within that cointext that I'd like to  know. I mean, I can guess that it means transferring the data in chunks, rather than buffering it all in memory, which has obvious advantages for large scale data loads. Is this assumption correct? And if so, does the chunking comprehend attachments?

Thanks



Anthony Bull wrote:
The HTTP spec says that if you are using chunked encoding type, then content-length can not be used, so yes.

Its interesting because I used a generated client recently with a .NET service and by default the chunked encoding was turned off when I generated the client stub.

Doolittle, Todd wrote:
RE: No content length

I think I figured it out.  In the client stubs contstructor I turned off CHUNKED for the HTTP transport which now gives me a Content-Length header.

_serviceClient.getOptions.setProperty(HTTPConstants.CHUNKED, false);

 Was that the right way to do it?

      -----Original Message-----
      From: Doolittle, Todd
      Sent: Wednesday, September 20, 2006 9:51 AM
      To: [email protected]
      Subject: No content length


      I am trying to hit a public service (TerraService) with a client generated from last night’s Axis 2 build.  I believe the service is a ..NET service.  I created the client from the WSDL2JAVA tool based on the WSDL.  When I send a request, I get a fault back from the server stating that the Content-Length header is missing.  Using tcpmon, I checked and it does look like it is missing.  Is there some way to get Axis 2 to put the Content-Length header on the request?

      Here is the output from tcpmon:

      POST /TerraService2.asmx HTTP/1.1

      SOAPAction: http://terraservice-usa.com/ConvertPlaceToLonLatPt

      User-Agent: Axis2

      Host: terraservice-usa.com

      Transfer-Encoding: chunked

      Content-Type: text/xml; charset=UTF-8

      183

      <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap..org/soap/envelope/"><soapenv:Header /><soapenv:Body><ns1:ConvertPlaceToLonLatPt xmlns:ns1="http://terraservice-usa.com/"><ns1:place><ns1:City>Troy</ns1:City><ns1:State>Michigan</ns1:State><ns1:Country>USA</ns1:Country></ns1:place></ns1:ConvertPlaceToLonLatPt></soapenv:Body></soapenv:Envelope>

      0


      Here is the fault that was returned…

      Exception in thread "main" org.apache.axis2.AxisFault: HTTP Transport error : '411' - 'Length Required'; nested exception is:

              org.apache.axis2.AxisFault: HTTP Transport error : '411' - 'Length Required'; nested exception is:

              org.apache.axis2.AxisFault: HTTP Transport error : '411' - 'Length Required'; nested exception is:

              org.apache.axis2.AxisFault: HTTP Transport error : '411' - 'Length Required'

              at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:231)

              at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:641)

              at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:355)

              at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:285)

              at com.terraservice_usa.TerraServiceStub.ConvertPlaceToLonLatPt(TerraServiceStub.java:814)

              at GetLonLat.main(GetLonLat.java:25)

      Caused by: org.apache.axis2.AxisFault: HTTP Transport error : '411' - 'Length Required'; nested exception is:

              org.apache.axis2.AxisFault: HTTP Transport error : '411' - 'Length Required'

              at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:335)

              at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:210)

              ... 5 more

      Caused by: org.apache.axis2.AxisFault: HTTP Transport error : '411' - 'Length Required'

              at org.apache.axis2.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSender.java:141)

              at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:329)

              ... 6 more


This message, including any attachments, is the property of Sears Holdings Corporation and/or one of its subsidiaries. It is confidential and may contain proprietary or legally privileged information. If you are not the intended recipient, please delete it without reading the contents. Thank you.



-- 
------------------------------------- 
Anthony Bull
Senior Developer
Black Coffee Software Ltd
Level 13, Compudigm House,
49 Boulcott Street
PO Box 10-192 The Terrace
Wellington, New Zealand
 
[EMAIL PROTECTED]
Ph  +64 4 472 8818
Fax +64 4 472 8811
Mob +64 021 303 692
------------------------------------- 
www.bcsoft.co.nz
--------------------------------------------------------------- 
This email may contain confidential or privileged information, 
and is intended for use only by the addressee, or addressees. 
If you are not the intended recipient please advise the sender 
immediately and do not copy, use or disclose the contents to 
any other person or organisation.
Black Coffee Software Ltd accepts no responsibility for viruses 
received with this email, or to any changes made to the original 
content. Any views or opinions expressed in this email may be personal to the sender and are not necessarily those of Black 
Coffee Software Ltd.
---------------------------------------------------------------

  
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

-- 
rp johns
software factotum


-- 
------------------------------------- 
Anthony Bull
Senior Developer
Black Coffee Software Ltd
Level 13, Compudigm House,
49 Boulcott Street
PO Box 10-192 The Terrace
Wellington, New Zealand
 
[EMAIL PROTECTED]
Ph  +64 4 472 8818
Fax +64 4 472 8811
Mob +64 021 303 692
------------------------------------- 
www.bcsoft.co.nz
--------------------------------------------------------------- 
This email may contain confidential or privileged information, 
and is intended for use only by the addressee, or addressees. 
If you are not the intended recipient please advise the sender 
immediately and do not copy, use or disclose the contents to 
any other person or organisation.
Black Coffee Software Ltd accepts no responsibility for viruses 
received with this email, or to any changes made to the original 
content. Any views or opinions expressed in this email may be personal to the sender and are not necessarily those of Black 
Coffee Software Ltd.
---------------------------------------------------------------

--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to