PAVv3 VB.Net

From CDYNE Wiki
Jump to navigation Jump to search

Get Congressional District By Zip

 1 'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 2 
 3 Imports GetCongressionalDistrictByZip.WSDL
 4 Module Module1
 5 
 6     Sub Main()
 7 
 8         Dim PSC As New PavServiceClient("pavsoap")
 9         Dim CDR As New CongressionalDistrictResponse
10 
11         CDR = PSC.GetCongressionalDistrictByZip("23320", "YOUR LICENSE KEY")
12 
13         If CDR.ReturnCode = 0 Then
14             Console.WriteLine("Congressional District Found: " + CDR.CongressionalDistrict)
15 
16         ElseIf CDR.ReturnCode = 1 Then
17             Console.WriteLine("Invalid input.")
18 
19         ElseIf CDR.ReturnCode = 2 Then
20             Console.WriteLine("Invalid license key.")
21 
22         ElseIf CDR.ReturnCode = 3 Then
23             Console.WriteLine("Congressional District not found.")
24 
25         ElseIf CDR.ReturnCode = 4 Then
26             Console.WriteLine("Multiple Congressional Districts Found:" & vbLf)
27 
28             For Each CongressionalDistrict As [Char] In CDR.CongressionalDistrict
29                 Console.WriteLine(CDR.CongressionalDistrict)
30             Next
31         End If
32 
33         Console.ReadLine()
34 
35     End Sub
36 
37 End Module

Get City Names For Zip Code

 1 'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 2 
 3 Imports GetCityNamesForZipCode.WSDL
 4 Module Module1
 5 
 6     Sub Main()
 7 
 8         Dim PSC As New PavServiceClient("pavsoap")
 9         Dim CNR As New CityNamesResponse
10 
11         CNR = PSC.GetCityNamesForZipCode("23320", "YOUR LICENSE KEY")
12 
13         If CNR.ReturnCode = 0 Then
14             Console.WriteLine("City Name: " & vbLf)
15 
16             For Each city As WSDL.City In CNR.CityNames
17                 Console.WriteLine(city.Name)
18             Next
19 
20         ElseIf CNR.ReturnCode = 1 Then
21             Console.WriteLine("Invalid input.")
22 
23         ElseIf CNR.ReturnCode = 2 Then
24             Console.WriteLine("Invalid license key.")
25 
26         ElseIf CNR.ReturnCode = 3 Then
27             Console.WriteLine("No match found.")
28         End If
29 
30         Console.ReadLine()
31 
32     End Sub
33 
34 End Module

Get Zip Codes For City And State

 1 'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 2 
 3 Imports GetZipCodesForCityAndState.WSDL
 4 Module Module1
 5 
 6     Sub Main()
 7 
 8         Dim PSC As New PavServiceClient("pavsoap")
 9         Dim ZCR As New ZipCodesResponse
10 
11         ZCR = PSC.GetZipCodesForCityAndState("Chesapeake", "VA", "YOUR LICENSE KEY")
12 
13         If ZCR.ReturnCode = 0 Then
14             Console.WriteLine("Zip code(s) found: " & vbLf)
15 
16             For Each Zip As String In ZCR.ZipCodes
17                 Console.WriteLine(Zip)
18             Next
19 
20         ElseIf ZCR.ReturnCode = 1 Then
21             Console.WriteLine("Invalid input.")
22 
23         ElseIf ZCR.ReturnCode = 2 Then
24             Console.WriteLine("Invalid license key.")
25 
26         ElseIf ZCR.ReturnCode = 3 Then
27             Console.WriteLine("No match found.")
28         End If
29 
30         Console.ReadLine()
31 
32     End Sub
33 
34 End Module

Get Urbanization List For Zip Code

 1 'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 2 
 3 Imports GetUrbanizationListForZipCode.WSDL
 4 Module Module1
 5 
 6     Sub Main()
 7 
 8         Dim PSC As New PavServiceClient("pavsoap")
 9         Dim UR As New UrbanizationResponse
