Google Groups Home
Help | Sign in
CF5, CFHTTP, & XML
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  8 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Ubqtous  
View profile
 More options Jun 10, 8:49 pm
From: Ubqtous <ubqt...@gmail.com>
Date: Tue, 10 Jun 2008 17:49:49 -0700
Local: Tues, Jun 10 2008 8:49 pm
Subject: CF5, CFHTTP, & XML
Hello all,

I'm trying to integrate with UPS' Online Tools in order to get
shipping rates. The problem I'm running into appears to be specific to
ColdFusion 5 as my code runs fine on CF7. Basically, UPS doesn't like
my XML when sent via CF5, but it's fine with that same XML when sent
via CF7. Unfortunately, this needs to work on CF5 :\

This code fails to return the desired response on CF5...
<cfhttp url="#request.getURL()#" method="post">
<cfhttpparam type="formfield" name="data"
value="#accessRequestXML##ratingServiceSelectionRequestXML#">
</cfhttp>

...while this code works fine on CF7:
<cfhttp url="#request.getURL()#" method="post">
<cfhttpparam type="xml" name="data"
value="#accessRequestXML##ratingServiceSelectionRequestXML#">
</cfhttp>

I have a feeling it has something to do CF5's non-existent
<cfhttp>/<cfhttpparam> options with regards to content type, character
sets, etc.  

Any ideas?

--
Ubqtous


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Sami Hoda  
View profile
 More options Jun 10, 11:44 pm
From: "Sami Hoda" <samih...@gmail.com>
Date: Tue, 10 Jun 2008 20:44:04 -0700
Local: Tues, Jun 10 2008 11:44 pm
Subject: Re: [IECFUG] CF5, CFHTTP, & XML

Wow, thats a tough one. If it was MX, possibly you could have used the
underlying JAVA. Maybe there's an old cfx tag that would do the trick?

Sami


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oğuz Demirkapı  
View profile
 More options Jun 11, 12:44 am
From: "Oğuz Demirkapı" <demirk...@gmail.com>
Date: Wed, 11 Jun 2008 00:44:32 -0400
Local: Wed, Jun 11 2008 12:44 am
Subject: Re: [IECFUG] Re: CF5, CFHTTP, & XML

You can check the SOXML that we were using CF5.

http://www.siteobjects.com/siteobjects/soxml/

Be also careful to format all XML output with utf8 charset.

2008/6/10 Sami Hoda <samih...@gmail.com>:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ubqtous  
View profile
 More options Jun 11, 2:01 am
From: Ubqtous <ubqt...@gmail.com>
Date: Tue, 10 Jun 2008 23:01:50 -0700
Local: Wed, Jun 11 2008 2:01 am
Subject: Re: [IECFUG] Re: CF5, CFHTTP, & XML
Oğuz,

I too have a feeling that this is a charset issue. CF5 uses ISO-8859-1
while CF7 uses UTF-8, which is probably why my code runs as is on CF7.

I tried using <cfcontent type="text/html; charset=UTF-8"> to change
the charset for the page generating and posting the XML, but it had no
effect.

On Wed, 11 Jun 2008 00:44:32 -0400, you wrote:

OD> Be also careful to format all XML output with utf8 charset.

--
Ubqtous

<)) "I Can't Get Behind That!" by Henry Rollins from "Talk Is Cheap
Vol. 4"


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ezra Parker  
View profile
 More options Jun 11, 3:41 am
From: Ezra Parker <ezrapar...@gmail.com>
Date: Wed, 11 Jun 2008 00:41:50 -0700 (PDT)
Local: Wed, Jun 11 2008 3:41 am
Subject: Re: CF5, CFHTTP, & XML
Ubqtous --

I suspect that the issue runs deeper than that -- according to the CF
7 docs, the XML type for cfhttpparam does several things that I do not
think are supported in CF 5:

> XML: identifies the request as having a content-type of text/xml. Specifies that the value attribute contains the body of the HTTP request. Used to send XML to the destination URL. ColdFusion does not URL encode the XML data.

In other words, in order to work in the same manner, the HTTP request
in CF 5 must have a content-type of text/xml (with the UTF-8 charset,
as Oğuz indicated), the content must not be URL encoded, and the XML
should comprise the body of the request.

This last item is significant because I do not believe that there is
any way to send a POST in CF 5 that has body content in the proper
format for your needs. The formfield type is not going to work, as it
will send data in URL encoded name-value pairs, e.g.:

data=[URL encoded XML]

So even if you could work around the content-type issue (you can set
values in the CGI scope in place of actual header support, but if CF 5
implements the CGI type in the same way that CF 7 does, then URL
encoding may break content-type values), I don't think your XML data
will arrive at the destination as valid XML.

I think Sami is on the right track, as you will probably need to look
outside CF's core functionality for this task.

I hope that helps,

--
Ezra Parker

On Jun 10, 11:01 pm, Ubqtous <ubqt...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ubqtous  
View profile
 More options Jun 11, 11:51 am
From: Ubqtous <ubqt...@gmail.com>
Date: Wed, 11 Jun 2008 08:51:13 -0700
Local: Wed, Jun 11 2008 11:51 am
Subject: Re: [IECFUG] Re: CF5, CFHTTP, & XML
Ezra,

Thanks for the summation. I suspected that it was something like that,
but was hoping nonetheless for a work-around.

I'll reply to this thread if I find something that works.

--
Ubqtous


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Oğuz Demirkapı  
View profile
 More options Jun 11, 2:19 pm
From: "Oğuz Demirkapı" <demirk...@gmail.com>
Date: Wed, 11 Jun 2008 14:19:46 -0400
Local: Wed, Jun 11 2008 2:19 pm
Subject: Re: [IECFUG] Re: CF5, CFHTTP, & XML

I really do not have any CF5 installation around to test it and could not
say anything about the result. Sorry.

Have you tried SoXML?

2008/6/11 Ubqtous <ubqt...@gmail.com>:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Ubqtous  
View profile
 More options Jun 11, 6:34 pm
From: Ubqtous <ubqt...@gmail.com>
Date: Wed, 11 Jun 2008 15:34:28 -0700
Local: Wed, Jun 11 2008 6:34 pm
Subject: Re: [IECFUG] Re: CF5, CFHTTP, & XML
Oğuz,

The issue isn't with XML preparation or parsing as far as I can tell,
it is with the transmission of the XML to UPS. <cfhttp> on CF5 doesn't
provide the means to transmit XML in the necessary manner (text/xml;
UTF-8; non-URL-encoded; no name-value pair in the post, just value).

I think I'm SOL :)

On Wed, 11 Jun 2008 14:19:46 -0400, you wrote:

OD> Have you tried SoXML?

--
Ubqtous


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google