Skip to main content
Participant
April 25, 2008
Question

beginner question about xml, coldfusion 8 & shipping quotes

  • April 25, 2008
  • 1 reply
  • 361 views
Hello,

I do work in Coldfusion but I still consider myself a beginner.
I know little about xml
My website is written in Coldfusion 8
My site has a shopping cart and we are almost ready to go live soon.

I am trying to create a connection to freightquote.com to have instant quotes for my site shipping.
Their server is apparently asp.

However they sent me a pdf reference guide with xml code inside with very little instructions and they referred to this as a “plug in”. They said they could not help us with any of the code beyond what they gave me and that’s understandable.

I was told by some I should of wrote the site in PHP or other languages and I don’t want to do that.

I purchased books & CBT’s in xml but none of the material seems to “address” the issue (or addresses it vaguely) of shipping quotes online and xml-Especially with coldfusion.

Google produces results for ups & fedex code only.

My questions are:
do I have to “re-invent” the wheel in order to get this to interact with my coldfusion site?

Has anyone else dealt with freightquote.com and their “pdf plugin”? ( i have to use freightquote.com)

Does anyone know of some free Coldfusion-xml-quoting page code I could peek at to pick apart for ideas?

Any kind help is appreciated.

Thank you
This topic has been closed for replies.

1 reply

Inspiring
April 25, 2008
No, I have never used freightquote.com. But I have used CF combined
with XML in many ways.

It sounds like you have an xml packet that needs to be delivered to
freightquote.com. CF has plenty of capability to easily create xml
content. Just build it according to their specification.

Without a little more concrete example I can not offer more detailed help.
Inspiring
April 28, 2008
There are still some unknowns here but here it the first thing I would try.

First of all XML is simply text structured data using <tags> to describe
the data, somewhat similar to HTML.

Looking at the little data you have provide me, it looks like they want
an XML document, but it could also be a set of HTTP names & values. I
would try the XML first.

You can use several of ColdFusion's XML tags and functions to build
this. A couple of the easiest are <cfxml...> or <cfsavecontent...>.
The former is very straight forward, but the latter allows more control
of XML doc types, ect. Either way the basic structure would be the same.

<cfxml...>|<cfsavecontent...>
<somedate>#someDate#</somedate>
<customeremail>#customeremail#</customeremail>
<customername>#customername#</customeremail>
</cfxml>|</cfsavecontent>

I would then attempt to send this XML data to the required URL with
<cfhttp...>.

If this works you will receive the response in the #cfhttp.filecontent#
variable. This can then be parsed as normal. The usual first step it
to parse it into an CF XML object with the parseXML() function.

<cfset myXMLobj = parseXML(cfhttp.filecontent)>

You can then dump this object and work from the using normal structure
and array notation and functions to access the various data elements.


Participating Frequently
May 1, 2008
Thank you very much for your help. Your advice worked like a charm. I could not of done it without you.