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

Using webservice to pass xml

Status
Not open for further replies.

ericaalicen

Programmer
Dec 20, 2001
53
US
I'm using cfinvoke to pass an xml structure to a cfc. This seems to work fine if I use cfdump to output the XML. But when I try to parse the XML, I get an error "An error occured while Parsing an XML document."

At the moment, I'm creating and parsing my own XML data. And the code I use to create and parse the data works, until I pass it through the webservice. I've tried enclosing the XML in a toString() and that doesn't work.

This is my invoke statement.

Code:
<cfinvoke 
  webservice="[URL unfurl="true"]http://www.domain.com/temp/myComponent.cfc?wsdl"[/URL]
  method="setBatch"
  returnvariable="sService" header="#batchSummary#" myList="#myList#">
</cfinvoke>

And here's the .cfc it's calling.

Code:
<cfcomponent>
  <cffunction name="setBatch" returnType="void" access="remote">
    <cfargument name = "header" type = "xml">
    <cfargument name = "myList" type = "xml">
  <cfoutput>
  <cfdump var="#arguments.header#">
  <cfdump var="#arguments.myList#">
  <cfset tempObj = Trim(arguments.myList)>
	  
	<!-- parse our  xml data -->
	<cfset mydoc = XmlParse(#tempObj#)>
  </cfoutput>
  </cffunction>
</cfcomponent>

Any ideas?
 
I figured this out. It took awhile. Seems ColdFusion treats type="xml" as xml text not an xml object. I had to pass the xml as type="string" to be able to parse the xml.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top