APACHE CXF无法发送引起的消息:java.net.socketException:连接重置



我正在运行tomcat服务器并尝试消耗.net soap ws。使用apache.cxf。

.net WS的侧面有群集,当重新启动在其中一台机器上执行时,我会得到

javax.xml.ws.WebServiceException: Could not send Message.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:148)
...
Caused by: java.net.SocketException: Connection reset

为了避免这种情况,我想使用Connection =仅用于此WS的关闭标头。

所以,在创建肥皂消息时,我发送

HTTPConduit conduit = (HTTPConduit) iMyFlowWSClient.getConduit();
    conduit.getClient().setConnection(ConnectionType.CLOSE);

我在Wireshark上看到标头获得正确的值:

Connection: closern

但是,当第一次调用WS(看起来像XSD的导入)时,请通过Java.xml.ws.service的contractor对WSDL URL进行初始化:

protected Service(java.net.URL wsdlDocumentLocation, QName serviceName) {
    delegate = Provider.provider().createServiceDelegate(wsdlDocumentLocation,
            serviceName,
            this.getClass());
}

我在Wireshark上看到下一个标题:

Hypertext Transfer Protocol
    GET /MyFlow.svc?wsdl HTTP/1.1rn
    Content-Type: text/xmlrn
    Accept: */*rn
    User-Agent: Apache CXF 3.0.0rn
    Cache-Control: no-cachern
    Pragma: no-cachern
    Host: 123.123.12.34rn
    Connection: keep-alivern
    rn
    [Full request URI: http://123.123.12.34/MyFlow.svc?wsdl]

,我相信与WS的这种联系使

的这种联系

是否有任何解决方案可以配置apache.cxf标头要发送连接= CLOSS ON ALL 在HTTP级别执行的请求?

否,在我看来,您只能减少问题而不是消除问题。这个问题似乎在.net方面。关闭连接是不正确的。

最新更新