I have a webservice in Java 1.6 that extends javax.xml.ws.Service
. The WSDL URL is located at an HTTPS endpoint and I am behind a corporate proxy (NTLM I believe). I have the proxy host, port, username, and password. I have verified that I can access the WSDL using curl
if I specify the proxy in my .curlrc
file. When the constructor is called it will eventually timeout with the error:
javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://www.blah.com/myservice.asmx?wsdl. It failed with: Connection timed out.
The call that fails is:
public MyService_Service() {
// this call to super is the one that times out
super(__getWsdlLocation(), MYSERVICE_QNAME);
}
I have tried the following but none of the solutions work.
What can I do to call the web service from behind a proxy?
I was able to get this to work by adding the following code before the server instantiation:
Strangely this worked when I tested it by setting the VM options
-DproxyHost
and-DproxyPort
so then searched for how to set it programmatically.