Skip to content

Instantly share code, notes, and snippets.

@maplinkapi
Created February 22, 2013 22:33
Show Gist options
  • Save maplinkapi/5017079 to your computer and use it in GitHub Desktop.
Save maplinkapi/5017079 to your computer and use it in GitHub Desktop.
const string token = "SEU_TOKEN";
var city = new City { name = "São Paulo", state = "SP" };
var addressOptions = new AddressOptions
{
usePhonetic = true,
searchType = 2,
resultRange = new ResultRange {pageIndex = 1, recordsPerPage = 5}
};
using (var addressFinderSoapClient = new AddressFinderSoapClient())
{
var findCityResponse = addressFinderSoapClient.findCity(city, addressOptions, token);
Console.WriteLine("PageCount: {0}, RecordCount: {1}", findCityResponse.pageCount, findCityResponse.recordCount);
findCityResponse.cityLocation
.ToList()
.ForEach(cityLocation =>
Console.WriteLine
(
"Cidade: {0}, Estado: {1}, Latitude: {2}, Longitude: {3}, " +
"Acesso de automóveis: {4}, " +
"Intervalo de início de códigos postais: {5}," +
"Intervalo de término de códigos postais : {6}, " +
"É capital: {7}",
cityLocation.city.name, cityLocation.city.state, cityLocation.point.y,
cityLocation.point.x,
cityLocation.carAccess,
cityLocation.zipRangeStart, cityLocation.zipRangeEnd,
cityLocation.capital
));
Console.ReadLine();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment