Wow, Erik, I was not aware of that. I assumed it was a limitation of CFHTTP, not a shortcoming. Also, I didn't find this in the technote until now:

38383
Added the ability to perform raw HTTP posts using the cfhttp tag.


I'll have to try your method, Have you experienced any issues with this? I noticed you don't have a time-out. Do you have a back up just in case?


Thanks


-Igor
-cccfug.org

-----Original Message-----
From: Erik Yowell [mailto:[EMAIL PROTECTED]
Sent: Wednesday, November 05, 2003 11:40 AM
To: CF-Talk
Subject: RE: UPS XML Rates w/ DRK5 Socket Component

Socket communication is one way (ugly, but certainly works), but I
believe a majority of the HTTP problems were fixed with 6.1, as we've
implemented the UPS rate service and selection tool with CFHTTP with no
problems. The following code works fine for us -

<!--- Build UPS XML Packet --->

<cfsavecontent variable="XMLPacket"><cfoutput>

<?xml version="1.0"?>

<AccessRequest>

<AccessLicenseNumber>#AccessLicenseNumber#</AccessLicenseNumber>

            <UserId>#UserID#</UserId>

            <Password>#Password#</Password>

</AccessRequest>

<?xml version="1.0"?>

<RatingServiceSelectionRequest xml:lang="en-US">

<Request>

            <TransactionReference>

                        <CustomerContext>Rating and
Service</CustomerContext>

                        <XpciVersion>1.0001</XpciVersion>

            </TransactionReference>

            <RequestAction>Rate</RequestAction>

            <RequestOption>shop</RequestOption>

</Request>

<PickupType>

            <Code>01</Code>

</PickupType>

<Shipment>

            <Shipper>

            <Address>

<PostalCode>#attributes.originPostCode#</PostalCode>

                        <CountryCode>US</CountryCode>

            </Address>

            </Shipper>        

            <ShipTo>

                        <Address>

<PostalCode>#safePostalCode#</PostalCode>

                                    <City>#cityName#</City>

                                    <cfif Len(Trim(stateProvince)) GT
0><StateProvinceCode># stateProvince #</StateProvinceCode></cfif>

<CountryCode>#countryName#</CountryCode>

                        </Address>

            </ShipTo>         

            <Package>

                        <PackagingType>

                                    <Code>02</Code>

                                    <Description>Package</Description>

                        </PackagingType>

                        <Description>Rate Shopping</Description>

                        <PackageWeight>

                                    <Weight>#weight#</Weight>

                        </PackageWeight>

            </Package>

            <ShipmentServiceOptions/>

</Shipment>

</RatingServiceSelectionRequest></cfoutput></cfsavecontent>

<cfhttp   

            url = "">
            port = "443"   

            method = "POST"

            throwonerror="yes">

<cfhttpparam type="XML" value="#XMLPacket#">

</cfhttp>

<cfset XMLResponse = XmlParse(CFHTTP.FileContent)>

Erik Yowell

[EMAIL PROTECTED]

http://www.shortfusemedia.com

-----Original Message-----
From: Igor Ilyinsky [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 04, 2003 1:31 PM
To: CF-Talk
Subject: UPS XML Rates w/ DRK5 Socket Component

Hi Yall,

For a long time I've been looking for a good way to implement the usage
of UPS's XML based rates & service program to calculate shipping costs.
In the past, there were so many ways to do this, but they were all too
messy or tedious... i.e, not worth the simple functionality I required.
There were the custom tags that my host wouldn't let me use, the XML
hacks, or writing my own java method to do it. Everyone kept expecting
that CFMX would provide a cure but it hasn't.

The bottom line was that CF did not provide a developer with usage of a
Raw XML socket over HTTP as CFHTTP would f-up the buffer with all of its
headers. Well, now there is a component on the latest DRK that promises
to allow the raw XML Socket via the underlying java.net.Socket object.
It is called the socket component, and may just be the saving grace
here.

So has anyone used it to implement the UPS Rates & Services API? I'd be
curious to know if it works, the performance, and how it is implemented.
I think if this really does work, it will provide any developer using
CFMX 6.1 with a means to easily get real-time shipping rates with very
little programming, and for Macromedia, I think this component alone
will make buying DRK5 a great value. Furthermore, it promotes using the
underlying J2EE functionality to empower your CF app...

-Igor
-cccfug.org

  _____  

  _____  


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to