1

我正在尝试调用端点超出 https 的外部 Web 服务。

我们正在尝试使用 JAX-WS(Java EE 6 的 Oracle 标准实现)进行调用。

从 SoapUI 设置代理后它可以正常工作,但是从我们的代码中我们得到这个堆栈跟踪:

[11/13/12 12:46:55:389 CET] 00000024 SystemErr R javax.xml.ws.WebServiceException: java.net.ConnectException: Connection timed out: no further information
[11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:175)
[11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
[11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:128)
[11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:586)
[11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.doInvoke(AxisInvocationController.java:130)
[11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.core.controller.impl.InvocationControllerImpl.invoke(InvocationControllerImpl.java:93)
[11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:364)
[11/13/12 12:46:55:405 CET] 00000024 SystemErr R at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:185)

我们不知道为什么我们会获得连接超时,因为从 SoapUI 一切正常......

这是我们正在使用的代码:

ResultBlock rb = null;
Matching stub=new Matching();
MatchingSoap soapPort = stub.getMatchingSoap();
BindingProvider provider = (BindingProvider) soapPort;
Map<String, Object> context = provider.getRequestContext();
if(!"".equals("cvsa"))//Conf.getPROXY_URL()
{
    System.getProperties().get("http.proxyPort");
    //Authenticator.setDefault(new ProxyAuthenticator("user", "password")); 
    System.getProperties().put("proxySet", "true");
    System.setProperty("http.proxyHost", "proxy.xxxxx.xxxx.xx"); 
    System.setProperty("http.proxyPort", "3128"); 
}
context.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "https://xxx.xxx.xxx.xxx/OnlineMatchingCore/OnlineMatching.asmx" );
//context.put(JAXWSProperties.HTTP_CLIENT_STREAMING_CHUNK_SIZE, 8192);
System.out.println(provider.getEndpointReference().toString());
// Authenticator.setDefault(new ProxyAuthenticator("USER", "PASSWORD"));


// Security.setProperty("ssl.SocketFactory.provider", "com.ibm.jsse2.SSLSocketFactoryImpl");
// Security.setProperty("ssl.ServerSocketFactory.provider", "com.ibm.jsse2.SSLServerSocketFactoryImpl");

String result = soapPort.match(controlXml, batchXml, "USER", "PASSWORD");

我在网上看到很多关于此类问题的帖子,但我找不到任何解决方案:

我不知道该尝试什么,我的想法是我遗漏了一些关于告诉 java web 服务在 https 上的东西......

4

1 回答 1

0

您是否尝试设置 https 代理,而不是 http 代理?

System.setProperty("https.proxyHost", "proxy ip");
System.setProperty("https.proxyPort", "port");
于 2013-11-15T15:38:56.753 回答