Get Long/Lat from SOAP Web Service using PostZon Data:
To get a "Postzon" Geographical Data address from our SOAP Web Service we do the following:
Distance between two postcodes
The distance between two postcodes can be returned. Simply call with Postcode and “Home postcode” provided in the parameters. Our service will then return the distance in km. So approximate charges could be applied to a customer based on the straight line distance.
Postcode to Longitude/Latitude
This is the main use of PostZon data. Simply call with the target Postcode and the PostZon data service will return the Longitude and Latitude. Ideal for mapping and calculating distances.
Longitude/Latitude to Postcode
To get the PostZon record by Longtitude/Latitude, (closest within 10Km) set postcode to the "Longtitude|Latitude" (separated by |). The Postcode found will be returned in pz_postcode.
Town to Longitude/Latitude
To get the Longitude and Latitude of a Town, simply provide the Town name + “,SPACE“ + County in the postcode field. The Longitude and Latitude will then be returned. It is suggested that the town list is displayed using a AJAX search box.
SOAP Web Service get PostZon Data:
The following explains how to get geographical data from the PostZon data file.
Step 1 Sign up for trial
Simply use the "Sign Up for Trial" link at top right of this page to open a trial account. We will then send you a data key, which is used to identify your account, when using the following service.
Step 2 Add SOAP reference to your project
The following web references give access to our SOAP web service
.NET Web Reference
http://www.SimplyLookupadmin.co.uk/WebService.asmx
WSDL Web Reference
http://www.SimplyLookupadmin.co.uk/WebService.asmx?WSDL
You should add this SOAP reference to your project.
Step 3 Call SOAP Web Service to get PostZon Data
The following code will call the SOAP Web Service to return "Postzon" Geographical Data for a given postcode.
Parameters
Parameter name | Description |
---|---|
DataKey | Datakey, which is available when account has been created, under the “DataKey” tab of the online account administrator page. |
Username | Only needed if for internal postcode address use |
SearchType | Set to “UK” |
Postcode | Postcode to search for. OR... To get the PostZon record by OSRef, simply set postcode to the OSRef. To get the PostZon record by Longtitude/Latitude, (closest within 10Km) set postcode to the "Longtitude|Latitude" (separated by |). The Postcode found will be returned in pz_postcode. To get the Longitude and Latitude of a Town, simply provide the Town name + “,SPACE“ + County in the postcode field. The Longitude and Latitude will then be returned. It is suggested that the town list is displayed using a AJAX search box. |
homepostcode | To calculate the distance to another postcode, supply the HOME postcode here, this is optional |
Returns
Returns true if address search completed and General_credits_display_text contains summary of Credits/License status. Else errors reported in General_errormessage.
Example Code
VB.Net |
Dim HomePostcode as string
="PE132QL" |
C# .NET |
uk.co.simplylookupadmin.www.WebService PostcodeSearch = new
uk.co.simplylookupadmin.www.WebService(); |
Where PostcodeSearch is a web reference to: http://www.SimplyLookupadmin.co.uk/WebService.asmx
More information on PostZon data, including detail information about the data returned.
Step 4 Testing
Final step is to test, to enable easy testing please use our special test postcodes.
PostZon Geographic data - Example Code
Simply download the example code. The code is in the "SOAP/VBNET 2010 PostZon" or "SOAP/VBNET 2003 PostZon" directory of our example downloads.
These two examples demonstrate postcode lookup software using PostZon data.
Data Returned:
This type of license returns: (see example below)
Public UK_IntroductionDate As String
Public UK_OS_grid_east As String
Public UK_OS_grid_north As String
Public UK_county As String
Public UK_district As String
Public UK_ward As String
Public UK_gridstatus As String (accuracy of the geographic data)
Public UK_country As String
Public UK_wardstatus As String
Public UK_NHS_code As String
Public UK_NHS_region As String
Public longitude_WGS84 As String
Public latitude_WGS84 As String
Public UK_os_reference As String
Public GeoDistanceToHomePostcode As String
'Distance from "Home Postcode" in km
More infromation on Geographic data