I had to update a previous Java application that requests a SOAP response from an external web service. This service is located outside of our firewall, which now requires a proxy server from us instead of a direct URL.
Currently, a Java application uses URLEndpoint, which takes a string for a URL. Usually, when I get the URL through a proxy, I create the following URL:
URL url = new URL("http", "theproxy.com", 5555, finalUrl);
The problem is that URLEndpoint only accepts a string for url, I tried to convert the url to string using toExternalForm (), but it distorted the url.
Any ideas on this?
EDIT: I cannot use System.setProperty as it works with a whole bunch of other Java applications in tomcat.
second edit: I cannot set the system properties, since it will override all other applications running on the server, I cannot use jsocks as a proxy server, which we run through a squid proxy that does not support socks4 / 5
Any help was appreciated.
Rudiger
source share