javax.xml.ws.WebServiceException:异常捕获的问题

调用连接不上webservice时抛出异常,try{wsrpcClientwsrpcc=newwsrpcClient("http://10.1.1.12:9089/Dat... 调用连接不上webservice 时抛出异常,
try{
wsrpcClient wsrpcc = new wsrpcClient(
"http://10.1.1.12:9089/DataWebservice/wsrpc?WSDL", "test");
}catch (Exception e) {
System.out.println("aaaaaaaaaaaaaaaaaaaaa");
System.out.println("调用查询失败:"+e.getMessage());
this.setAlert("调用查询失败:"+e.getMessage());
}finally{
System.out.println("Program is end!");
}
这样做捕获不到异常,请问各位大神们,怎么捕获或者处理这类异常?

Failed to access the WSDL at: http://10.1.1.12:9089/DataWebservice/wsrpc?WSDL. It failed with:
Connection timed out: connect.
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:136)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:122)
at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:226)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:189)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:159)
at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:83)
at javax.xml.ws.Service.<init>(Service.java:56)
at xdja.hxd.wsrpc.wsrpcclient.WsrpcService.<init>(WsrpcService.java:37)
at xdja.hxd.wsrpc.wsrpcClient.ExecuteQuery(wsrpcClient.java:91)
at com.xdja.nycgs.service.WFWS.getFXCWF(WFWS.java:32)
at com.xdja.nycgs.service.WFWS.main(WFWS.java:177)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
展开
 我来答
百度网友8a0ff05
2013-04-26 · TA获得超过130个赞
知道小有建树答主
回答量:328
采纳率:0%
帮助的人:169万
展开全部
在catch模块里面添加一句e.printStackTrace();试试
追问
打印到后台吗?没用的。就算不让输出后台它也会在后台抛出错的,关键是捕获不到这个异常,我只记得捕获远程webservice的异常需要异常序列化,可是具体还是不太明白。。。。
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式