Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Retrieve UPS Rates
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Applications Internet
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01356313
Message ID:
01359050
Vues:
34
>I need to write a function that gets real UPS rates into my order entry system written in VFP. I'm just getting started and I'm wondering is the best approach to use UPS Online Tools or some type of OLE automation with WorldShip. All of the CS reps have Worldship installed and internet access. Just not sure which is the best approach. I want to feed it weight, service, zip and get get the rate.
>
>Has anybody done this? Got any examples? Thanks!

UPS should have an XML request response web service. If so, use the HTTP Object:
oHTTP=CREATEOBJECT("MSXML2.ServerXMLHTTP.4.0")
And the form a UPS prescribed url to service your request:
oHTTP.Open("GET",lcURL,.f.)
oHTTP.Send("")
oHTTP.waitForResponse
lcReturn=oHTTP.responseText
oHTTP.abort
The XML string is in lcReturn. Some services have "garbage" and white spaces in their return strings, so you might need to clean them:
PROCEDURE cleanXML(strCSS)
strCSS=STRTRAN(strCSS,CHR(13),[])
strCSS=STRTRAN(strCSS,CHR(10),[])
strCSS=STRTRAN(strCSS,CHR(9),[])
strCSS=STRTRAN(strCSS,[    ],[])
RETURN strCSS
ENDPROC
Imagination is more important than knowledge
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform