調用Axis Webservice異常: java.net.ConnectException: Connection timed out: connect


5/7 更新:網絡問題。。。端口不通,然后換了另一個內網。。。


 

對方有一個測試庫和一個正式庫,ip地址不一樣,用的是同一個wsdl文件(不知道會不會有問題,但對方說是同一個wsdl文件)。對方的正式庫也有別人在調用,應該不會有問題。

wsdl文件里下面的ip地址與測試庫或正式庫的ip都不一樣。

<wsdl:service name="XXXService">
<wsdl:port binding="tns:XXXServiceServiceSoapBinding" name="XXXServiceSOAP">
<soap:address location="http://xxx.xxx.xx.xx:8088/ws/XXXService"/>
</wsdl:port>
</wsdl:service>

測試庫的ip無法ping通,但是webservice調用成功。

正式庫可以ping通,但是webservice調用出現異常,connect time out.

測試庫的wsdl在瀏覽器訪問提示有錯:

This page contains the following errors:

error on line 1 at column 1: Document is empty
Below is a rendering of the page up to the first error.

而正式庫的wsdl文件在瀏覽器里打不開。

對方說是做了處理,不讓其他的人訪問,所以我們要調用就給了一個wsdl文件。

客戶端是直接在eclipse里通過wsdl文件生成的。調用方法如下:

String endpoint = "XXXService";
XXXServiceProxy proxy = new XXXServiceProxy(endpoint);
try{
    String result = proxy.request();
    System.out.println(result);
}catch(RemoteException e){
    e.printStackTrace();      
}

測試庫和正式庫只有endpoint里webservice地址的ip不同。

異常如下:

---------------------------------------------------------------------

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode: 
faultString: java.net.ConnectException: Connection timed out: connect
faultActor: 
faultNode: 
faultDetail: 
{http://xml.apache.org/axis/}stackTrace:java.net.ConnectException: Connection timed out: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
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 org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:153)
at org.apache.axis.components.net.DefaultSocketFactory.create(DefaultSocketFactory.java:120)
at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM