Distance Matrix Service on c#

c#, google-maps-api-3, web-services

Solution

Seems the service is REST based, so the simplest is to use a WebClient to download the contents:

WebClient client = new WebClient();
Stream stream = client.OpenRead("http://maps.googleapis.com/maps/api/distancematrix/xml?origins=Vancouver+BC|Seattle&destinations=San+Francisco|Vancouver+BC&mode=bicycling&language=fr-FR&sensor=false");

Now you got a Stream containing the XML results.

You could use a XmlSerializer to decode the XML into code, or maybe use XDocument.Load to load it into a XDocument which you can use some DOM traversing or XPath queries to fetch the data you want:

XDocument doc = XDocument.Load(stream);

Problem

How can I use the distance matrix service through c#? or where can I get the wsdl file to upload it to soap? The only way is their examples presented in js.. Distance Matrix WebSite: https://developers.google.com/maps/documentation/distancematrix/

Original source