Skip to content

Instantly share code, notes, and snippets.

@mathias-brandewinder
Created February 14, 2013 23:08
Show Gist options
  • Save mathias-brandewinder/4957240 to your computer and use it in GitHub Desktop.
Save mathias-brandewinder/4957240 to your computer and use it in GitHub Desktop.
Simple usage of WSDL type provider to grab city location
#I @"C:\Program Files (x86)\Reference Assemblies\Microsoft\FSharp\3.0\Runtime\v4.0\Type Providers"
open System
#r "System.ServiceModel.dll"
open Microsoft.FSharp.Linq
#r "FSharp.Data.TypeProviders"
type terraService = Microsoft.FSharp.Data.TypeProviders.WsdlService<"http://terraserver-usa.com/TerraService2.asmx?WSDL">
let terraClient = terraService.GetTerraServiceSoap ()
let getPlace (city, state, country) =
let place = new terraService.ServiceTypes.msrmaps.com.Place(City = city, State = state, Country = country)
let location = terraClient.ConvertPlaceToLonLatPt(place)
city, location.Lat, location.Lon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment