PAVv3 RUBY

From CDYNE Wiki
Jump to navigation Jump to search

Verify Address

 1 require 'net/http'
 2 require 'uri' 
 3 require "rexml/document"
 4 
 5 include REXML
 6 
 7 puts URI.methods 
 8 url = URI.parse('http://pav3.cdyne.com/PavService.svc/VerifyAddress?"
 9                     			&FirmOrRecipient=CDYNE Corporation
10                     			&PrimaryAddressLine=505 Independence Parkway
11                     			&SecondaryAddressLine=Suite 300
12 				        &Urbanization=
13                      			&CityName=Chesapeake
14                     			&State=Virginia
15 				        &ZipCode=23320
16                     			&LicenseKey= f01d89fd-5155-5455-5585-e84ab8de8591')
17 
18 res = Net::HTTP.get_response(url) 
19 data = res.body 
20 
21 souce = data
22 
23 doc = Document.new(data)
24 doc.write(targetstr = "", 2)
25 
26 puts targetstr
27 gets targetstr