Link to home
Start Free TrialLog in
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
ASKER CERTIFIED SOLUTION
Avatar of dgrafx
dgrafx
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
Any more ideas?
Moderator,

Please close this questions and refund my points.

Thanks,

Anthony
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.
The example above didn't help because I believe we are getting a Raw XML reply back, not really an http reply.
did you read the 2nd part of my last post?