• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Accessing an internet web service from a secure LAN  RSS feed

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
author
Sheriff
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
David Brossard
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!