THANK YOU! It seems obvious now but of course the reason it was
working in the browser is because the proxy server was setup in the
connection settings. To get it working in my code I just had to add
our proxy server address to the config file and then add the following
after the WebClient construction:

client.Proxy = new
WebProxy(ConfigurationManager.AppSettings["ProxyServer"]);
client.Proxy.Credentials = CredentialCache.DefaultCredentials;

It now works a treat. Many thanks.

On Sep 24, 3:26 pm, "Barry Hunter" <[EMAIL PROTECTED]>
wrote:
> > "(407) Proxy Authentication Required"
>
> http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
>
> You need to authenticate against your Proxy.
>
> On Wed, Sep 24, 2008 at 1:49 PM,StephenR
>
>
>
>
>
> <[EMAIL PROTECTED]> wrote:
>
> > I am using the Google Maps API in an ASP.NET web application and am
> > running into some problems. I want to be able to get geocode
> > information for addresses in a C# library that is called from my web
> > app. I construct the correct URL using my API key and the address
> > details, but I get a WebException saying "(407) Proxy Authentication
> > Required" when trying to request the URL using a WebClient instance.
>
> > I know the key works and the URL is correct because if I paste the
> > same URL into a browser window it works and returns the correct XML. I
> > am running using the ASP.NET development server, so my key is
> > registered forhttp://localhostwhich I believe is correct. I have
> > tried keys with the port number included and the IP address
> > (127.0.0.1) but it still gives the error. I don't understand why this
> > is not working - can anybody help?
>
> --
> Barry
>
> -www.nearby.org.uk-www.geograph.org.uk-- Hide quoted text -
>
> - Show quoted text -

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to