【发布时间】:2015-07-10 10:28:39
【问题描述】:
我需要在服务器端的 cxf webservice 中禁用分块,因为某些客户端需要“Content-Length”标头作为响应。现在我可以看到“传输编码”在服务器响应中被“分块”并且没有发送“内容长度”标头。
我发现在 spring 的上下文中可以像这样禁用 chunkins:
<http-conf:conduit name="*.http-conduit">
<http-conf:client ReceiveTimeout=“300000“ AllowChunking="false"/>
</http-conf:conduit>
因为我像这样以编程方式创建服务:
// media service
Object mediaService = new MediaService();
System.out.println("Starting media service #1 ...");
EndpointImpl mediaEP = (EndpointImpl)Endpoint.create(mediaService);
mediaEP.publish("http://localhost:8081/onvif/media_service");
我该怎么做?
【问题讨论】:
-
我一直通过 API 为 CXF 客户端通过
WebClient.getConfig(client).getHttpConduit()执行此操作,但我对 EndPoint 或 Service CXF 实现类都一无所知。为这个问题 +1。 -
不幸的是,我能够找到客户端的链接,但找不到服务器端的链接
标签: web-services cxf