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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfhttp and posting xml 1

Status
Not open for further replies.
You can use the <cfsavecontent> tag to save the XML as a variable then you can just send that var via cfhttp.

This is how i've done it before:
Code:
	  <cfsavecontent variable="send_leads">
			<soap:Envelope xmlns:xsi="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema-instance"[/URL] xmlns:xsd="[URL unfurl="true"]http://www.w3.org/2001/XMLSchema"[/URL] xmlns:soap="[URL unfurl="true"]http://schemas.xmlsoap.org/soap/envelope/">[/URL]
			  <soap:Body>
				[b]<Post xmlns="postingurl">[/b]
				  <user_Username>#user_Username#</user_Username>
				  <user_Password>#user_Password#</user_Password>
				  <user_IPAddress>#IPAddress#</user_IPAddress>
				  <_1800AID>42242</_1800AID>
				  <_1800BID></_1800BID>
				  <_1800CID>10803</_1800CID>
				  <_1800DID></_1800DID>
				  <_1800EID></_1800EID>
				  <_1800FID></_1800FID>
				  <_1800GID></_1800GID>
				  <_1800HID></_1800HID>
				  <_1800IID></_1800IID>
				  <_1800JID></_1800JID>
				  <_1800KID></_1800KID>
				  <_1800LID></_1800LID>
				  <_1800MID></_1800MID>
				  <_1800NID></_1800NID>
				  <_1800OID>681</_1800OID>
				  <_1800PID></_1800PID>
				  <_1800QID></_1800QID>
				  <_1800RID></_1800RID>
				  <_1800SID></_1800SID>
				  <_1800TID></_1800TID>
				  <_1800UID></_1800UID>
				  <_1800VID></_1800VID>
				  <_1800WID></_1800WID>
				  <_1800XID></_1800XID>
				  <_1800YID></_1800YID>
				  <_1800ZID></_1800ZID>
				</Post>
			  </soap:Body>
			</soap:Envelope>
	</cfsavecontent>
	<cfset toPost = #XmlParse(send_leads)#>

	<cfhttp url="[b]submissionurl[/b]" username="#user_Username#" password="#user_Password#" method="post">
	  [b]<cfhttpparam name="SOAPAction" type="HEADER" value="postingurl">[/b]
	  <cfhttpparam name="body" type="xml" value="#tostring(toPost)#">
	</cfhttp>

____________________________________
Just Imagine.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top