1

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

我尝试设置chunkedfalse 但不确定如何检查流媒体是否已被禁用。

这是我的代码:

     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;
          }
4

0 回答 0