The highlighted line being this one "WebResponse response = request.GetResponse();"
:) On Dec 5, 12:20 pm, varun <[EMAIL PROTECTED]> wrote: > Hello ppl > > Well lam trying the same thing with the following C# code > > ----------------------------------------------------------------------------------------------------------------------------------------------------- > string sURL = "http://www.google.com/maps/geo?q=" + GP.Address > + "&output=xml&key=" + GoogleAPIKey; > //string sURL = "http://www.troycitygarage.com"; > > WebRequest request = WebRequest.Create(sURL); > request.Timeout = 10000; > // Set the Method property of the request to POST.` > request.Method = "PROPFIND"; > // Create POST data and convert it to a byte array. > string postData = ""; // "This is a test that posts this > string to a Web server."; > byte[] byteArray = Encoding.UTF8.GetBytes(postData); > // Set the ContentType property of the WebRequest. > request.ContentType = "application/x-www-form-urlencoded"; > // Set the ContentLength property of the WebRequest. > request.ContentLength = byteArray.Length; > // Get the request stream. > Stream dataStream = request.GetRequestStream(); > > // //Write the data to the request stream. > dataStream.Write(byteArray, 0, byteArray.Length); > // Close the Stream object. > dataStream.Close(); > //// Get the response. > WebResponse response = request.GetResponse(); > // Display the status. > //Console.WriteLine(((HttpWebResponse) > response).StatusDescription); > // Get the stream containing content returned by the server. > dataStream = response.GetResponseStream(); > // Open the stream using a StreamReader for easy access. > StreamReader reader = new StreamReader(dataStream); > // Read the content. > string responseFromServer = reader.ReadToEnd(); > > StringReader tx = new StringReader(responseFromServer); > > //return false; > //System.Xml.XmlReader xr = new System.Xml.XmlReader(); > > //return false; > > DataSet DS = new DataSet(); > DS.ReadXml(tx); > //DS.ReadXml(dataStream); > //DS.ReadXml(tx); > > --------------------------------------------------------------------------------- > > But I am getting the error “The remote server returned an error: (404) > Not Found.” At the highlighted line. > I have mentioned the proxy details in the config file and everything > seems fine in the code. > > What’s more frustrating is that if it try for a simple URL likewww.google.com > orwww.yahoo.com, everything works fine. > But for the URL mentioned above, nothing works. > > The “sURL” that I am generating in the above code, when pasted in the > browser, > gives me the proper XML response(latitude and longitude) in the > browser. > > But the error comes when I do it from the programCould you help me > with the above code. > I’ll be very grateful. > > Thanks In advance > > Warm Regards > Varun --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
