Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

http response

Guest
Mar 14, 2007 Mar 14, 2007
So . . . I post a https successfully. I get an OK and ticket id in return. How do I get the second returned node? I know how to parse the xml, but I don't know how to set a variable for each returned value. Please help.

<cfset myXMLdoc = XMLParse(cfhttp.filecontent)>

I'm making this up to give an example of what I hope to do:
<cfset approval = cfhttp.status> ??
<cfset ticketid = cfhttp.ticketid> ??
TOPICS
Getting started
678
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Mar 15, 2007 Mar 15, 2007
The output turned out to be so simple. It's amazing how long I had to search for this answer. I hope this helps someone else:

<cfset MyDoc = XMLParse(CFHTTP.FileContent)>

<cfset response = MyDoc.xmlRoot.XmlChildren[2]>

<cfoutput>#variables.response#</cfoutput>
Translate
Engaged ,
Mar 14, 2007 Mar 14, 2007
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 14, 2007 Mar 14, 2007
Is it possible to set column names within cfhttp if the method="post"? The column names being the nodes in the response string.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 15, 2007 Mar 15, 2007
I tried both of these examples. I received errors. I don't think I understand. In the example they gave, would "author" in #item.author.xmltext# be the name of the returned DOM?

<strong>Author</strong>  #item.author.xmltext#<br>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 15, 2007 Mar 15, 2007
The output turned out to be so simple. It's amazing how long I had to search for this answer. I hope this helps someone else:

<cfset MyDoc = XMLParse(CFHTTP.FileContent)>

<cfset response = MyDoc.xmlRoot.XmlChildren[2]>

<cfoutput>#variables.response#</cfoutput>
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 15, 2007 Mar 15, 2007
<cfset MyDoc = XMLParse(CFHTTP.FileContent)>
<cfset response = MyDoc.xmlRoot.XmlChildren[2]>
<cfoutput>#variables.response#</cfoutput>


I suspect that wouldn't work. These would

<cfset response = MyDoc.xmlRoot.XmlChildren[2].XmlName>
<cfset response = MyDoc.xmlRoot.XmlChildren[2].XmlText>





Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 16, 2007 Mar 16, 2007
LATEST
It did work, so I thought. It gave me the output value which "appeared" to be correct. It evidently was still outputting in the wrong format? I'm not sure I understand why it looked like the right output, but it actually wasn't. Is that due to the format it was in?

Your additional information finished what I needed. Thank you!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources