Hi all,
I have three web services to be accessed from my machine. The first two are located on a node that is connected to same LAN that my machine is connected on. And the third one is reachable over the internet and is used to send SMS messages.
In order to reach the third message, I have to set the http proxy settings for the web service client using the following code:
System.setProperty("http.proxySet", "true");
System.setProperty("http.proxyHost", myProxyIP);
System.setProperty("http.proxyPort", myProxyPort);
{code}
Whereas the first two services doesn't need this proxy setting because they're already reachable on the network.
My problem is as follows:
If I call one of the first two services (with no proxy setting) and then call the third one (with proxy setting), then everything works fine, and any subsequent calls to any of the three services works perfectly.
On the other hand, if I call the third service first (the one with the proxy setting), and then call one of the other two, the Axis client tries to call these services with the same proxy setting, even if I remove the proxy setting from the System properties and AxisProperties:
{code:java}
System.setProperty("http.proxySet", "false");
System.getProperties().remove("http.proxyHost");
System.getProperties().remove("http.proxyPort");
AxisProperties.setProperty("http.proxyHost", null);
AxisProperties.setProperty("http.proxyPort", null);
{code}
The problem in this case is that if the proxy server is unavailable for any reason, I can't access the other two services because the proxy setting is stuck somehow in the Axis Engine instance. So eventually I'm getting this exception:
{code:java}
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.net.UnkownHostException: <MyProxyServer>
{code}
Is there a way to resolve this?