Checks if a person has moved from the address given in the input record and a new address can be given. If so, their new address is returned as a list of address lines. If not, the result is blank.
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 Goneaway Integr8 service
data8.load('Goneaway');
}
function FindNewAddress(record) {
/// <param name="record">data8.inputrecord. Set up the Name, Address properties before calling this method.</param>
var goneaway = new data8.goneaway();
goneaway.findnewaddress(
record,
null,
showFindNewAddressResult
);
}
function showFindNewAddressResult(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.Result
// Contains an array of lines making up the new address if the person is found to have moved.
}
}
loadIntegr8();
</script>
// NOTE: A reference to the web service must be added in Visual Studio with the URL
// http://webservices.data-8.co.uk/Goneaway.asmx
private void FindNewAddress(InputRecord record)
{
// Invoke the web service method.
Goneaway proxy = new Goneaway();
MoverOutput results = proxy.FindNewAddress("username", "password", record, 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.Result
// Contains an array of lines making up the new address if the person is found to have moved.
}
}
'NOTE: A reference to the web service must be added in Visual Studio with the URL
'http://webservices.data-8.co.uk/Goneaway.asmx
Private Sub FindNewAddress(ByVal record As InputRecord)
'Invoke the web service method.
Dim proxy As Goneaway = New Goneaway()
Dim results As MoverOutput = proxy.FindNewAddress("username", "password", record, 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.Result
' Contains an array of lines making up the new address if the person is found to have moved.
End If
End Sub
Public Sub FindNewAddress(title As String, forename As String, middleName As String, surname As String, address As String)
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "http://webservices.data-8.co.uk/recordset.ashx?service=Goneaway&method=FindNewAddressSimple" &
"&username=your-username" &
"&password=your-password" &
"&title=" & title &
"&forename=" & forename &
"&middleName=" & middleName &
"&surname=" & surname &
"&address=" & address
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:
'Item
End If
End If
End Sub
// NOTE: The php_soap.dll extension must be enabled in the php.ini file.
function FindNewAddress($record)
{
$params = array(
"username" => "your-username",
"password" => "your-password",
"record" => $record,
"options" => $options
);
$client = new SoapClient("http://webservices.data-8.co.uk/Goneaway.asmx?WSDL");
$result = $client->FindNewAddress($params);
if ($result->FindNewAddressResult->Status->Success == 0)
{
echo "Error: " . $result->FindNewAddressResult->Status->ErrorMessage;
}
else
{
// TODO: Process method results here.
// Results can be extracted from the following fields:
// $result->FindNewAddressResult->Result
// Contains an array of lines making up the new address if the person is found to have moved.
// 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->FindNewAddressResult->Result) as $item)
// {
// ...
// }
}
}