Simply Postcode Software SOAP Web Service:
This data source can be used by any web server or programming language that supports a server-side scripting language that can call SOAP web services, to provide Postcode Lookup and Nearest Store locator within your Software/Web site. Simply call the web service with Postcode criteria, and the web service returns address data.
Ideal for .NET, ColdFusion, Perl, PHP, Java integration, plus other Language and platform.
SOAP Web Service Features:
The SOAP Web Service has the following features:
- Platform/Language independent
- Most modern programming languages support this kind of web service
- Offers full access to all data we provide (Full/Thoroughfare/Geographic Longitude and Latitude)
- Offers Advanced Word Search when using implemented User Interface
- Data always up to date
- No Data Administration Cost for you
- Can allow your customer to open an account, you get commission
SOAP Web Service Example Code
The SOAP Object examples:
For Desktop:
| Directory | Language | API Used | Description |
|---|---|---|---|
| Reseller/VBNET Manager Customer Accounts | VB.NET | SOAP | Example of using the reseller portal |
| SOAP/VBNET 2003 FULL PAFF | VB.NET | SOAP | Get Full using SOAP Web Service |
| SOAP/VBNET 2003 PostZon | VB.NET | SOAP | Get PostZon using SOAP Web Service |
| SOAP/VBNET 2003 Thoroughfare | VB.NET | SOAP | Get Thoroughfare/Street using SOAP Web Service |
| SOAP/VBNET 2005 FULL PAFF | VB.NET | SOAP | Get Full using SOAP Web Service |
| SOAP/VBNET 2005 PostZon | VB.NET | SOAP | Get PostZon using SOAP Web Service |
| SOAP/VBNET 2005 Thoroughfare | VB.NET | SOAP | Get Thoroughfare/Street using SOAP Web Service |
| SOAP/VBNET 2008 SOAP FULL ADV search | VB.NET | SOAP | Example of Full address with Advanced Search using SOAP Service |
For Web:
| Directory | Language | API Used | Description |
|---|---|---|---|
| ASP.c sharpe 2005 Address Search | C# | SOAP | How to get FULL, Thoroughfare/Street and PostZon Data |
| ASP.NET 2005 Address Search | SOAP | How to get FULL, Thoroughfare/Street and PostZon Data |
Get Full Address from SOAP Web Service:
The following example calls our server to retrieve a list of addresses for a given postcode (or address words if using our Web Based data). These addresses are then displayed in a list box for user selection (step1), with line ID, then the full address is finally retrieved from our server in the next step (step2).
Step 1 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 2 Call SOAP Web Service to Present List of addresses at Postcode
The following code will call the SOAP Web Service to return a list of addresses given a postcode. The list should be displayed to the user for selection.
|
|
| 'Search for full Postcode or other
address fields Me.ListView1.Items.Clear() Dim PostcodeSearch As New PostcodeWebService.WebService Dim SearchPrima As New PL_SearchPrimaRecord Dim AddressesDataReturned As New PL_AddressesDataReturnedRecord 'Set search criteria, either full Postcode or Two other address fields With SearchPrima .Postcode = Me.InpPostcode.Text End With 'Do Search, on Postcode or two or more address fields AddressesDataReturned = PostcodeSearch.SearchForAddress("My DataKey", "UserID", "UK", SearchPrima) If AddressesDataReturned.SearchPerformedWithoutError Then 'Display results, no major error If AddressesDataReturned.ErrorMessage <> "" Then MsgBox(AddressesDataReturned.ErrorMessage) With AddressesDataReturned 'Show amount of Postocde Lookup credits left Me.Text = .CreditsStatusText 'Remember the URL to buy more Postocde Lookup credits LinkToBuyMoreCredits = .BuyMoreCreditsURL Me.LinkTOBuyMore.Visible = True 'Put Address data in listview Dim x& For x = 0 To .LineCount Dim itemToAdd As ListViewItem = ListView1.Items.Add(.Lines(x).ID, 0) itemToAdd.SubItems.Add(.Lines(x).Address) Next End With Me.TabControl1.SelectedIndex = 1 Else 'Display error (Account stuff mostly) MsgBox(AddressesDataReturned.ErrorMessage) End If |
|
|
| string myDataKey =
Request.QueryString["datakey"].ToString(); string PostCode = Request.QueryString["postcode"].ToString(); string UserID = "UniqueID"; //Create PostcodeWebService.WebService object uk.co.simplylookupadmin.www.WebService myWSObj = new uk.co.simplylookupadmin.www.WebService(); uk.co.simplylookupadmin.www.PL_SearchPrimaRecord myWSSearch = new uk.co.simplylookupadmin.www.PL_SearchPrimaRecord(); uk.co.simplylookupadmin.www.PL_AddressesDataReturnedRecord myWSAddrRec = new uk.co.simplylookupadmin.www.PL_AddressesDataReturnedRecord(); myWSSearch.Postcode = PostCode; myWSAddrRec = myWSObj.SearchForAddress(myDataKey, UserID, "UK", myWSSearch); //Show amount of Postocde Lookup credits left this.Label2.Text = myWSAddrRec.CreditsStatusText; if (myWSAddrRec.SearchPerformedWithoutError == true) { for (int i = 0; i < myWSAddrRec.LineCount; i++) { ListBox1.Items.Add(new ListItem(myWSAddrRec.Lines[i].Address, myWSAddrRec.Lines[i].ID)); } } else { //Display error (Account stuff mostly) this.Label2.Text = myWSAddrRec.ErrorMessage; } |
Where uk.co.simplylookupadmin.www is a web reference to: http://www.SimplyLookupadmin.co.uk/WebService.asmx
Please note: Section 3.5 of the terms and
conditions state: "The Customer, when using the Postcode
Lookup service via Web Service, must make sure each user is
identified by a unique Computer name, in each call to the
Web Service if used internally”. In simple language this
means that each user must be identified by a unique computer
name, if used by a company employee. In the
above example "UserID" was passed as the computer name.
Step 3 Get Address Record
Having selected the address line from previous step, we now need to get the address record given the Address ID of record selected.
|
|
| 'Get ID from Listbox in hidden
column 0 Dim AddressID As String = ListView1.Items(ListView1.SelectedItems.Item(0).Index).SubItems(0).Text Dim PostcodeSearch As New PostcodeWebService.WebService Dim Address As PL_AddressRecord 'Ask for Address by ID Address = PostcodeSearch.GetAddressRecord("My DataKey", "UserID", "UK", AddressID) Me.TabControl1.SelectedIndex = 2 If Address.AddressRecordGotWithoutError Then 'Display results If Address.ErrorMessage <> "" Then MsgBox(Address.ErrorMessage) 'Process the Address to text field Dim AddressText As String With Address AddressText = "Company:" & .CompanyName & vbCrLf AddressText += "Line1:" & .Line1 & vbCrLf AddressText += "Line2:" & .Line2 & vbCrLf AddressText += "Line3:" & .Line3 & vbCrLf AddressText += "Town:" & .Town & vbCrLf AddressText += "Postcode:" & .PostZipcode & vbCrLf AddressText += "Country:" & .Country & vbCrLf End With Me.TxtAddress.Text = AddressText Else 'Display error (Account stuff mostly, i.e. No License) MsgBox(Address.ErrorMessage) End If |
|
|
| //Search for Address by
Postcode, but returning Thorughfare data uk.co.simplylookupadmin.www.WebService PostcodeSearch = new uk.co.simplylookupadmin.www.WebService(); uk.co.simplylookupadmin.www.PL_AddressRecord AddressesDataReturned = new uk.co.simplylookupadmin.www.PL_AddressRecord(); string datakey = Request.QueryString["datakey"].ToString(); string addressid = Request.QueryString["addressid"].ToString(); string userid = Request.QueryString["userid"].ToString(); //Do Search, on Postcode or two or more address fields AddressesDataReturned = PostcodeSearch.GetAddressRecord(datakey, userid, "UK", addressid); if (AddressesDataReturned.AddressRecordGotWithoutError == true) { //Display results, no major error this.TxtResults.Text = AddressesDataReturned.ErrorMessage; string AddressText; AddressText = "Status:" + AddressesDataReturned.CreditsStatusText + "\n" + "\n"; AddressText += "Company:" + AddressesDataReturned.CompanyName + "\n"; AddressText += "Line1:" + AddressesDataReturned.Line1 + "\n"; AddressText += "Line2:" + AddressesDataReturned.Line2 + "\n"; AddressText += "Line3:" + AddressesDataReturned.Line3 + "\n"; AddressText += "Town:" + AddressesDataReturned.Town + "\n"; AddressText += "County:" + AddressesDataReturned.CountyState + "\n"; AddressText += "PostCode:" + AddressesDataReturned.PostZipCode + "\n"; AddressText += "Country:UK" + "\n"; AddressText += "DeliveryPointSuffix:" + AddressesDataReturned.DeliveryPointSuffix + "\n"; AddressText += "NoHouseHolds:" + AddressesDataReturned.NoHouseHolds + "\n"; AddressText += "SmallOrg:" + AddressesDataReturned.SmallOrg + "\n"; this.TxtResults.Text = AddressText; } else { //Display error (Account stuff mostly) this.TxtResults.Text = AddressesDataReturned.ErrorMessage; } |
Get Thoroughfare/Street Address from SOAP Web Service:
The following example calls our server to retrieve Thoroughfare/Street address for a given postcode. The Thoroughfare Address is a cut down version of the Full Address, basically it does not contain the Building name or number. Therefore the programmer should allow the user to enter the House Name/Number for the address. These licenses are cheaper than Full Postcode data.
Step 1 Add SOAP reference to you 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 2 Call SOAP Web to get Thoroughfare/Street Address
The following code will call the SOAP Web Service to get the Thoroughfare/Street Address for a given a postcode.
|
|
| Dim PostcodeToGet as string =
"PE132XQ" Dim PostcodeSearch As New PostcodeWebService.WebService Dim Address As PL_AddressRecord 'Ask for Address by ID Address = PostcodeSearch.SearchForThoroughfareAddress("My DataKey", "TestComputer", "UK", PostcodeToGet ) If Address.AddressRecordGotWithoutError Then 'Display results If Address.ErrorMessage <> "" Then MsgBox(Address.ErrorMessage) 'Process the Address to text field Dim AddressText As String With Address AddressText + = "Line1:" & .Line1 & vbCrLf AddressText + = "Line2:" & .Line2 & vbCrLf AddressText + = "Line3:" & .Line3 & vbCrLf AddressText + = "Town:" & .Town & vbCrLf AddressText + = "Postcode:" & .PostZipcode & vbCrLf AddressText + = "Country:" & .Country & vbCrLf End With Me.TxtAddress.Text = AddressText Else 'Display error (Account stuff mostly, i.e. No License) MsgBox(Address.ErrorMessage) End If |
Where
PostcodeWebService is a web
reference to:
http://www.SimplyLookupadmin.co.uk/WebService.asmx
|
|
| //Search for Address by
Postcode, but returning Thoroughfare data uk.co.simplylookupadmin.www.WebService PostcodeSearch = new uk.co.simplylookupadmin.www.WebService(); uk.co.simplylookupadmin.www.PL_AddressRecord AddressesDataReturned = new uk.co.simplylookupadmin.www.PL_AddressRecord(); string datakey = Request.QueryString["datakey"].ToString(); string PostCode = Request.QueryString["postcode"].ToString(); string userid = Request.QueryString["userid"].ToString(); //Do Search, on Postcode or two or more address fields AddressesDataReturned = PostcodeSearch.SearchForThoroughfareAddress(datakey, userid, "UK", PostCode); if (AddressesDataReturned.AddressRecordGotWithoutError == true) { //Display results, no major error this.TxtResults.Text = AddressesDataReturned.ErrorMessage; string AddressText; AddressText = "Status:" + AddressesDataReturned.CreditsStatusText + "\n" + "\n"; AddressText += "Line1:" + AddressesDataReturned.Line1 + "\n"; AddressText += "Line2:" + AddressesDataReturned.Line2 + "\n"; AddressText += "Line3:" + AddressesDataReturned.Line3 + "\n"; AddressText += "Town:" + AddressesDataReturned.Town + "\n"; AddressText += "County:" + AddressesDataReturned.CountyState + "\n"; AddressText += "PostCode:" + AddressesDataReturned.PostZipCode + "\n"; AddressText += "Country:UK" + "\n"; this.TxtResults.Text = AddressText; } else { //Display error (Account stuff mostly) this.TxtResults.Text = AddressesDataReturned.ErrorMessage; } |
Where PostcodeWebService is a web reference to: http://www.SimplyLookupadmin.co.uk/WebService.asmx
Full Online API Reference Manual : SOAP Web Service
Please note: Section 3.5 of the terms and
conditions state: "The Customer, when using the Postcode
Lookup service via Web Service, must make sure each user is
identified by a unique Computer name, in each call to the
Web Service if used internally”. In simple language this
means that each user must be identified by a unique computer
name, if used by a company employee. In the
above example "UserID" was passed as the computer name.