Avatar of aescribens
aescribens

asked on 

HELP - Coldfuison XML Receiving and Parsing

Hello Experts,

I'm new to sending/receiving/parsing XML on .CFM pages.  I'm working with a vendor who receiveds my XML data and sends back a confirmation number also via XML to the same .CFM page that I used to send the data.  I'm current sending the XML data successfully, but I haven't been successful in receiving/parsing the XML response which contains the confirmation number.

I confirmed with the vendor that their resopnse is being sent to the same page where I'm posting the data.  Here is an example of the data that I'm successfully sending:

<cfhttp method="post" url="http://vendor.com/xml.jsp">
   <cfhttpparam type="header" name="Content-Type" value="text/xml" />
   <cfhttpparam type="xml" name="xmlDoc" value="
<MESSAGE>
<MESSAGE_CONTENT>
<MESSAGE_INFORMATION>
<BODY>Test XML.</BODY>
</MESSAGE_INFORMATION>
</MESSAGE_CONTENT>
</MESSAGE>
<VERSION>1.0</VERSION>"/>
</cfhttp>

According to the vendor, here is what I'm supposed to expect from them:

<?xml version="1.0" encoding="UTF-8" ?>
<MESSAGE>
<MESSAGE_CONTENT>
<MESSAGE_ID>0</MESSAGE_ID>
<RESPONSE_STATUS>300</RESPONSE_STATUS>
<RESPONSE_ID>1234</RESPONSE_ID>
</MESSAGE_CONTENT>
<VERSION>1</VERSION>
  </MESSAGE>

I'm using Coldfusion MX7 running on Windows 2003 Server.  This solution is very important, any help would be greatly appreciated !

Thanks,

Anthony
Web Servers

Avatar of undefined
Last Comment
dgrafx
ASKER CERTIFIED SOLUTION
Avatar of dgrafx
dgrafx
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of aescribens
aescribens

ASKER

dgrafx,

Thanks for your post and I apolagize for my late response.  What if I don't know the URL of the XML content as suggested by the following code:

<cfset urlAddress="http://www.macromedia.com/desdev/resources/macromedia_resources.xml">

Is there a way to have the page "Wait" for incoming XML Data Streams?  and Process them as they come?

Regards,

Anthony
Avatar of aescribens
aescribens

ASKER

Any more ideas?
Avatar of aescribens
aescribens

ASKER

Moderator,

Please close this questions and refund my points.

Thanks,

Anthony
Avatar of dgrafx
dgrafx
Flag of United States of America image

So now you're in a hurry ...

<<Is there a way to have the page "Wait" for incoming XML Data Streams>>
any page can run code when it is accessed, but you may be refering to a web service.
look up how to set this up in your cf docs

OR

the answer I posted showed you how to work with xml and coldfusion.
It uses cfhttp as an example only - it is not required that you get you xml from cfhttp.
once you have your xml - the example shows you how to parse it.
Avatar of aescribens
aescribens

ASKER

The example above didn't help because I believe we are getting a Raw XML reply back, not really an http reply.
Avatar of dgrafx
dgrafx
Flag of United States of America image

did you read the 2nd part of my last post?
Web Servers
Web Servers

A web server refers to the software that helps to deliver web content that can be accessed either through the Internet or through an intranet. The primary function of a web server is to store, process and deliver web pages to clients. The communication between client and server takes place using the Hypertext Transfer Protocol (HTTP). The most common use of web servers is to host websites, but there are other uses such as gaming, data storage, running enterprise applications, handling email, FTP, etc.

33K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo