用Java实现Cvent WSDL

时间:2018-07-06 20:26:22

标签: java ssl soap wsdl

我目前正在尝试用Java实现CVENT WSDL-

我正在使用Eclipse-

我已经使用给定的WSDL地址创建了一个WebService客户端,并使用Axis自动生成了代码。  (尝试删除捕获)

   V200611Locator locator = new V200611Locator(); 
   V200611Soap binding = locator.getV200611Soap();
   V200611SoapStub stub = (V200611SoapStub) binding;
   LoginResult lr = stub.login("Account", "User", "Password");

从那里开始尝试Stub就会给我一个连接错误。

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.connect0(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.security.ssl.SSLSocketImpl.connect(Unknown Source)
   at sun.security.ssl.SSLSocketImpl.<init>(Unknown Source)
   at sun.security.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source)
   at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:92)
   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)
   at com.cvent.api._2006_11.V200611SoapStub.login(V200611SoapStub.java:3621)
   at wsdlTest.main(wsdlTest.java:46)

   {http://xml.apache.org/axis/}hostname:COMPUTERNAME

对于此Connection异常,我尝试扩展存根上的超时值

stub.setTimeout(600000);

并修改

System.setProperty。 //修改运行参数

我知道我可以访问WSDL(通过IP白名单),因为我可以访问WSDL /进行Powershell调用

Cvent developer notes

1 个答案:

答案 0 :(得分:1)

此问题花了很长时间才弄清-安全设置阻止我访问 Window-> Preferences-> General-> Network Connection 中的WSDL和Proxy设置用于Eclipse应用程序(我猜)。要建立连接,我必须在应用程序中手动设置代理设置。

System.setProperty("http.proxyHost",host);
System.setProperty("http.proxyPort",port);

此问题是-Web Service Client - Construction Failing Due To Timeout (Proxy Issue)

的重复

对我来说,Web服务实际上构建得很好-存根方法会超时。

如果您遇到类似的问题-

尝试从Web浏览器访问WSDL-如果可以访问WSDL,请进入高级网络设置以获取HOST和PORT代理设置。

如果无法从Web浏览器访问它,则可能是防火墙出现问题(您可能需要Cvent将IP列入白名单)。