10 
11         UR = PSC.GetUrbanizationListForZipCode("23320", "YOUR LICENSE KEY")
12 
13         If UR.ReturnCode = 0 Then
14             Console.WriteLine("Urbanization Names Found: " & vbLf)
15 
16             For Each Urban As String In UR.UrbanizationList
17                 Console.WriteLine(Urban)
18             Next
19 
20         ElseIf UR.ReturnCode = 1 Then
21             Console.WriteLine("Invalid input.")
22 
23         ElseIf UR.ReturnCode = 2 Then
24             Console.WriteLine("Invalid license key.")
25 
26         ElseIf UR.ReturnCode = 3 Then
27             Console.WriteLine("No match found.")
28         End If
29 
30         Console.ReadLine()
31 
32     End Sub
33 
34 End Module

Verify Address Advanced

 1 'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 2 
 3 Imports VerifyAddressAdvanced.WSDL
 4 Module Module1
 5 
 6     Sub Main()
 7 
 8         Dim PS As New PavServiceClient("pavsoap")
 9         Dim PR As New PavRequest
10 
11         PR.LicenseKey = "YOUR LICENSE KEY"
12         PR.FirmOrRecipient = "CDYNE Corporation"
13         PR.PrimaryAddressLine = "505 Independence Parkway"
14         PR.SecondaryAddressLine = "Suite 300"
15         PR.CityName = "Chesapeake"
16         PR.State = "VA"
17         PR.ZipCode = "23320"
18         PR.ReturnCaseSensitive = True
19         PR.ReturnCensusInfo = True
20         PR.ReturnCityAbbreviation = True
21         PR.ReturnGeoLocation = True
22         PR.ReturnLegislativeInfo = True
23         PR.ReturnMailingIndustryInfo = True
24         PR.ReturnResidentialIndicator = True
25         PR.ReturnStreetAbbreviated = True
26 
27         Dim PavRes As New PavResponse
28         PavRes = PS.VerifyAddressAdvanced(PR)
29 
30         'The return section below will output the return code with the return code text along with the address information.  
31         'To view a list of all possible return codes: http://wiki.cdyne.com/index.php/PAVv3_Return_Codes
32 
33         Console.WriteLine(
34             "Return Code: " & PavRes.ReturnCode & vbLf &
35             PavRes.FirmOrRecipient & vbLf &
36             PavRes.PrimaryDeliveryLine & vbLf &
37             PavRes.CityName & ", " &
38             PavRes.StateAbbreviation & "  " &
39             PavRes.ZipCode & vbLf &
40             PavRes.Country)
41 
42         Console.ReadLine()
43 
44     End Sub
45 
46 End Module
47 
48 'Additional Return Fields:
49 
50 'PavRes.CensusInfo
51 'PavRes.GeoLocationInfo
52 'PavRes.LegislativeInfo
53 'PavRes.MailingIndustryInfo
54 'PavRes.MultipleMatches
55 'PavRes.ResidentialDeliveryIndicator
56 'PavRes.County
57 'PavRes.CountyNum
58 'PavRes.FinanceNumber
59 'PavRes.IntelligentMailBarcodeKey
60 'PavRes.PMBDesignator
61 'PavRes.PMBNumber
62 'PavRes.PostDirectional
63 'PavRes.PostnetBarcode
64 'PavRes.PreDirectional
65 'PavRes.PreferredCityName
66 'PavRes.Primary
67 'PavRes.PrimaryEO
68 'PavRes.PrimaryHigh
69 'PavRes.PrimaryLow
70 'PavRes.ReturnCodeSpecified
71 'PavRes.Secondary
72 'PavRes.SecondaryAbbreviation
73 'PavRes.SecondaryEO
74 'PavRes.SecondaryHigh
75 'PavRes.SecondaryLow
76 'PavRes.StreetName
77 'PavRes.Suffix
78 'PavRes.Urbanization

Verify Address

 1 'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 2 
 3 Imports VerifyAddress.WSDL
 4 Module Module1
 5 
 6     Sub Main()
 7 
 8         Dim PSC As New PavServiceClient("pavsoap")
 9         Dim PavAdd As New Address()
