PAVv3 VB.Net

From CDYNE Wiki
Jump to: navigation, search

Contents

Get Congressional District By Zip

'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 
Imports GetCongressionalDistrictByZip.WSDL
Module Module1
 
Sub Main()
 
Dim PSC As New PavServiceClient("pavsoap")
Dim CDR As New CongressionalDistrictResponse
 
CDR = PSC.GetCongressionalDistrictByZip("23320", "YOUR LICENSE KEY")
 
If CDR.ReturnCode = 0 Then
Console.WriteLine("Congressional District Found: " + CDR.CongressionalDistrict)
 
ElseIf CDR.ReturnCode = 1 Then
Console.WriteLine("Invalid input.")
 
ElseIf CDR.ReturnCode = 2 Then
Console.WriteLine("Invalid license key.")
 
ElseIf CDR.ReturnCode = 3 Then
Console.WriteLine("Congressional District not found.")
 
ElseIf CDR.ReturnCode = 4 Then
Console.WriteLine("Multiple Congressional Districts Found:" & vbLf)
 
For Each CongressionalDistrict As [Char] In CDR.CongressionalDistrict
Console.WriteLine(CDR.CongressionalDistrict)
Next
End If
 
Console.ReadLine()
 
End Sub
 
End Module

Get City Names For Zip Code

'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 
Imports GetCityNamesForZipCode.WSDL
Module Module1
 
Sub Main()
 
Dim PSC As New PavServiceClient("pavsoap")
Dim CNR As New CityNamesResponse
 
CNR = PSC.GetCityNamesForZipCode("23320", "YOUR LICENSE KEY")
 
If CNR.ReturnCode = 0 Then
Console.WriteLine("City Name: " & vbLf)
 
For Each city As WSDL.City In CNR.CityNames
Console.WriteLine(city.Name)
Next
 
ElseIf CNR.ReturnCode = 1 Then
Console.WriteLine("Invalid input.")
 
ElseIf CNR.ReturnCode = 2 Then
Console.WriteLine("Invalid license key.")
 
ElseIf CNR.ReturnCode = 3 Then
Console.WriteLine("No match found.")
End If
 
Console.ReadLine()
 
End Sub
 
End Module

Get Zip Codes For City And State

'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 
Imports GetZipCodesForCityAndState.WSDL
Module Module1
 
Sub Main()
 
Dim PSC As New PavServiceClient("pavsoap")
Dim ZCR As New ZipCodesResponse
 
ZCR = PSC.GetZipCodesForCityAndState("Chesapeake", "VA", "YOUR LICENSE KEY")
 
If ZCR.ReturnCode = 0 Then
Console.WriteLine("Zip code(s) found: " & vbLf)
 
For Each Zip As String In ZCR.ZipCodes
Console.WriteLine(Zip)
Next
 
ElseIf ZCR.ReturnCode = 1 Then
Console.WriteLine("Invalid input.")
 
ElseIf ZCR.ReturnCode = 2 Then
Console.WriteLine("Invalid license key.")
 
ElseIf ZCR.ReturnCode = 3 Then
Console.WriteLine("No match found.")
End If
 
Console.ReadLine()
 
End Sub
 
End Module

Get Urbanization List For Zip Code

'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 
Imports GetUrbanizationListForZipCode.WSDL
Module Module1
 
Sub Main()
 
Dim PSC As New PavServiceClient("pavsoap")
Dim UR As New UrbanizationResponse
 
UR = PSC.GetUrbanizationListForZipCode("23320", "YOUR LICENSE KEY")
 
If UR.ReturnCode = 0 Then
Console.WriteLine("Urbanization Names Found: " & vbLf)
 
For Each Urban As String In UR.UrbanizationList
Console.WriteLine(Urban)
Next
 
ElseIf UR.ReturnCode = 1 Then
Console.WriteLine("Invalid input.")
 
ElseIf UR.ReturnCode = 2 Then
Console.WriteLine("Invalid license key.")
 
ElseIf UR.ReturnCode = 3 Then
Console.WriteLine("No match found.")
End If
 
Console.ReadLine()
 
End Sub
 
End Module

Verify Address Advanced

'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 
Imports VerifyAddressAdvanced.WSDL
Module Module1
 
Sub Main()
 
Dim PS As New PavServiceClient("pavsoap")
Dim PR As New PavRequest
 
PR.LicenseKey = "YOUR LICENSE KEY"
PR.FirmOrRecipient = "CDYNE Corporation"
PR.PrimaryAddressLine = "505 Independence Parkway"
PR.SecondaryAddressLine = "Suite 300"
PR.CityName = "Chesapeake"
PR.State = "VA"
PR.ZipCode = "23320"
PR.ReturnCaseSensitive = True
PR.ReturnCensusInfo = True
PR.ReturnCityAbbreviation = True
PR.ReturnGeoLocation = True
PR.ReturnLegislativeInfo = True
PR.ReturnMailingIndustryInfo = True
PR.ReturnResidentialIndicator = True
PR.ReturnStreetAbbreviated = True
 
Dim PavRes As New PavResponse
PavRes = PS.VerifyAddressAdvanced(PR)
 
