如何禁用多部分流式Apache CXF

我正在使用cxf JaxWsProxyFactoryBean客户端。我想从客户端禁用多部分流。为了达到目标,我应该调整哪些属性。

我尝试将chunked设置为false 但不确定如何检查流媒体是否已禁用。

这是我的代码:

     Map<String,List<String>> head = getTransmissionHeaders();
     JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();

     ........... 

     org.apache.cxf.endpoint.Client yclient = (org.apache.cxf.endpoint.Client) factory.create();

     ..................

    Map<String,Object> ycontext = yclient.getRequestContext();
    ycontext.put(MessageContext.HTTP_REQUEST_HEADERS,head);

    ...............

    private Map<String,List<String>> getTransmissionHeaders() {
                  Map<String,List<String>> head = new HashMap<>();
                  head.put(HttpHeaderHelper.accEPT_ENCODING,Arrays.asList("gzip","deflate"));
                 head.put(HttpHeaderHelper.CHUNKED,Arrays.asList("false"));
                 return head;
          }
qgf204 回答:如何禁用多部分流式Apache CXF

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3155434.html

大家都在问