1

In a web application that runs on top of IBM WebSphere Application Server (WAS) V8.5.5.11, there is a JAX-WS client piece (using WAS built-in JAX-WS component) that calls an external web service.

For any web service call with an HTTP body larger than 32 KB, WAS will use chunked transfer-encoding. Unfortunately, the external web service cannot handle chunked transfer encoding, and will error out.

How do I disable chunked transfer-encoding within WAS JAX-WS client code?

thebat
  • 2,029
  • 4
  • 21
  • 30

3 Answers3

1

You need to create a SOAP JAX-WS handler and override the handleMessagemethod to add an http header like this:

public boolean handleMessage(SOAPMessageContext smc) {
  ctx.put(HTTPConstants.CHUNKED, "false");
  return true;
}

That's easy, it's a matter of creating a class for the handler and a simple xml file to declare it Check https://jax-ws.java.net/articles/handlers_introduction.htmlor http://www.mkyong.com/webservices/jax-ws/jax-ws-soap-handler-in-client-side/

titou10
  • 2,814
  • 1
  • 19
  • 42
  • 1
    I've already tried this approach. But in IBM WebSphere App Server's JAX-WS implementation, there is no `HTTPConstants.CHUNKED`, and I couldn't find a counterpart either. – thebat Apr 22 '17 at 15:01
  • WAS v8.5.5 JAX-WS implementation is Axis2.. so `ctx.put("__CHUNKED__", "false");`may work as `HTTPConstants.CHUNKED="__CHUNKED__"` – titou10 Apr 23 '17 at 16:01
  • I tried the line `ctx.put("__CHUNKED__", "false");`, and I've verified that this property is indeed set, but WAS seems to simply ignore it and it has no effect on the transfer encoding. – thebat Apr 24 '17 at 15:19
0

I couldn't find a way to programmatically disable chunked transfer encoding for the built-in JAX-WS of WAS 8.5.5.x. But I did find a way to disable it through WAS "Administrative Console".

Basically, you need to make a copy of "WSHTTPS default" policy set, and modify the "HTTP transport" policy to uncheck the box for "Enable chunked transfer encoding". Then assign this custom policy set to your service client.

Detailed instructions can be found at https://www.ibm.com/support/knowledgecenter/en/SSEQTP_8.5.5/com.ibm.websphere.nd.doc/ae/twbs_wsspspthttp.html

thebat
  • 2,029
  • 4
  • 21
  • 30
0

You can apply a policy set and choose to disable chunking. enter image description here

Bruce T.
  • 992
  • 4
  • 5