Problem getting geocodes from .NET

Showing 1-4 of 4 messages
Problem getting geocodes from .NET StephenR 9/24/08 5:49 AM
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 for http://localhost which 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?
Re: Problem getting geocodes from .NET barryhunter 9/24/08 7:26 AM
> "(407) Proxy Authentication Required"

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

You need to authenticate against your Proxy.

--
Barry

- www.nearby.org.uk - www.geograph.org.uk -

Re: Problem getting geocodes from .NET Lawrence 9/24/08 7:41 AM
I am using this one with no problem and I think it is a very good
reference article.
http://blog.donnfelker.com/post/C-Google-Geocode-(Latitude-and-Longitude)-Class.aspx
Good luck!
http://www.DynGeometry.com
Re: Problem getting geocodes from .NET StephenR 9/25/08 3:31 AM
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" <barrybhun...@googlemail.com>
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
>
>
>
>
>
> <Stephen.Martin.Robe...@gmail.com> 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 -