Finds a list of formatted PAF addresses that are in the requested postcode, and match the optional building search criteria. The postcode parameter is required, but the building parameter is optional. If the building parameter is not specified, every address in the postcode is included in the results.
This method provides the fastest and most accurate method of retrieving an address if you know the postcode.
Language:
<!-- Import the Integr8 Ajax API -->
<!-- NOTE: Get your own API key to use in the following script tag from: -->
<!-- http://www.data-8.co.uk/integr8/Admin/Ajax.aspx -->
<script src="http://webservices.data-8.co.uk/Javascript/Loader.ashx?key=your-api-key" type="text/javascript">
</script>
<script type="text/javascript">
function loadIntegr8() {
// Load the AddressCapture Integr8 service
data8.load('AddressCapture');
}
function GetFullAddress(licence, postcode, building) {
/// <param name="licence">string. One of the following values: WebServerFull, WebClickFull, WebClickThoroughfare, InternalUserFull, InternalUserThoroughfare, SmallUserFull, Lookup, InternalServerFull, InternalServerThoroughfare, FreeTrial, FreeTrialThoroughfare</param>
/// <param name="postcode">string</param>
/// <param name="building">string</param>
var addresscapture = new data8.addresscapture();
addresscapture.getfulladdress(
licence,
postcode,
building,
[
new data8.option('FixTownCounty', 'true'),
new data8.option('MaxLines', '6'),
new data8.option('MaxLineLength', '255')
],
showGetFullAddressResult
);
}
function showGetFullAddressResult(result) {
// Check that the call succeeded, and show the error message if there was a problem.
if (!result.Status.Success) {
alert('Error: ' + result.Status.ErrorMessage);
}
else {
// TODO: Process method results here.
// Results can be extracted from the following fields:
// result.Results
// Contains an array of addresses that match the query.
// A formatted version of each address in the array is available in the Address field,
// and a structured version of the address is available in the RawAddress field.
}
}
loadIntegr8();
</script>
// NOTE: A reference to the web service must be added in Visual Studio with the URL
// http://webservices.data-8.co.uk/AddressCapture.asmx
private void GetFullAddress(AddressCaptureLicence licence, string postcode, string building)
{
// Declare the required options.
Option fixTownCounty = new Option();
fixTownCounty.Name = "fixTownCounty";
fixTownCounty.Value = "true";
Option maxLines = new Option();
maxLines.Name = "maxLines";
maxLines.Value = "6";
Option maxLineLength = new Option();
maxLineLength.Name = "maxLineLength";
maxLineLength.Value = "255";
// Invoke the web service method.
AddressCapture proxy = new AddressCapture();
AddressOutput results = proxy.GetFullAddress("username", "password", licence, postcode, building, new Option[] {
fixTownCounty,
maxLines,
maxLineLength});
// Check that the call succeeded, and show the error message if there was a problem.
if ((results.Status.Success == false))
{
MessageBox.Show(("Error: " + results.Status.ErrorMessage));
}
else
{
// TODO: Process method results here.
// Results can be extracted from the following fields:
// result.Results
// Contains an array of addresses that match the query.
// A formatted version of each address in the array is available in the Address field,
// and a structured version of the address is available in the RawAddress field.
}
}
'NOTE: A reference to the web service must be added in Visual Studio with the URL
'http://webservices.data-8.co.uk/AddressCapture.asmx
Private Sub GetFullAddress(ByVal licence As AddressCaptureLicence, ByVal postcode As String, ByVal building As String)
'Declare the required options.
Dim fixTownCounty As [Option] = New [Option]
fixTownCounty.Name = "fixTownCounty"
fixTownCounty.Value = "true"
Dim maxLines As [Option] = New [Option]
maxLines.Name = "maxLines"
maxLines.Value = "6"
Dim maxLineLength As [Option] = New [Option]
maxLineLength.Name = "maxLineLength"
maxLineLength.Value = "255"
'Invoke the web service method.
Dim proxy As AddressCapture = New AddressCapture
Dim results As AddressOutput = proxy.GetFullAddress("username", "password", licence, postcode, building, New [Option]() {fixTownCounty, maxLines, maxLineLength})
'Check that the call succeeded, and show the error message if there was a problem.
If (results.Status.Success Is false) Then
MessageBox.Show(("Error: " + results.Status.ErrorMessage))
Else
'TODO: Process method results here.
'Results can be extracted from the following fields:
'result.Results
' Contains an array of addresses that match the query.
' A formatted version of each address in the array is available in the Address field,
' and a structured version of the address is available in the RawAddress field.
End If
End Sub
Public Sub GetFullAddress(licence As String, postcode As String, building As String)
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "http://webservices.data-8.co.uk/recordset.ashx?service=AddressCapture&method=GetFullAddressSimple" &
"&username=your-username" &
"&password=your-password" &
"&licence=" & licence &
"&postcode=" & postcode &
"&building=" & building
If rs.MoveFirst Then
If rs.Fields(0).Name = "Success" And rs.Fields(0).Value = false Then
MsgBox "Error: " & rs.Fields(1)
Else
'TODO: Process method results here.
'Each result is available in a different row in the recordset.
'Results can be extracted from the following fields:
'RawAddress_Organisation
'RawAddress_Department
'RawAddress_AddressKey
'RawAddress_OrganisationKey
'RawAddress_PostcodeType
'RawAddress_BuildingNumber
'RawAddress_SubBuildingName
'RawAddress_BuildingName
'RawAddress_DependentThoroughfareName
'RawAddress_DependentThoroughfareDesc
'RawAddress_ThoroughfareName
'RawAddress_ThoroughfareDesc
'RawAddress_DoubleDependentLocality
'RawAddress_DependentLocality
'RawAddress_Locality
'RawAddress_Postcode
'RawAddress_Dps
'RawAddress_PoBox
'RawAddress_PostalCounty
'RawAddress_TraditionalCounty
'RawAddress_AdministrativeCounty
End If
End If
End Sub
// NOTE: The php_soap.dll extension must be enabled in the php.ini file.
function GetFullAddress($licence, $postcode, $building)
{
$options = array(
array(
"Name" => "FixTownCounty",
"Value" => "true"
),
array(
"Name" => "MaxLines",
"Value" => "6"
),
array(
"Name" => "MaxLineLength",
"Value" => "255"
)
);
$params = array(
"username" => "your-username",
"password" => "your-password",
"licence" => $licence,
"postcode" => $postcode,
"building" => $building,
"options" => $options
);
$client = new SoapClient("http://webservices.data-8.co.uk/AddressCapture.asmx?WSDL");
$result = $client->GetFullAddress($params);
if ($result->GetFullAddressResult->Status->Success == 0)
{
echo "Error: " . $result->GetFullAddressResult->Status->ErrorMessage;
}
else
{
// TODO: Process method results here.
// Results can be extracted from the following fields:
// $result->GetFullAddressResult->Results
// Contains an array of addresses that match the query.
// A formatted version of each address in the array is available in the Address field,
// and a structured version of the address is available in the RawAddress field.
// NOTE: This field contains an array of items, but if it contains only one item,
// PHP may not recognise it as an array. To always extract the result of this
// field as an array, we recommend you always access it using the
// getArrayFromResponse method described at
// http://www.php.net/soap_soapclient_soapcall#75797, e.g.
// foreach (getArrayFromResponse($result->GetFullAddressResult->Results) as $item)
// {
// ...
// }
}
}