Postcode Anywhere Address Management Web Service
HOME PRODUCTS DEVELOPERS RESELLERS CONTACT US MY ACCOUNT
Developer home
Getting started
Tutorials
Code samples
Documentation and reference
Downloads
Service information
Call us: 0800 047 0493
Home - Developer Centre - Code Samples

We've collected a range of sample code which you can use in your own applications and web sites. The code samples are grouped by the language / platform they're written for. If you have implemented Postcode Anywhere address lookups, bank validation checks, geodemographic lifestyle profiling, or any of our other services, and have sample code that might be helpful to other developers, let us know and we'll post it here.

» .NET examples for ASP.NET and WinForms
» .NET examples for C#
» ASP examples using the ADO interface
» VB6 examples using the API and ADO interface
» Access examples using the OCX control and dialogues
» JavaScript examples using AJAX
» Microsoft CRM 3.0 examples
» PHP examples
» ColdFusion examples
» Perl examples
» Google Maps
» Filemaker examples

.NET Examples

Remember that Postcode Anywhere is actually written and operated in .NET so it offers the highest level of support possible. If you're developing in VS.NET, it's just a case of making a web reference to the relevant service and consuming the service. (Tip: if you're not using VS.NET you may find it easier to use our dataset service rather than the SOAP service.)

We have even built some .NET controls which you're welcome to hack apart and integrate into your software. These deal with all the UI plumbing and mean you can be up and running in seconds! Well, almost!

Download the VB.NET address finder WinForms sample General WinForms Address Finder Control (VB.NET)

This example provides a control based on the ListBox control that interacts with the Postcode Anywhere web service.
Download the VB.NET address finder control sample General ASP.NET Address Finder Control (VB.NET)

Similar to the WinForm control, this provides a simple, server based control for querying the Postcode Anywhere web service.
Download the VB.NET nearest store locator sample ASP.NET Nearest Samples (VB.NET)

An ASP.NET project that uses the nearest service to geocode an existing database and provide flexible nearest searching.

[Back to top]

C# Examples

If you use .NET but don't like VB then these samples could be what you're looking for. Again, if you're developing in VS.NET, it's just a case of making a web reference to the relevant service and consuming the service.

Download the CSharp address lookup sample Simple address lookup sample (C#.NET)

This example shows you how to consume the web service and use the ByPostcode and FetchAddress methods to lookup an address.
Download the CSharp postcode finder sample Sample using an address lookup class (C#.NET)

This sample was provided by Richard Steele of Basemap Limited and expands on the simple lookup formula by providing an address finder control similar to the VB.NET version above.

[Back to top]

ASP Examples

Hooking in to Postcode Anywhere from ASP couldn't be easier. Sure, you can use our JavaScript service but if you want to do it properly, you can use Postcode Anywhere just like any other ADO datasource.

You don't need to learn any new tricks either - as long as you've got a working knowledge of ADO and know something about using recordsets, you can use the service. And you don't even need to install anything on the server!

Download the ASP address finder sample ASP address finder

A simple example in ASP that lists the properties in a postcode and then returns a fully formatted address.
Download the ASP postcode finder sample ASP postcode finder

Similar to the sample above, but this sample finds the postcode for a given address.
Download the ASP nearest store locator sample ASP where's my nearest?

A collection of pages that use the nearest service to geocode an existing database and provide flexible location based searching.
Download the ASP Acorn sample ASP Acorn category finder

Uses the Acorn service to get the Acorn type, category and group information for the postcode.
Download the ASP Objective2 sample Objective 2 checker

Simple but effective objective 2 eligibility checker for England and Wales. Even includes a map!

[Back to top]

VB 6 Examples

Postcode Anywhere may be written in .NET but that doesn't mean that we've forgotten all you VB 6 developers. In fact there aren't any features which are not available to you. Better still, you've got a huge range of integration options.

Take the easy route and use our DLLs which take care of everything or if you don't want to distribute any of our software you can use ADO or MSXML. It couldn't be easier!

Download the VB6 address finder sample Simple form completion

A VB6 project with different examples of integrating the address finder functionality. Uses a combination of the OCX control, UI forms and recordset service.
Download the VB6 postcode finder sample Postcode finder

Similar to the sample above, but demonstrates the service finding postcodes instead of addresses.

[Back to top]

Access Examples

So many of you plan to use Postcode Anywhere in MS Access that we've put together some samples of how to do it.

Take the easy route and use our DLLs which take care of everything or if you don't want to distribute any of our software you can use ADO or MSXML. It couldn't be easier!

Download the MS Access in-line address lookup sample Address finder (on page)

This is the nicest way to integrate into Access. Our OCX control sits on your form and provides completely seemless searching.
Download the MS Access dialogue address lookup sample Address finder (using a dialogue)

By far the easiest way to integrate Postcode Anywhere into Access (apart from using the Recogniser of course). Just create a button, copy a bit of code and you're done!
Download the MS Access worker sample Address lookup using recordsets

If you don't want to use our OCX, DLL or desktop software, but still want to use our address lookups in Access then you can use our Recordset service.

[Back to top]

JavaScript Examples

So, you may be wondering how to integrate address lookups or bank validation checks (or any of our other services for that matter!) into your site if you don't want to use the popups and don't know that much about ASP or PHP and the like. Or maybe you only have a standard HTML site and don't want to use the popups. Well you're not being excluded. Try these JavaScript samples using AJAX to get an idea of what you can do.

Download the JavaScript AJAX sample collection Lookups / validation / our services for HTML pages

This is the nicest way to integrate lookups for all of our services (not just addresses) into an HTML website if you don't want to use the popups.

[Back to top]

Microsoft CRM 3.0 Examples

We don't use it ourselves, but we know that many of you do. Our friends at Vigence have come up with this sample integration so that you can see how to use address lookups AND nearest store lookups using your CRM.

Download the MS CRM address lookup sample Address lookup

Using a ByPostcode lookup followed by FetchAddress this introduces an address lookup feature into your CRM. Check the CRM configuration for the JavaScript to call the web services.
Download the MS CRM store locator sample Nearest store locator

This lets you find stores that are nearest to a given postcode based on the data that's held in your CRM.

[Back to top]

PHP Examples

We're the first to admit we don't know that much about the ins and outs of PHP but here are some samples which other developers have sent it. If you think you can do better or have something that others may find useful then send it to us and we'll post it here.

Download the PHP samples General PHP samples

PHP script samples which demonstrate different applications using all of our services.
Download the PHP store locator sample PHP where's my nearest

A PHP sample using the StoredNearest method. Should be easy to adapt to other methods too!
Download the PHP SOAP sample PHP SOAP

If you have PHP 5 you may like to try using the SOAP service. This bit of code will show you how to call the service and handle the results.

[Back to top]

ColdFusion Examples

ColdFusion is something else we don't know much about. What we do know is that you can use CFHTTP to access our XML service, and this sample below shows you what to do next!

Download the ColdFusion sample Address finder using FastAddress method (incl. geographic data)

An example of using the service to fetch an address with a postcode and building number. Includes raw and geographic data fields.

[Back to top]

Perl Examples

Like PHP and ColdFusion we don't know much about this whole retro Perl thing but hey... whatever floats your CGI boat. Here are a couple of samples sent in by other developers but feel free to send us your own examples!

Download the perl sample code Perl address finder

An example of using the service to complete addresses in a form.

[Back to top]

Google Maps Examples

Who's not doing something with Google Maps these days? Sure, we 'do' maps but let's be honest, Google's are free and pretty damned swanky!

Download the Google Maps store locator sample Store locator

This more advanced example creates a fully featured store locator in a few easy steps.
Download the Google Maps area and region plotter sample Areas and regions

Use our mapping overlays with Google Maps and clever stuff we found from BusMonster, you can plot postcode areas on a map in lots of pretty colours. It might not sound exciting but those marketing types will love it.

[Back to top]

Filemaker Examples

A database for PCs and Macs? How's that work then?! Well we're not too sure but fellow developers MoleSoft have kindly let us post this sample of Postcode Anywhere in Filemaker.

Download the FileMaker sample Filemaker samples

An example of using the service in Filemaker.

[Back to top]

Read the tutorials to get started
See how our desktop client software works
DLLs and other tools to download
A list of all of the methods available for our web service.