Finds details of an address within a locality. The locality to search within is identified by the localityKey parameter, which should be a locality key returned from the LocalitiesByName or LocalitiesByPostcode methods.
Note that this should not be a building number; to find addresses using a building number you should first identify the street the building is on using the StreetsByLocalityKey or StreetsByName methods, then use the AddressesByStreetKey method to find the building address.
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 AddressesByLocalityKey(licence, localityKey, building) {
/// <param name="licence">string. One of the following values: WebServerFull, WebClickFull, WebClickThoroughfare, InternalUserFull, InternalUserThoroughfare, SmallUserFull, SmallUserThoroughfare, Lookup, InternalServerFull, InternalServerThoroughfare, FreeTrial, FreeTrialThoroughfare</param>
/// <param name="localityKey">string</param>
/// <param name="building">string</param>
var addresscapture = new data8.addresscapture();
addresscapture.addressesbylocalitykey(
licence,
localityKey,
building,
null,
showAddressesByLocalityKeyResult
);
}
function showAddressesByLocalityKeyResult(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 or partial address details that match the query.
// A human-readable description of each item in the array is available in the Description field,
// and an identifier to be passed to other methods is available in the ID 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 AddressesByLocalityKey(AddressCaptureLicence licence, string localityKey, string building)
{
// Invoke the web service method.
AddressCapture proxy = new AddressCapture();
PartialAddressOutput results = proxy.AddressesByLocalityKey("username", "password", licence, localityKey, building, null);
// 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 or partial address details that match the query.
// A human-readable description of each item in the array is available in the Description field,
// and an identifier to be passed to other methods is available in the ID 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 AddressesByLocalityKey(ByVal licence As AddressCaptureLicence, ByVal localityKey As String, ByVal building As String)
'Invoke the web service method.
Dim proxy As AddressCapture = New AddressCapture()
Dim results As PartialAddressOutput = proxy.AddressesByLocalityKey("username", "password", licence, localityKey, building, Nothing)
'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 or partial address details that match the query.
' A human-readable description of each item in the array is available in the Description field,
' and an identifier to be passed to other methods is available in the ID field.
End If
End Sub
Public Sub AddressesByLocalityKey(licence As String, localityKey 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=AddressesByLocalityKeySimple" &
"&username=your-username" &
"&password=your-password" &
"&licence=" & licence &
"&localityKey=" & localityKey &
"&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:
'ID
'Description
End If
End If
End Sub
// NOTE: The php_soap.dll extension must be enabled in the php.ini file.
function AddressesByLocalityKey($licence, $localityKey, $building)
{
$params = array(
"username" => "your-username",
"password" => "your-password",
"licence" => $licence,
"localityKey" => $localityKey,
"building" => $building,
"options" => $options
);
$client = new SoapClient("http://webservices.data-8.co.uk/AddressCapture.asmx?WSDL");
$result = $client->AddressesByLocalityKey($params);
if ($result->AddressesByLocalityKeyResult->Status->Success == 0)
{
echo "Error: " . $result->AddressesByLocalityKeyResult->Status->ErrorMessage;
}
else
{
// TODO: Process method results here.
// Results can be extracted from the following fields:
// $result->AddressesByLocalityKeyResult->Results
// Contains an array of addresses or partial address details that match the query.
// A human-readable description of each item in the array is available in the Description field,
// and an identifier to be passed to other methods is available in the ID 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->AddressesByLocalityKeyResult->Results) as $item)
// {
// ...
// }
}
}