Reputation: 45
I am calling a Google Geocoding Maps API and somehow it's throwing me the following error:
The remote server returned an error: (407) Proxy Authentication Required
I couldn't find any documentation on Google website on whether I need to have a Google Maps Key or need to create an account?
I am calling this webservice: http://maps.googleapis.com/maps/api/geocode/json?address=1600+Amphitheatre+Parkway,+Mountain+View,+CA&sensor=false"
Upvotes: 1
Views: 2969
Reputation: 4830
Have you tried adding this to your solution?
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
<proxy bypassonlocal="True" proxyaddress="http://webproxy:80" />
</defaultProxy>
</system.net>
or try the following
string url = “Valid URL”;
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
NetworkCredential netcredit = new NetworkCredential(“user1″, “pass”, “domain”);
req.Credentials = netcredit;
System.Net.WebProxy pry = new WebProxy(“proxyServer”,true);
pry.Credentials = netcredit;
WebRequest.DefaultWebProxy = pry;
req.Method = “HEAD”; //Does not work if this line is not used
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
NetworkCredential netcredit = new NetworkCredential(“user1″, “pass”, “domain”);
req.Credentials = netcredit;
System.Net.WebProxy pry = new WebProxy(“proxyServer”,true);
pry.Credentials = netcredit;
req.Proxy = pry;
req.Method = “HEAD”; //Does not work if this line is not used
HttpWebResponse res = (HttpWebResponse)req.GetResponse();
People have the solution in this forum
https://groups.google.com/forum/?fromgroups=#!topic/google-maps-api/0js1jr4kqJw
Upvotes: 2