- C#
- Java
Address Geocode – International C# Code Snippet
AGI.AGISoapServiceClient soapClient = new AGI.AGISoapServiceClient(); AGI.ResponseObject response = null; try { response = soapClient.PlaceSearch(singleline, address1, address2, address3, address4, address5, locality, administrativearea, postalcode, country, boundaries, maxresults, searchtype, extras, licensekey); if (response == null || (response.ContainsKey("Error") && response["Error"][0]["TypeCode"] == "3")) { throw new Exception("Calling Failover URL"); } } catch (Exception ex) { response = soapClient.PlaceSearch(singleline, address1, address2, address3, address4, address5, locality, administrativearea, postalcode, country, boundaries, maxresults, searchtype, extras, licensekey); } ProcessResponse(response);
Address Geocode – International Java Code Snippet
//Get the inputs from the form String SingleLine = request.getParameter("SingleLine"); String Address1 = request.getParameter("Address1"); String Address2 = request.getParameter("Address2"); String Address3 = request.getParameter("Address3"); String Address4 = request.getParameter("Address4"); String Address5 = request.getParameter("Address5"); String Locality = request.getParameter("Locality"); String AdministrativeArea = request.getParameter("AdministrativeArea"); String PostalCode = request.getParameter("PostalCode"); String Country = request.getParameter("Country"); String Boundaries = request.getParameter("Boundaries"); String MaxResults = request.getParameter("MaxResults"); String SearchType = request.getParameter("SearchType"); String Extras = request.getParameter("Extras"); String LicenseKey = request.getParameter("LicenseKey"); //Create a soap client AGISoapService soap = new AGISoapService(); com.serviceobjects.IAGISoapService client = soap.getDOTSAddressGeocodeInternational(); //Call the PlaceSearch operation ResponseObject serviceResponse = client.placeSearch(SingleLine, Address1, Address2, Address3, Address4, Address5, Locality, AdministrativeArea, PostalCode, Country, Boundaries, MaxResults, SearchType, Extras, LicenseKey);