Disable chunked transfer-encoding for JAX-WS Client in Wildfly 8

纵饮孤独 提交于 2021-01-29 05:58:24

问题


I'm writing a SOAP client using JAX-WS on Wildfly 8.

When sending small messages to my server, the client works properly. When the message gets too large, a header "Transfer-Encoding: chunked" gets added and the server stops accepting the messages.

Since I have no control over the server-part, I'm looking for a way to tell Wildfly to stop chunking large messages.

I've found a solution for WebSphere here: Disable chunked transfer-encoding for JAX-WS Client in WebSphere Application Server 8.5

I've configured a Handler. I've verified that this handler is called with each outgoing request. It looks like this:

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

Since I'm using Wildfly, and not WebSphere, I don't have HTTPConstants.CHUNKED on my classpath. Does anyone know what I could use to tell Wildlfy to stop chunking messages? Is this even possible by using a handler?


回答1:


As far as I know, the client is not entitled to use or not use HTTP chunking. The client is supposed to accept both, and the final decision is made on the server-side.

It's important to understand the the chunking is not a format but a transfer encoding. It sounds quite natural to let the server choose the best way to transfer large data (zipping is a possible option, chunking is another one)...

See HTTP 1.1 - Can a client request that transfers not be "chunked"?



来源:https://stackoverflow.com/questions/52000026/disable-chunked-transfer-encoding-for-jax-ws-client-in-wildfly-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!