简体   繁体   English

TimeOut使用Axis 2 / JBoss Ws调用WebServices

[英]TimeOut calling WebServices with Axis 2/JBoss Ws

I have a problem calling a Webservice with Axis2. 我在使用Axis2调用Web服务时遇到问题。 I have done in cxf without any problem, so i know that the service is responding. 我已经在cxf中完成了没有任何问题,所以我知道该服务正在响应。 But, because of problems with the compatibility between Jboss 6 and CXF, i need to do in another tech. 但是,由于Jboss 6和CXF之间的兼容性问题,我需要在另一种技术中做。 (I am trying to migrate to Jboss 7, where there isnt any problem, but boss don't want at this moment). (我正在尝试迁移到Jboss 7,那里没有任何问题,但老板此时并不想要)。

So, the request in cxf is going perfect. 所以,cxf中的请求是完美的。 When i try in Axis2 doesn't work. 当我尝试在Axis2不起作用。 I suppose that i am not doing something good, some configuration that cxf do itself and no Axis2. 我想我没有做好事,有些配置是cxf自己做的,没有Axis2。

I have this error in axis2: 我在axis2中有这个错误:

Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
at java.net.SocketInputStream.read(SocketInputStream.java:170)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at sun.security.ssl.InputRecord.readFully(InputRecord.java:465)
at sun.security.ssl.InputRecord.read(InputRecord.java:503)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:973)
at sun.security.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:930)
at sun.security.ssl.AppInputStream.read(AppInputStream.java:105)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
at java.io.BufferedInputStream.read(BufferedInputStream.java:265)
at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:621)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)

In the project that works, made in cxf, if i change the call, putting with the Jboss6 runtime and remove the cxf library (2.7.18), with the same code, i get this error: 在cxf中工作的项目中,如果我更改了调用,使用Jboss6运行时并删除cxf库(2.7.18),使用相同的代码,我会收到此错误:

Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:422)
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:460)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:863)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:820)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:258)
at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:698)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:641)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1218)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:379)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:318)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:2223)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:2192)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:2036)
... 12 more

Very similar. 非常相似。

In axis 2 i try changing the protocol to 1.0, but the error persist. 在轴2中,我尝试将协议更改为1.0,但错误仍然存​​在。

org.tempuri.RldServiceStub stub = new org.tempuri.RldServiceStub();
    org.tempuri.RldServiceStub.InsertarDocumento insertarDocumento40 = (org.tempuri.RldServiceStub.InsertarDocumento) getTestObject(org.tempuri.RldServiceStub.InsertarDocumento.class);

    stub._getServiceClient().getOptions().setUserName("b3e4af71-ff47-4451-88d5-1afcf9fb0412");
    stub._getServiceClient().getOptions().setPassword("CcVAx5yxL5fC80bw7SAQBMTfXWvEp1YI/sO2YYyJQm4=");
    stub._getServiceClient().getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_PROTOCOL_VERSION, org.apache.axis2.transport.http.HTTPConstants.HEADER_PROTOCOL_10);

I am too lost in this issue. 我在这个问题上太迷茫了。

You have to know that Apache Axis is not supported as a Web Service Stack on JBoss EAP. 您必须知道JBoss EAP上不支持Apache Axis作为Web服务堆栈。 It is recommended to use the WS implementation bundled with your current JBoss EAP. 建议使用与当前JBoss EAP捆绑在一起的WS实现。 To be specific, for JBoss EAP 6 is JBossWS Apache CXF. 具体来说,JBoss EAP 6是JBossWS Apache CXF。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM