codebaboon
codebaboon

Reputation: 67

Axis2 - Disable Chunked Transfer Encoding in axis2.xml

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.

Upvotes: 0

Views: 4033

Answers (1)

user4578241
user4578241

Reputation: 11

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.

Upvotes: 1

Related Questions