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) 展开
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) 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询