aspose file tools*
The moose likes Web Services and the fly likes Axis HTTP Proxy Settings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Axis HTTP Proxy Settings" Watch "Axis HTTP Proxy Settings" New topic
Author

Axis HTTP Proxy Settings

Nadeem Awad
Ranch Hand

Joined: Jan 09, 2005
Posts: 74
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:


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:


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:


Is there a way to resolve this?


Share Knowledge to gain it.<br /> <br />SCJP 1.2, SCDJWS 1.4, SCWCD 1.4, SCBCD 1.3, ICAD
Nadeem Awad
Ranch Hand

Joined: Jan 09, 2005
Posts: 74
Anyone?
Nadeem Awad
Ranch Hand

Joined: Jan 09, 2005
Posts: 74
I found out that it's an old bug in Axis, and it seems that there's no workaround for it.

http://issues.apache.org/jira/browse/AXIS-2295

It seems that I need to upgrade to Axis2, or find another WS provider.

Regards,
Mark Amabile
Greenhorn

Joined: Jul 27, 2011
Posts: 3
There is a workaround to this issue for this old Axis version.

You set up all your connections as you would for a Proxy connection. (including non proxy connections)
But the trick is .. you also set the nonProxyHost variable... see below.
This test is using SSL (https).

AxisProperties.setProperty("https.proxyHost", "bla1.bla1");
AxisProperties.setProperty("https.proxyPort", "8080");
AxisProperties.setProperty("https.nonProxyHosts", "bla.bla.com");

This would work.. we are using this fix.

That link in the prev post would also work .. but the issue is it's static -- and therefore, if two connections hit at the same time -- it would not work.
I believe the above would work in all cases -- or upgrade to Axis 2 (which was not an option for us).

Sankalp Dam
Greenhorn

Joined: Jan 17, 2013
Posts: 13
Mark Amabile wrote:There is a workaround to this issue for this old Axis version.

You set up all your connections as you would for a Proxy connection. (including non proxy connections)
But the trick is .. you also set the nonProxyHost variable... see below.
This test is using SSL (https).

AxisProperties.setProperty("https.proxyHost", "bla1.bla1");
AxisProperties.setProperty("https.proxyPort", "8080");
AxisProperties.setProperty("https.nonProxyHosts", "bla.bla.com");

This would work.. we are using this fix.

That link in the prev post would also work .. but the issue is it's static -- and therefore, if two connections hit at the same time -- it would not work.
I believe the above would work in all cases -- or upgrade to Axis 2 (which was not an option for us).



I have the same issue> I am using two webservice.One that i need to connect to Proxy server is secured over HTTPS while the one that i need to access locally is over HTTP on a particular port

I want to connect to internal wothout using proxy
So if I write Awould it bypass my http webserice or should I write
Sankalp Dam
Greenhorn

Joined: Jan 17, 2013
Posts: 13
Just to correct my above typo error : Its not but
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Axis HTTP Proxy Settings