OK correct me if I am wrong.

To use the UPS XML I need to use the following to connect to the UPS
server:

<cfhttp url="https://www.ups.com/ups.app/xml/Track"; method="POST"
port="443">

I also need the following to post the XML to the UPS server:
<cfhttpparam type="FORMFIELD" name="XML" value="#variables.xml#">

Then to return the results I just use:
#cfhttp.filecontent#

OK if I am right so far.  How should I prep the XML to send to UPS?
Should I use <cfxml>?

Here is the code I have so far for a custom tag, but I keep getting this
error from UPS: 0 Failure Hard 10002 The XML document is well formed but
the document is not valid TrackRequest

<cfparam name="Attributes.Licensenumber" default="">
<cfparam name="Attributes.UserId" default="">
<cfparam name="Attributes.Password" default="">
<cfparam name="Attributes.TrackingNumber" default="">

<cfxml variable="xml">
<AccessRequest xml:lang = "en-US"> 
        
<AccessLicenseNumber><cfoutput>#Attributes.licensenumber#</cfoutput></Ac
cessLicenseNumber> 
        <UserId><cfoutput>#Attributes.UserId#</cfoutput></UserId> 
        <Password><cfoutput>#Attributes.Password#</cfoutput></Password>
</AccessRequest> 
</cfxml>
<cfxml variable="xml2">
<TrackRequest xml:lang="en-US"> 
        <Request>
        <TransactionReference> 
                <CustomerContext></CustomerContext> 
                <XpciVersion>1.0001</XpciVersion> 
        </TransactionReference> 
        <RequestAction>Track</RequestAction> 
        <RequestOption></RequestOption> 
        </Request> 
        
<ShipmentIdentificationNumber><cfoutput>#Attributes.TrackingNumber#</cfo
utput></ShipmentIdentificationNumber> 
</TrackRequest>
</cfxml>

<cfhttp url="https://www.ups.com/ups.app/xml/Track"; method="POST"
port="443" resolveurl="false">
        <cfhttpparam type="FORMFIELD" name="XML"
value="#variables.xml#">
        <cfhttpparam type="FORMFIELD" name="XML"
value="#variables.xml2#">
</cfhttp>
        
<cfset caller.response = "#cfhttp.filecontent#">


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Reply via email to