0

I'm trying to disable chunked transfer encoding with HTTP 1.1 on Axis2. I've edited the axis2.xml and commented out the relevant parameter line, but it is still responding chunked.

axis2.xml:

<transportSender name="http"
                 class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
    <parameter name="PROTOCOL">HTTP/1.1</parameter>
    <!-- <parameter name="Transfer-Encoding">chunked</parameter> -->
</transportSender>

I've then stopped and restarted Tomcat, but it is still returning with the following headers:

HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 10 Jun 2014 21:18:44 GMT

This is on localhost; I'm using OS X Mavericks, with Tomcat 7.0.53 and Axis2 1.6.2.

I've even tried setting the protocol to HTTP/1.0, but the response still returns 1.1. It's like the parameters are being ignored.

I need this to work using server changes; these services are not being consumed by an Axis2 client, so I'm not able to use options.setProperty(HTTPConstants.CHUNKED, "false"); on the client.

codebaboon
  • 57
  • 1
  • 5
  • possible duplicate of [Problem turning HTTP Chunking off in AXIS2](http://stackoverflow.com/questions/271665/problem-turning-http-chunking-off-in-axis2) – Kenster Jun 10 '14 at 21:36
  • It's the same issue, but they didn't find a solution in that question. – codebaboon Jun 10 '14 at 22:58

1 Answers1

1

we were able to disable chunked transfer on the client side with code like this:

Options options = new Options();
options.setProperty(HTTPConstants.CHUNKED, "false");
this.getStub()._getServiceClient().setOverrideOptions(options);

Of course the "this.gesStub()" method is our own helper method to get the generated stub object. It was important to use the setOverflowOptions instead of the setOptions method.