Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Accessing an internet web service from a secure LAN

 
David Brossard
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.
 
Lasse Koskela
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...
 
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.
 
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic