Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using CFHHTP to submit XML

cfhttp

Using CFHHTP to submit XML

by  GUJUm0deL  Posted    (Edited  )
We take the XML content and enclose them inside of a <cfsavecontent> tag. Doing so just encapsulates the entire XML data as one big string.
Code:
[color red]
<cfsavecontent variable="submission">
<?xml version='1.0'?><Lead 
type='TITLE'><DATA1><option1>#text#</option1><option2>#text2
#</option2></DATA1><DATA2><fname>#FirstName#</fname><lname>#
LastName#</lname><addr>#Address#</addr><city>#City#</city><s
tate>#State#</state><zip>#Zip#</zip></DATA2><DATA3><filetype
/><leadinshowmuch/></DATA3></TITLE>
</cfsavecontent>
[/color]

Then we use the <cfhttp> tag to submit the data. Using the POST method, and one CFHTTPPARAM to submit the data in.
Code:
[color green]
  <cfhttp method="post" url="http://www.somesite.com/page1.aspx" throwonerror="no">
    <cfhttpparam name="vSending" type="xml" value="#submission#">
  </cfhttp>
[/color]

This technique worked like a charm.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top