I wrote code to communicate with a non-public webservice and everything seemed to work even when connecting via proxy. The problem started after changing to proxy with authorization. I get the following warning:
WARN [HttpMethodDirector] Required credentials not available for BASIC <any realm>@destination.url.com:80
WARN [HttpMethodDirector] Preemptive authentication requested but no default credentials available
After which an exception is thrown: java.net.SocketTimeoutException: Read timed out
"destination.url.com" is the destination address, so I guess I went past the proxy.
I read somewhere on stackoverflow that this warning is usually thrown when passing in a username/password when don't need to. I don't know if it's true. Using HttpProxy to connect to a host with preemtive authentication
Also here some guys point the same problem, but reproducible by running through a non-authenticated proxy to an authenticated remote repository. My situation is the opposite. The destination doesn't require authorization (the authorization data are put into the body of SOAP messages). https://www.jfrog.com/jira/browse/RTFACT-4147
Any ideas how to help my situation? Here is some of my code:
MyStub stub = new MyStub();
Options Options = stub._getServiceClient().getOptions();
Options.setProperty(org.apache.axis2.Constants.Configuration.CHARACTER_SET_ENCODING,"utf-8");
Options.setProperty(org.apache.axis2.Constants.Configuration.ENABLE_SWA,org.apache.axis2.Constants.VALUE_FALSE);
HttpTransportProperties.ProxyProperties proxyProperties = new HttpTransportProperties.ProxyProperties();
proxyProperties.setProxyName("proxyAddress");
proxyProperties.setProxyPort("proxyPort");
proxyProperties.setUserName("proxyUsername");
proxyProperties.setPassWord("proxyPassword");
Options.setProperty(org.apache.axis2.transport.http.HTTPConstants.PROXY,proxyProperties);
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.CHUNKED, Boolean.FALSE);