org.apache.axis2.AxisFault: Read timed out

sinkiangscorpio 2009-06-26 12:48:21
1、wsdl2java -s -Etypesystemname qqOnlineWebService -uri http://www.webxml.com.cn/WebServices/MobileCodeWS.asmx?wsdl -Etypesystemname -t
生成一个MobileCodeWSStub.java文件,还有MobileCodeWSTest.java.
结果MobileCodeWSTest运行的时候报错如下,该怎么解决。
部分代码如下:
public void testgetMobileCodeInfo() throws java.lang.Exception{

cn.com.webxml.MobileCodeWSStub stub =
new cn.com.webxml.MobileCodeWSStub();//the default implementation should point to the right endpoint

cn.com.webxml.MobileCodeWSStub.GetMobileCodeInfo getMobileCodeInfo6=
(cn.com.webxml.MobileCodeWSStub.GetMobileCodeInfo)getTestObject(cn.com.webxml.MobileCodeWSStub.GetMobileCodeInfo.class);
// TODO : Fill in the getMobileCodeInfo6 here
getMobileCodeInfo6.setMobileCode("13621778722");
getMobileCodeInfo6.setUserID("");
assertNotNull(stub.getMobileCodeInfo(
getMobileCodeInfo6));
}
这个问题如何解决
org.apache.axis2.AxisFault: Read timed out
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:193)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:75)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:371)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:209)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:448)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:401)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at cn.com.webxml.MobileCodeWSStub.getMobileCodeInfo(MobileCodeWSStub.java:319)
at cn.com.webxml.MobileCodeWSTest.testgetMobileCodeInfo(MobileCodeWSTest.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at junit.framework.TestCase.runTest(TestCase.java:168)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:79)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(Unknown Source)
at java.io.BufferedInputStream.fill(Unknown Source)
at java.io.BufferedInputStream.read(Unknown Source)
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.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:542)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:189)
... 28 more
...全文
3172 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
coolben 2011-09-21
  • 打赏
  • 举报
回复
搞定了吧?
KeroroCatboy 2009-07-05
  • 打赏
  • 举报
回复
设置超时:stub._getServiceClient().getOptions().setTimeOutInMilliSeconds(毫秒数);

也有可能是服务自身超时而无法返回数据的异常。。

试试在服务端做异常获取。。。
sinkiangscorpio 2009-07-03
  • 打赏
  • 举报
回复
http://www.webxml.com.cn/WebServices/MobileCodeWS.asmx?op=getMobileCodeInfo
这个链接可以工作的
yztommyhc 2009-07-02
  • 打赏
  • 举报
回复
会不会是那边的服务挂掉了呢?
sinkiangscorpio 2009-07-02
  • 打赏
  • 举报
回复
怎么排查服务调用超时问题
lcb521 2009-07-01
  • 打赏
  • 举报
回复
你排查下 是不是服务调用超时问题。
sinkiangscorpio 2009-07-01
  • 打赏
  • 举报
回复
不会吧,一个人都没有回答,唉

67,512

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