Skip to main content
Inspiring
July 18, 2008
Answered

cfhttp problem

  • July 18, 2008
  • 1 reply
  • 455 views
I'm doing a REST request and if I put it directly into the address it works fine. But when I do a cfhttp request it throws an error.

The column name "45123114097Montgomery Ward104755Tue Jul 01 19:31:29 GMT 2008D1817PKUG 8 Audiovox? Portable DVD Player Package Home Electronics DVD & Home Theater 249.99Audiovox? Portable DVD Player PackagesThe perfect package for the person on the go. The system includes a" is invalid.
Column names must be valid variable names. They must start with a letter and can only include letters, numbers, and underscores.

Here is what the actual XML page looks like:

<?xml version="1.0" encoding="UTF-8" ?>
<result>
<TotalMatches>451</TotalMatches>
<TotalPages>23</TotalPages>
<PageNumber>1</PageNumber>
<item>
<mid>14097</mid>
<merchantname>Montgomery Ward</merchantname>
<linkid>104755</linkid>
<createdon>Tue Jul 01 19:31:29 GMT 2008</createdon>
<sku>D1817PKUG</sku>
<productname>8 Audiovox? Portable DVD Player Package</productname>
<category>
<primary>Home Electronics</primary>
<secondary>DVD & Home Theater</secondary>
</category>
<price currency="USD">249.99</price>
<upccode />
<description>
<short>Audiovox? Portable DVD Player Packages</short>
<long>The perfect package for the person on the go. The system includes a, 16:9 aspect ratio portable DVD player with built-in stereo speakers, two folding headphones, car headrest mounting bag/carrying case, high capacity rechargeable battery and credit-card-size remote. Complete cabling with car power adapter. Plays DVD, CD, MP3, CDR, CDRW and picture CDs. 7 player is 7-7/8W x 6D x 1-1/2H. 8 player is 9-1/4W x 7D x 1-3/8H. UL listed. Imported.</long>
</description>
<keywords />
<linkurl> http://click.linksynergy.com/fs-bin/click?id=pB75s*fErHM&offerid=113018.104755&type=15&subid=0</linkurl>
<imageurl> http://www.Wards.com/lycosimages/58276_f.jpg</imageurl>
</item>
and on to the next product.

Here is my code:
<cfhttp name="LinkShare"
url="#theRequest#"
proxyport="#application.proxyPort#"
proxyserver="#application.proxyAddress#"
charset="utf-8"></cfhttp>

Now obviously this code works as far as getting to the url and getting a response. But it is not seeing it as xml as far as I can tell because it is going to the first node's text and thinking that is the column name. It is doing this right in the HTTP request so I can't manipulate the data at all.

Help?
This topic has been closed for replies.
Correct answer Dinghus
Okay, I figured this one out. I had to actually use the "columns" attribute and list all the "columns". Never had that problem before but that is what worked.

1 reply

DinghusAuthorCorrect answer
Inspiring
July 18, 2008
Okay, I figured this one out. I had to actually use the "columns" attribute and list all the "columns". Never had that problem before but that is what worked.