<?php
$client = new SoapClient("https://addressinfo.northern911.com/soap/Service.svc?wsdl", array("classmap" => array("Customer" => "MyCustomer")));
$vendorCode = '955';
$soap_passcode = 'asdlfkj()*$JFU)SDf)SDuf';
$gmdate = gmdate('Ymd'); //YYYYMMDD
$hash = md5($vendorCode . $soap_passcode . $gmdate);
$queryCustomerParameters = array("vendorCode" => "955", "phoneNumber" => "7055551234", "hash" => $hash);
$queryCustomerResult = $client->QueryCustomer($queryCustomerParameters)->QueryCustomerResult;
//Transaction not accepted. Therefore display error message(s).
if (!$queryCustomerResult->Accepted)
{
echo 'Query Customer not accepted.' . '<br/><br/>';
$errors = $queryCustomerResult->Errors->Error;
$errorCount = count($errors);
//If 1 error message. Display it.
if ($errorCount == 1)
{
echo 'Error-Code: ' . $errors->ErrorCode . '<br/>';
echo 'Error-Msg: ' . $errors->ErrorMessage . '<br/>';
}
//If multiple error messages display them all.
else
{
foreach ($errors as &$err)
{
echo 'Error-Code: ' . $err->ErrorCode . '<br/>';
echo 'Error-Msg: ' . $err->ErrorMessage . '<br/><br/>';
}
}
}
else
{
echo 'Query Customer accepted.<br/>';
echo 'Firstname: ' . $queryCustomerResult->Customer->FIRST_NAME . '<br/>';
echo 'Lastname: ' . $queryCustomerResult->Customer->LAST_NAME . '<br/>';
echo 'Phonenumber: ' . $queryCustomerResult->Customer->PHONE_NUMBER . '<br/>';
echo 'City: ' . $queryCustomerResult->Customer->CITY . '<br/>';
echo 'Postal/Zip Code: ' . $queryCustomerResult->Customer->POSTAL_CODE_ZIP . '<br/>';
echo 'Last Datetime Modified: ' . $queryCustomerResult->Customer->LAST_DATETIME_MODIFIED . '<br/>';
echo 'Last Datetime Modified Unix Time: ' . $queryCustomerResult->Customer->LAST_DATETIME_MODIFIED_UNIXTIME . '<br/>';
// and so on...
}
class MyCustomer
{
public $VENDOR_CODE = null;
public $PHONE_NUMBER = null;
public $LAST_NAME = null;
public $FIRST_NAME = null;
public $STREET_NUMBER = null;
public $SUITE_APT = null;
public $STREET_NAME = null;
public $CITY = null;
public $PROVINCE_STATE = null;
public $POSTAL_CODE_ZIP = null;
public $OTHER_ADDRESS_INFO = null;
public $ENHANCED_CAPABLE = null;
public $LAST_DATETIME_MODIFIED = null;
public $LAST_DATETIME_MODIFIED_UNIXTIME = null;
}
?>