Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using USPS Web Tools for Zip lookup
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01034524
Message ID:
01034675
Vues:
22
hello Dave

I have looked at it, but was not allowed to use it. You must be registered (you can do that through a link on their website there) wait for an approval (i think it took a day or 2 - the denail). you then can run your code through threir test server, once you done and tested they give you a divverent server name (i think) for the real-live server.

the problem, however, is that (the way i understand it) they whant only other websites to access those api's. this contradicts a bit what they write as a description on their api's - but oh well.

the code for this SHOULD look something like this (i got the error msg back with this telling me that i have no access to the server)
		XMLString = ;
			"<ZipCodeLookupRequest%20USERID='YourAssignUserId'%20PASSWORD='YourAssignedPassWord'>" + ;
			"<Address ID='0'>" + ;
			"<Address1> </Address1>" + ;
			"<Address2>6406 Ivy Lane</Address2>" + ;
			"<City>Greenbelt</City>" + ;
			"<State>MD</State>" + ;
			"</Address>" + ;
			"</ZipCodeLookupRequest>"

oUSPS = NEWOBJECT("wwipstuff", "wwipstuff")

WITH oUSPS
	* ***		.addpostkey("magic","21771")
	* ***		.addpostkey("zipcode",tcZip)
	?.HTTPGet("http://testing.shippingapis.com/ShippingAPITest.dll?API=" +APIName+ "&XML=" + XMLString)
ENDWITH

oUSPS = .NULL.
RELEASE oUSPS
as you can see, you'll need "wwipstuff" for my solution (in vfp6), with vfp8 there might be a different way.

if you do not get approved, there is another way. you can through a program tap on their web solution for this: "http://zip4.usps.com/zip4/zip4_responseA.jsp". call this web-form through your app, and then parse out the different values from the response. as you can read on the faq page, they will tollerate this approach as long as you do not miss-use it (bulk querries, etc.)

good luck.



>I am currently approaching brain death after 284 hours in June and it's still going so I am looking pretty blurry eyed and cognatively depraved :)
>Has anyone use the USPS Web Tools API interface for requesting either zip codes from submitting City and State OR address validation?
>
>I would greatly appreciate any sample code (the USPS site has sample VB code) as my deadline is tomorrow :(
>
>Thanks in advance for any sample VFP code or existing web service
>
>Dave
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform