PAVv3 Php

From CDYNE Wiki
Jump to navigation Jump to search

Using as a Service Reference(.NET Framework 3.5+)

http://pav3.cdyne.com/PavService.svc?wsdl

Get Congressional District By Zip

 1 <?php
 2 $client = new SoapClient('http://pav3.cdyne.com/PavService.svc?wsdl');
 3 $param = array(
 4 	'ZipCode'=> '23320'
 5 	,'LicenseKey' => 'YOUR LICENSE KEY'
 6 ); 
 7 $result = $client->GetCongressionalDistrictByZip($param);
 8 echo "<pre>";
 9 print_r($result);
10 echo "</pre>";
11 ?>

Get City Names For Zip Code

 1 <?php
 2 $client = new SoapClient('http://pav3.cdyne.com/PavService.svc?wsdl');
 3 $param = array(
 4 	'ZipCode'=> '23320'
 5 	,'LicenseKey'=> 'YOUR LICENSE KEY'
 6 ); 
 7 $result = $client->GetCityNamesForZipCode($param);
 8 echo "<pre>";
 9 print_r($result);
10 echo "</pre>";
11 ?>

Get Zip Codes For City And State

 1 <?php
 2 $client = new SoapClient('http://pav3.cdyne.com/PavService.svc?wsdl');
 3 $param = array(
 4 	'City'=> 'Chesapeake'
 5 	,'State'=> 'VA'
 6 	,'LicenseKey' => 'YOUR LICENSE KEY'
 7 ); 
 8 $result = $client->GetZipCodesForCityAndState($param);
 9 echo "<pre>";
10 print_r($result);
11 echo "</pre>";
12 ?>

Get Urbanization List For ZipCode

 1 <?php
 2 $client = new SoapClient('http://pav3.cdyne.com/PavService.svc?wsdl');
 3 $param = array(
 4 	'ZipCode'=> '23320'
 5 	,'LicenseKey' => 'YOUR LICENSE KEY'
 6 ); 
 7 $result = $client->GetUrbanizationListForZipCode($param);
 8 echo "<pre>";
 9 print_r($result);
10 echo "</pre>";
11 ?>

Verify Address

 1 <?php
 2 $client = new SoapClient('http://pav3.cdyne.com/PavService.svc?wsdl');
 3 $param = array(
 4 	'FirmOrRecipient' => 'CDYNE'
 5 	,'PrimaryAddressLine' => '505 Independence Parkway'
 6 	,'SecondaryAddressLine' => 'Suite 300'
 7 	,'Urbanization' => ''
 8 	,'CityName' => 'Chesapeake'
 9 	,'State' => 'VA'
10 	,'ZipCode' => '23320'
11 	,'LicenseKey' => 'YOUR LICENSE KEY' 
12 );
13 $result = $client->VerifyAddress($param);
14 echo "<pre>";
15 print_r($result);
16 echo "</pre>";
17 ?>

Verify Address Advanced

Calling Verify Address Advanced using SOAP Client.

 1 <?php
 2 class VerifyAddressAdvancedRequestData
 3 {
 4                 public $Request;
 5  
 6                 function VerifyAddressAdvancedRequestData($CityName, $FirmOrRecipient, $LicenseKey, $PrimaryAddressLine, $SecondaryAddressLine, $State, $Urbanization, $ZipCode)
 7                 {
 8                                 $this->Request = array();
 9                                 $this->Request['CityName'] = $CityName;
10                                 $this->Request['FirmOrRecipient'] = $FirmOrRecipient;
11                                 $this->Request['LicenseKey'] = $LicenseKey;
12                                 $this->Request['PrimaryAddressLine'] = $PrimaryAddressLine;
13                                 $this->Request['SecondaryAddressLine'] = $SecondaryAddressLine;
14                                 $this->Request['State'] = $State;
15                                 $this->Request['Urbanization'] = $Urbanization;
16                                 $this->Request['ZipCode'] = $ZipCode;
17                 }
18 }
19 $client = new SoapClient('http://pav3.cdyne.com/PavService.svc?wsdl');
20 $request = new VerifyAddressAdvancedRequestData('Chesapeake','CDYNE','YOUR LICENSE KEY','505 Independence Parkway','Suite 300','VA','','23320');
21 $result = $client->VerifyAddressAdvanced($request);
22 echo "<pre>";
23 print_r($result);
24 echo "</pre>";
25 ?>


Get Intelligent Mail Barcode

 1 <?php
 2 $client = new SoapClient('http://pav3.cdyne.com/PavService.svc?wsdl');
 3 $param = array(
 4 	'BarcodeIdentifier'=> '12'
 5 	,'ServiceTypeIdentifier'=> '123'
 6 	,'MailerIdentifier'=> '123456'
 7 	,'SerialNumber'=> '123456789'
 8 	,'IntelligentMailBarcodeKey'=> 'dw/cKC9h9Au0zJy+WGvQkQ=='
 9 	,'LicenseKey' => 'YOUR LICENSE KEY'
10 ); 
11 $result = $client->GetIntelligentMailBarcode($param);
12 echo "<pre>";
13 print_r($result);
14 echo "</pre>";
15 ?>

Get Zip Codes For Fips

 1 <?php
 2 $client = new SoapClient('http://pav3.cdyne.com/PavService.svc?wsdl');
 3 $param = array(
 4 	'Fips'=> '51550'
 5 	,'LicenseKey' => 'YOUR LICENSE KEY'
 6 ); 
 7 $result = $client->GetZipCodesForFips($param);
 8 echo "<pre>";
 9 print_r($result);
10 echo "</pre>";
11 ?>

Get Zip Codes Within Distance

 1 <?php
 2 $client = new SoapClient('http://pav3.cdyne.com/PavService.svc?wsdl');
 3 $param = array(
 4 	'Latitude'=> '36.761560'
 5 	,'Longitude'=> '-76.259964'
 6 	,'Radius'=>'5'
 7 	,'LicenseKey' => 'YOUR LICENSE KEY'
 8 ); 
 9 $result = $client->GetZipCodesWithinDistance($param);
10 echo "<pre>";
11 print_r($result);
12 echo "</pre>";
13 ?>

Back to Postal_Address_Verification_V3