PAVv3 CSharp

From CDYNE Wiki for Web Services
Jump to: navigation, search

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

Add a service reference to your project: http://pav3.cdyne.com/PavService.svc?wsdl


Contents

Get Congressional District By Zip

WCFpav.PavService PS = new WCFpav.PavService();
 
WCFpav.CongressionalDistrictResponse cdr = new WCFpav.CongressionalDistrictResponse();
 
cdr = PS.GetCongressionalDistrictByZip('23320', "(License Key Here)");
 
foreach (Char CongressionalDistrict in cdr.CongressionalDistrict)
{
    Console.WriteLine(cdr.CongressionalDistrict.ToString());
}

Get City Names For Zip Code

WCFpav.PavService PS = new WCFpav.PavService();
 
WCFpav.CityNamesResponse cnr = new WCFpav.CityNamesResponse();
 
cnr = PS.GetCityNamesForZipCode('23320', "(License Key Here)");
 
foreach (WCFpav.City city in cnr.CityNames)
{
    Console.WriteLine(city.Name.ToString());
}

Get Zip Codes For City And State

WCFpav.PavService PS = new WCFpav.PavService();
 
WCFpav.ZipCodesResponse zcr = new WCFpav.ZipCodesResponse();
 
zcr = PS.GetZipCodesForCityAndState('Chesapeake', 'VA', "(License Key Here)");
 
foreach (String Zip in zcr.ZipCodes)
{
    Console.WriteLine(Zip.ToString());
}

Get Urbanization List For ZipCode

WCFpav.PavService PS = new WCFpav.PavService();
 
WCFpav.UrbanizationResponse ur = new WCFpav.UrbanizationResponse();
 
ur = PS.GetUrbanizationListForZipCode('23320', "(license key here)");
 
if (ur.UrbanizationList == null)
{
    Console.WriteLine("no return");
}
else
{
    foreach (String Urban in ur.UrbanizationList)
    {
        Console.WriteLine(Urban.ToString());
    }
}

Verify Address Advanced

PAV_WSDL.PavServiceClient PSC = new PAV_WSDL.PavServiceClient("pavsoap");
 
            PAV_WSDL.PavRequest PR = new PAV_WSDL.PavRequest();
 
PR.LicenseKey = "(Your License Key)";
PR.FirmOrRecipient = "Cdyne Corporation";
PR.PrimaryAddressLine = "2125 Smith Ave";
PR.SecondaryAddressLine = "";
PR.CityName = "Chesapeake";
PR.State = "VA";
PR.ZipCode = "23320";
PR.ReturnCensusInfo = true;
PR.ReturnCityAbbreviation = true;
PR.ReturnGeoLocation = true;
PR.ReturnLegislativeInfo = true;
PR.ReturnMailingIndustryInfo = true;
PR.ReturnResidentialIndicator = true;
PR.ReturnStreetAbbreviated = true;
 
PAV_WSDL.PavResponse PavRes = new PAV_WSDL.PavResponse();
 
 
PavRes = PSC.VerifyAddressAdvanced(PR);
 
Console.WriteLine(
    
    PavRes.FirmOrRecipient.ToString() + " " +
    PavRes.PrimaryDeliveryLine.ToString() + " " +
    PavRes.SecondaryDeliveryLine.ToString() + " " +
    PavRes.CityName.ToString() + " " +
    PavRes.StateAbbreviation.ToString() + " " +
    PavRes.ZipCode.ToString()
 
    );
 
 
//Other PavResponse Return Fields
                
//PavRep.CensusInfo
//PavRep.GeoLocationInfo
//PavRep.LegislativeInfo
//PavRep.MailingIndustryInfo
//PavRep.MultipleMatches
//PavRep.ResidentialDeliveryIndicator
//PavRes.Country
//PavRes.County
//PavRes.CountyNum
//PavRes.FinanceNumber
//PavRes.IntelligentMailBarcodeKey
//PavRes.PMBDesignator
//PavRes.PMBNumber
//PavRes.PostDirectional
//PavRes.PostnetBarcode
//PavRes.PreDirectional
//PavRes.PreferredCityName
//PavRes.Primary
//PavRes.PrimaryEO
//PavRes.PrimaryHigh
//PavRes.PrimaryLow
//PavRes.ReturnCode
//PavRes.ReturnCodeSpecified
//PavRes.Secondary
//PavRes.SecondaryAbbreviation
//PavRes.SecondaryEO
//PavRes.SecondaryHigh
//PavRes.SecondaryLow
//PavRes.StreetName
//PavRes.Suffix
//PavRes.Urbanization

Verify Address

WCFpav.PavService PS = new WCFpav.PavService();
 
WCFpav.Address PavAdd = new WCFpav.Address();
 
PavAdd = PS.VerifyAddress("Cdyne Corporation", "2125 Smith Ave", "", "", "Chesapeake", "VA", "23320", "(license key here)");
 
Console.WriteLine(
    PavAdd.CityName.ToString() + " " +
    PavAdd.Country.ToString() + " " +
    PavAdd.County.ToString() + " " +
    PavAdd.FirmNameOrRecipient.ToString() + " " +
    PavAdd.PrimaryAddressLine.ToString() + " " +
    PavAdd.ReturnCode.ToString() + " " +
    PavAdd.ReturnCodeSpecified.ToString() + " " +
    PavAdd.SecondaryAddressLine.ToString() + " " +
    PavAdd.StateAbbreviation.ToString() + " " +
    PavAdd.Urbanization.ToString() + " " +
    PavAdd.ZipCode.ToString()
);

Get Intelligent Mail Barcode

WCFpav.PavService PS = new WCFpav.PavService();
 
WCFpav.IntelligentBarcodeResponse PR = new WCFpav.IntelligentBarcodeResponse();
 
PR = PS.GetIntelligentMailBarcode("(BarcodeIdentifier)", "(ServiceTypeIdentifier)","(MailerIdentifier)", "(SerialNumber)", "(IntelligentMailBarcodeKey)", "(license key here)");
 
Console.WriteLine(
    PR.Barcode.ToString() + " " +
    PR.ReturnCode.ToString() + " " +
    PR.ReturnCodeSpecified.ToString()
);

Back to Postal_Address_Verification_V3

Personal tools
Toolbox





Trial Key