嗯,问题是我们正在使用Axis1来使用基于wsdl的webservice,当WSDL所在的URL使用普通的旧HTTP连接时可以正常工作,但是当它使用SSL安全连接时,它会在Axis1时带来ConnectionException尝试下载WSDL文档内容。
即使阅读关于XMLUtils.class的评论,Axis开发人员甚至不确定它是否可以与HTTPS一起使用,因为它在第810行读取。
有什么方法可以解决这个问题吗? Whe试图在计算机上安装证书,在... jre7 / lib / security / cacerts上并尝试信任所有证书,但问题仍然存在......
提前致谢。
编辑:
您可以使用以下代码重现Exception:
InputSource source = new InputSource(urlWSDL);
DocumentBuilder db = DocumentBuilderFactoryImpl.newInstance().newDocumentBuilder();
Document doc = (Document) db.parse(source);
例外是:
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.BaseSSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(Unknown Source)
at java.net.URL.openStream(Unknown Source)
at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
答案 0 :(得分:1)
问题是公司代理,所以我附上了:
System.setProperty("https.proxySet", "true");
System.setProperty("https.proxyHost", this.getConfiguracionProxy().getUrlProxy());
System.setProperty("https.proxyPort", this.getConfiguracionProxy().getPuertoProxy());
要:
System.setProperty("http.proxySet", "true");
System.setProperty("http.proxyHost", this.getConfiguracionProxy().getUrlProxy());
System.setProperty("http.proxyPort", this.getConfiguracionProxy().getPuertoProxy());
我找到了解决Wireshark的解决方案。当我在SoapUI或Web浏览器上获取文件时,IP不是我们的应用程序使用的IP(真正的IP)。然后我意识到我是代理人的背后。
我从未使用过Wireshark ......我学到了很多东西,这是一件好事。
这将存储的代理配置设置为系统属性。
谢谢大家。