|
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
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!
[Back to top]
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.
[Back to top]
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!
|
ASP address finder
A simple example in ASP that lists the properties in a postcode and then
returns a fully formatted address.
|
|
ASP postcode finder
Similar to the sample above, but this sample finds the postcode for a given address.
|
|
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.
|
|
ASP Acorn category finder
Uses the Acorn service to get the Acorn type, category and group information for the postcode.
|
|
Objective 2 checker
Simple but effective objective 2 eligibility checker for England and Wales. Even includes a map!
|
[Back to top]
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!
|
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.
|
|
Postcode finder
Similar to the sample above, but demonstrates the service finding postcodes instead of addresses.
|
[Back to top]
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!
|
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.
|
|
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!
|
|
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]
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.
[Back to top]
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.
|
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.
|
|
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]
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.
|
General PHP samples
PHP script samples which demonstrate different applications using all of our services.
|
|
PHP where's my nearest
A PHP sample using the StoredNearest method. Should be easy to adapt to other methods too!
|
|
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 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!
[Back to top]
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!
[Back to top]
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!
|
Store locator
This more advanced example creates a fully featured store locator in a few easy steps.
|
|
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]
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.
[Back to top]
|