My first task in designing CityView was figuring out how to take arbitrary city and state names and convert them into longitudes and latitudes to feed to TerraService. Exactly how you go about getting that reference will be discussed shortly. The next challenge is to take the longitude and latitude returned by ConvertPlaceToLonLatPt and convert them into an AreaBoundingBox object describing the geographical boundaries of the desired image. The TileID passed to GetTile can be retrieved from the AreaBoundingBox. What's important for now is that I used only three of the Web methods that TerraService exposes to create an application that's a real conversation piece.
Most people are amazed the first time they see it in action.
They're even more amazed when they see how little code it took to make it work. There are two basic ways to write that code. And there's the easy way, which involves deriving a class from the .NET Framework class library's SoapClientProtocol class and letting it do the work for you. The easy way is made even easier by the fact that you don't have to perform the derivation by hand. Together, WebServiceUtil and SoapClientProtocol make it trivial to write Web Service clients.