My company operates behind a firewall and requires us to go through a
proxy in order to access the web. The current java API does not let
you specify that.
I could use the WSDL and my favorite web service toolkit, but why
bother when Google already did the work for me ?
I created a small Patch for the java Google APIs in order to let it
handle proxy settings.
I decided to share it until Google fixes this in their java API, in
case other developers would find this useful.
You can get it from http://www.chanezon.com/pat/google_proxy_patch.html
Thanks for your hack! I surf the net through the Google (as always ;-) to
find out how to get through the firewall and your hack is the one!! While
it doesn't take lots of effort to add fix to the C# code, I really don't
want to admit the fact that making Java work for something takes much
longer time and effort. Your hack curtails my pain! Google should modify
the API as your suggestion. Thanks again!
... <snipped> ...
> I created a small Patch for the java Google APIs in order to let it
> handle proxy settings.
> I decided to share it until Google fixes this in their java API, in
> case other developers would find this useful.
> You can get it from http://www.chanezon.com/pat/google_proxy_patch.html
I am using a (from WDSL) generated interface of the Google Search api
together with Apache Axis (so no googleapi.jar in classpath). Axis
allows you to set the http proxy via the system properties
http.proxyHost and http.proxyPort. I haven't used Axis much, so I
can't attest to stability, etc., but the proxy bit works for me.
the patch I created is for people who want to use the java API
directly without managing the web service code themselves.
The explanation of why setting environment variables does not work
with the java API can be found at
I did not include it in the patch jar intentionnally, because the
patch adds a feature to the library, and GoogleAPIDemo is just demo
code that has no place in a library jar.
I hope this helps.
I hope this helps.