10 
11         PavAdd = PSC.VerifyAddress("CDYNE Corporation", "505 Independence Parkway", "Suite 300", "", "Chesapeake", "Virginia", "23320", "YOUR LICENSE KEY")
12 
13         'The return section below will output the return code with the return code text along with the address information.  
14         'To view a list of all possible return codes: http://wiki.cdyne.com/index.php/PAVv3_Return_Codes
15 
16            Console.WriteLine(
17             "Return Code: " & PavRes.ReturnCode & vbLf &
18             PavRes.FirmOrRecipient & vbLf &
19             PavRes.PrimaryDeliveryLine & vbLf &
20             PavRes.CityName & ", " &
21             PavRes.StateAbbreviation & "  " &
22             PavRes.ZipCode & vbLf &
23             PavRes.Country)
24 
25         Console.ReadLine()
26 
27     End Sub
28 
29 End Module
30 
31 'Additional Return Fields:
32 
33 'PavAdd.County
34 'PavAdd.Urbanization

Get Intelligent Mail Barcode

 1 'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 2 
 3 Imports GetIntelligentMailBarcode.WSDL
 4 Module Module1
 5 
 6     Sub Main()
 7 
 8         Dim PSC As New PavServiceClient("pavsoap")
 9         Dim IMB As New IntelligentBarcodeResponse
10 
11         IMB = PSC.GetIntelligentMailBarcode("12", "123", "123456", "123456789", "dw/cKC9h9Au0zJy+WGvQkQ==", "YOUR LICENSE KEY")
12 
13         If IMB.ReturnCode = 0 Then
14             Console.WriteLine("Barcode: " & IMB.Barcode)
15 
16         ElseIf IMB.ReturnCode = 1 Then
17             Console.WriteLine("Invalid input.")
18         End If
19 
20         Console.ReadLine()
21 
22     End Sub
23 
24 End Module

Get Zip Codes For Fips

 1 'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 2 
 3 Imports GetZipCodesForFips.WSDL
 4 Module Module1
 5 
 6     Sub Main()
 7 
 8         Dim PSC As New PavServiceClient("pavsoap")
 9         Dim ZCR As New ZipCodesResponse
10 
11         ZCR = PSC.GetZipCodesForFips("51550", "YOUR LICENSE KEY")
12 
13         If ZCR.ReturnCode = 0 Then
14             Console.WriteLine("Zip code(s) found: " & vbLf)
15 
16             For Each Zip As String In ZCR.ZipCodes
17                 Console.WriteLine(Zip)
18             Next
19 
20         ElseIf ZCR.ReturnCode = 1 Then
21             Console.WriteLine("Invalid input.")
22 
23         ElseIf ZCR.ReturnCode = 2 Then
24             Console.WriteLine("Invalid license key.")
25 
26         ElseIf ZCR.ReturnCode = 3 Then
27             Console.WriteLine("No zip codes found.")
28         End If
29 
30         Console.ReadLine()
31 
32     End Sub
33 
34 End Module

Get Zip Codes Within Distance

 1 'http://pav3.cdyne.com/PavService.svc?wsdl was added as Service Reference and given the name WSDL
 2 
 3 Imports GetZipCodesWithinDistance.WSDL
 4 Module Module1
 5 
 6     Sub Main()
 7 
 8         Dim PSC As New PavServiceClient("pavsoap")
 9         Dim ZCR As New ZipCodesResponse
10 
11         ZCR = PSC.GetZipCodesWithinDistance("36.761560", "-76.259964", "5", "YOUR LICENSE KEY")
12 
13         If ZCR.ReturnCode = 0 Then
14             Console.WriteLine("Zip code(s) found: " & vbLf)
15 
16             For Each Zip As String In ZCR.ZipCodes
17                 Console.WriteLine(Zip)
18             Next
19 
20         ElseIf ZCR.ReturnCode = 1 Then
21             Console.WriteLine("Invalid input.")
22 
23         ElseIf ZCR.ReturnCode = 2 Then
24             Console.WriteLine("Invalid license key.")
25 
26         ElseIf ZCR.ReturnCode = 3 Then
27             Console.WriteLine("No match found.")
28 
29         ElseIf ZCR.ReturnCode = 4 Then
30             Console.WriteLine("Outside of Latitude/Longitude range.")
31         End If
32 
33         Console.ReadLine()
34 
35     End Sub
36 
37 End Module

Back to Postal_Address_Verification_V3