简体   繁体   English

Java中的客户端Web服务-代理身份验证

[英]Client Webservice in java - proxy authentication

I have made a web service client importing a third party wsdl in eclipse. 我已经使一个Web服务客户端在Eclipse中导入第三方wsdl。

But I got this exception: 但是我有一个例外:

javax.xml.ws.WebServiceException: Connection IO Exception. Check nested exception for details. (Unable to connect to 1X.XXX.X.XX:X0 - Connection timed out). 

I hope this exception occurred for the proxy only. 我希望此异常仅发生在代理服务器上。

There is a proxy server between me and that third party. 我和该第三方之间有一个代理服务器。 I don't know how to do the proxy authentication and where in coding I need to this proxy authentication. 我不知道如何进行代理身份验证,以及在编码中需要此代理身份验证的位置。

Is your end point on HTTPS? 您是HTTPS的终点吗? There different ways proxies support HTTPS - one ways is SSL bridging and the other is SSL Tunneling.. 代理支持HTTPS的方式不同-一种方式是SSL桥接,另一种方式是SSL隧道。

May be your client side libraries you used to connect may not support the one being used by the proxy... 可能是您用来连接的客户端库可能不支持代理使用的库...

You must explicitly set the proxy server in Java, the JRE does not retrieve it from the OS configuration. 您必须使用Java显式设置代理服务器,JRE不会从OS配置中检索它。 You can find the detailed explanation here . 您可以在此处找到详细说明。 As per the link, a standard configuration may look like this: 按照链接,标准配置可能如下所示:

System.setProperty("http.proxyHost", "myproxy.com");
System.setPropery("http.proxyPort", "8080");

Obviously, you can also define the system properties as VM arguments during startup. 显然,您还可以在启动期间将系统属性定义为VM参数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM