Error Distance Matrix API RRS feed

  • Question

  • I'm using the google maps API to get the distance between two addresses.

    Dim url As String = "https://maps.googleapis.com/maps/api/distancematrix/xml?origins=RuaBrasil&destinations=RuaItapeva&key=AIzaSyCu28EUSx4LAHgF-fEYbUYBGzlqUyl_43o"
    Dim request As WebRequest = WebRequest.Create(url)
    Using response As WebResponse = CType(request.GetResponse(), HttpWebResponse)
            Using reader As StreamReader = New StreamReader(response.GetResponseStream(), Encoding.UTF8)
                Dim dsResult As DataSet = New DataSet()
                Label1.Text = dsResult.Tables("distance").Rows(0)("text").ToString
            End Using
        End Using

    I need to exit through the proxy and set it up in web.config.

        <proxy proxyaddress="http://proxypac.internet.ccf/FilePACrest.pac" bypassonlocal="True"/>

    When I access it through the internet explorer (using the proxy settings) I can access the normal address, but when I access the application, I get error 400 (Bad Request - Invalid URL). I added a Label and put it to display the address, I can access it through IE, but as I said, the application gives an error.

    When I remove the Proxy address from the web.config and access on localhost it works, however on the server I need to exit through the proxy.

    Monday, June 29, 2020 8:28 PM

All replies


    Thank you for posting here.

    It seems that your type of application is related to ASP.NET, so it will be more appropriate to ask your question in ASP.NET forums for more efficient responses.

    Thank you for your understanding.

    Best Regards,

    Xingyu Zhao

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, June 30, 2020 9:58 AM