Web服务客户端-超时构建失败(代理问题)

Web Service Client - Construction Failing Due To Timeout (Proxy Issue)

我在 Java 1.6 中有一个扩展 javax.xml.ws.Service 的网络服务。 WSDL URL 位于 HTTPS 端点,我在公司代理后面(我相信是 NTLM)。我有代理主机、端口、用户名和密码。如果我在我的 .curlrc 文件中指定代理,我已经验证我可以使用 curl 访问 WSDL。当调用构造函数时,它最终会超时并出现错误:

javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://www.blah.com/myservice.asmx?wsdl. It failed with: Connection timed out.

调用失败的是:

public MyService_Service() {
    // this call to super is the one that times out
    super(__getWsdlLocation(), MYSERVICE_QNAME);
}

我尝试了以下方法,但 none 的解决方案有效。

如何从代理后面调用 Web 服务?

我能够通过在服务器实例化之前添加以下代码来实现它:

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

奇怪的是,当我通过设置 VM 选项 -DproxyHost-DproxyPort 对其进行测试时,它起作用了,然后搜索如何以编程方式设置它。