• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Accessing an internet web service from a secure LAN

 
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic