PostcodeLookup
Search by postcode and return matching premises at that code.
LookupXML web service for enterprise and legacy systems, with full WSDL support for automatic client generation in .NET, Java, PHP and more.
The ePostcode SOAP API exposes UK address lookup and validation over a classic SOAP/XML interface. It is ideal where your stack already expects WSDL-generated clients or long-running enterprise integrations.
SOAP is maintained for backward compatibility. For new greenfield projects we recommend the REST API for simpler JSON workflows and modern tooling. Existing SOAP customers can continue with confidence.
https://ws.epostcode.com/uk/postcodeservices19.asmx
?WSDL on the service URL
wsimport, SoapUI and similar.Point your tooling at the live WSDL to generate strongly typed client proxies. Most platforms only need the URL below.
wsimport against the WSDL to create client stubs.SoapClient($wsdl) and call operations by name.zeep (or similar) with the WSDL for typed bindings.Browse operations and the HTML test console at postcodeservices19.asmx.
Authenticate with the API key issued in the ePostcode portal. Pass it as an operation parameter (commonly ApiKey) on each call.
Core operations for lookup, detail retrieval, validation and account balance. Exact signatures are defined in the WSDL.
Search by postcode and return matching premises at that code.
LookupKeyword search by building, street or free text address fragments.
LookupFetch full structured details for a selected property identifier.
DetailsValidate and standardise an address against Royal Mail PAF-backed data.
ValidationReturn remaining credits for the authenticated API key / account.
AccountIllustrative SOAP 1.1 envelopes for a postcode lookup. Field names should match your generated client and the current WSDL.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<PostcodeLookup xmlns="http://ws.epostcode.com/">
<ApiKey>YOUR_API_KEY_HERE</ApiKey>
<Postcode>SW1A 1AA</Postcode>
</PostcodeLookup>
</soap:Body>
</soap:Envelope>
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<PostcodeLookupResponse xmlns="http://ws.epostcode.com/">
<PostcodeLookupResult>
<Address>
<BuildingNumber>10</BuildingNumber>
<Street>Downing Street</Street>
<Locality>Westminster</Locality>
<Town>London</Town>
<County>Greater London</County>
<Postcode>SW1A 2AA</Postcode>
<Latitude>51.503396</Latitude>
<Longitude>-0.127764</Longitude>
</Address>
</PostcodeLookupResult>
</PostcodeLookupResponse>
</soap:Body>
</soap:Envelope>
Use Visual Studio service references to generate proxy classes from the WSDL, then call operations asynchronously.
https://ws.epostcode.com/uk/postcodeservices19.asmx?WSDL and click Go.PostcodeServiceReference) and click OK.// Add Service Reference to:
// https://ws.epostcode.com/uk/postcodeservices19.asmx?WSDL
using PostcodeServiceReference;
var client = new PostcodeServices19SoapClient();
var result = await client.PostcodeLookupAsync("YOUR_API_KEY", "SW1A 1AA");
foreach (var address in result.Addresses)
{
Console.WriteLine($"{address.BuildingNumber} {address.Street}");
Console.WriteLine($"{address.Town}, {address.Postcode}");
}
Service references handle XML serialisation for you. Prefer async methods and dispose/close the client according to your WCF or connected-service guidance.
PHP’s built-in SoapClient can consume the WSDL with minimal setup.
<?php
$wsdl = "https://ws.epostcode.com/uk/postcodeservices19.asmx?WSDL";
$client = new SoapClient($wsdl);
$params = array(
'ApiKey' => 'YOUR_API_KEY_HERE',
'Postcode' => 'SW1A 1AA'
);
try {
$result = $client->PostcodeLookup($params);
foreach ($result->PostcodeLookupResult->Address as $address) {
echo $address->BuildingNumber . " " . $address->Street . "\n";
echo $address->Town . ", " . $address->Postcode . "\n";
}
} catch (SoapFault $e) {
echo "Error: " . $e->getMessage();
}
?>
Network issues, invalid keys and SOAP faults surface as SoapFault. Handle them explicitly in production code.
Generate stubs with wsimport, then call the generated service port.
wsimport -keep -verbose https://ws.epostcode.com/uk/postcodeservices19.asmx?WSDL
import com.epostcode.ws.*;
public class PostcodeLookupExample {
public static void main(String[] args) {
try {
PostcodeServices19 service = new PostcodeServices19();
PostcodeServices19Soap port = service.getPostcodeServices19Soap();
String apiKey = "YOUR_API_KEY_HERE";
String postcode = "SW1A 1AA";
PostcodeLookupResponse response = port.postcodeLookup(apiKey, postcode);
for (Address address : response.getAddresses()) {
System.out.println(address.getBuildingNumber() + " " + address.getStreet());
System.out.println(address.getTown() + ", " + address.getPostcode());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Exact package and type names depend on your wsimport options and WSDL. Adjust imports to match generated output.
Failed calls typically return a SOAP fault. Surface the fault code and string in logs so support can diagnose quickly.
Our technical team can help with WSDL clients, legacy migrations and production cutovers.