| Author |
Accessing an internet web service from a secure LAN
|
David Brossard
Ranch Hand
Joined: Jun 03, 2004
Posts: 107
|
|
I'm currently developing web services and trying them out. I also try accessing external web services. However, although I can successfully reach and use an internal web service (on a server in my LAN), I can't reach outside web services. The operation fails. Does anyone know what I can do to access a web service (eg Capescience's weather service)? Thanks.
|
No matter what they say in Ohio, we're still first in flight!
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
|
The problem might be that you should use an HTTP proxy and your Java code doesn't do that. Which API are you using for the web service client?
|
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
David Brossard
Ranch Hand
Joined: Jun 03, 2004
Posts: 107
|
|
I tried using a proxy with the following code But then I get a 502 Bad Gateway error on both my local web services (which don't need the proxy anyway) and outside web services. I'm using org.apache.axis.client.Call and org.apache.axis.client.Service... Thanks for your help...
|
 |
Ian Murray
Greenhorn
Joined: Apr 15, 2004
Posts: 2
|
|
Originally posted by David Brossard: I'm currently developing web services and trying them out. I also try accessing external web services. However, although I can successfully reach and use an internal web service (on a server in my LAN), I can't reach outside web services. The operation fails. Does anyone know what I can do to access a web service (eg Capescience's weather service)? Thanks.
|
 |
Ian Murray
Greenhorn
Joined: Apr 15, 2004
Posts: 2
|
|
Originally posted by David Brossard: I'm currently developing web services and trying them out. I also try accessing external web services. However, although I can successfully reach and use an internal web service (on a server in my LAN), I can't reach outside web services. The operation fails. Does anyone know what I can do to access a web service (eg Capescience's weather service)? Thanks.
Try access through HTTP proxy - that should do it
|
 |
David Brossard
Ranch Hand
Joined: Jun 03, 2004
Posts: 107
|
|
I tried using a proxy with the following code code: -------------------------------------------------------------------------------- System.setProperty("http.proxyHost", proxyAddr); System.setProperty("http.proxyPort", proxyPort); -------------------------------------------------------------------------------- But then I get a 502 Bad Gateway error on both my local web services (which don't need the proxy anyway) and outside web services. I'm using org.apache.axis.client.Call and org.apache.axis.client.Service... Thanks for your help...
The proxy isn't fixing it, it's making it worse. Or else I'm not handling it well...
|
 |
David Brossard
Ranch Hand
Joined: Jun 03, 2004
Posts: 107
|
|
Actually the bottom line is one should set the proxy with ant rather than programmatically as I suggested earlier on... See http://ant.apache.org/manual/OptionalTasks/setproxy.html for further info.
|
 |
 |
|
|
subject: Accessing an internet web service from a secure LAN
|
|
|