'The return section below will output the return code with the return code text along with the address information.
'To view a list of all possible return codes: http://wiki.cdyne.com/index.php/PAVv3_Return_Codes
 
Console.WriteLine(
"Return Code: " & PavRes.ReturnCode & vbLf &
PavRes.FirmOrRecipient & vbLf &
PavRes.PrimaryDeliveryLine & vbLf &
PavRes.CityName & ", " &
PavRes.StateAbbreviation & " " &
PavRes.ZipCode & vbLf &
PavRes.Country)
 
Console.ReadLine()
 
End Sub
 
End Module
 
'Additional Return Fields:
 
'PavRes.CensusInfo
'PavRes.GeoLocationInfo
'PavRes.LegislativeInfo
'PavRes.MailingIndustryInfo
'PavRes.MultipleMatches
'PavRes.ResidentialDeliveryIndicator
'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.ReturnCodeSpecified
'PavRes.Secondary
'PavRes.SecondaryAbbreviation
'PavRes.SecondaryEO
'PavRes.SecondaryHigh
'PavRes.SecondaryLow
'PavRes.StreetName
'PavRes.Suffix
'PavRes.Urbanization

Verify Address

'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 
Imports VerifyAddress.WSDL
Module Module1
 
Sub Main()
 
Dim PSC As New PavServiceClient("pavsoap")
Dim PavAdd As New Address()
 
PavAdd = PSC.VerifyAddress("CDYNE Corporation", "505 Independence Parkway", "Suite 300", "", "Chesapeake", "Virginia", "23320", "YOUR LICENSE KEY")
 
'The return section below will output the return code with the return code text along with the address information.
'To view a list of all possible return codes: http://wiki.cdyne.com/index.php/PAVv3_Return_Codes
 
Console.WriteLine(
"Return Code: " & PavRes.ReturnCode & vbLf &
PavRes.FirmOrRecipient & vbLf &
PavRes.PrimaryDeliveryLine & vbLf &
PavRes.CityName & ", " &
PavRes.StateAbbreviation & " " &
PavRes.ZipCode & vbLf &
PavRes.Country)
 
Console.ReadLine()
 
End Sub
 
End Module
 
'Additional Return Fields:
 
'PavAdd.County
'PavAdd.Urbanization

Get Intelligent Mail Barcode

'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 
Imports GetIntelligentMailBarcode.WSDL
Module Module1
 
Sub Main()
 
Dim PSC As New PavServiceClient("pavsoap")
Dim IMB As New IntelligentBarcodeResponse
 
IMB = PSC.GetIntelligentMailBarcode("12", "123", "123456", "123456789", "dw/cKC9h9Au0zJy+WGvQkQ==", "YOUR LICENSE KEY")
 
If IMB.ReturnCode = 0 Then
Console.WriteLine("Barcode: " & IMB.Barcode)
 
ElseIf IMB.ReturnCode = 1 Then
Console.WriteLine("Invalid input.")
End If
 
Console.ReadLine()
 
End Sub
 
End Module

Get Zip Codes For Fips

'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 
Imports GetZipCodesForFips.WSDL
Module Module1
 
Sub Main()
 
Dim PSC As New PavServiceClient("pavsoap")
Dim ZCR As New ZipCodesResponse
 
ZCR = PSC.GetZipCodesForFips("51550", "YOUR LICENSE KEY")
 
If ZCR.ReturnCode = 0 Then
Console.WriteLine("Zip code(s) found: " & vbLf)
 
For Each Zip As String In ZCR.ZipCodes
Console.WriteLine(Zip)
Next
 
ElseIf ZCR.ReturnCode = 1 Then
Console.WriteLine("Invalid input.")
 
ElseIf ZCR.ReturnCode = 2 Then
Console.WriteLine("Invalid license key.")
 
ElseIf ZCR.ReturnCode = 3 Then
Console.WriteLine("No zip codes found.")
End If
 
Console.ReadLine()
 
End Sub
 
End Module

Get Zip Codes Within Distance

'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 
Imports GetZipCodesWithinDistance.WSDL
Module Module1
 
Sub Main()
 
Dim PSC As New PavServiceClient("pavsoap")
Dim ZCR As New ZipCodesResponse
 
ZCR = PSC.GetZipCodesWithinDistance("36.761560", "-76.259964", "5", "YOUR LICENSE KEY")
 
If ZCR.ReturnCode = 0 Then
Console.WriteLine("Zip code(s) found: " & vbLf)
 
For Each Zip As String In ZCR.ZipCodes
Console.WriteLine(Zip)
Next
 
ElseIf ZCR.ReturnCode = 1 Then
Console.WriteLine("Invalid input.")
 
ElseIf ZCR.ReturnCode = 2 Then
Console.WriteLine("Invalid license key.")
 
ElseIf ZCR.ReturnCode = 3 Then
Console.WriteLine("No match found.")
 
ElseIf ZCR.ReturnCode = 4 Then
Console.WriteLine("Outside of Latitude/Longitude range.")
End If
 
Console.ReadLine()
 
End Sub
 
End Module

Back to Postal_Address_Verification_V3

Personal tools
Namespaces

Variants
Actions
Navigation
Tools

Trial Key