Hi Everyone - I posted this on the Adobe forums but have so far had no luck
with any responses.
I'm having trouble with coldfusion web services and am hoping that someone here
can reproduce this error and provide some insight to this issue.
I'm trying to create a web service, and in the web service it takes an XML
object as an argument. Inside the web service code I want to convert the XML
object to a string so I can store it in a database. The problem is that
whenever I convert the xml object to a string (using the ToString(xmlobj)
method) in the web service call, it returns the xml string as '[#document:
null]'. However, when I perform the same operation on the test page that is
calling the web service, it converts the xml object correctly to a string with
the raw XML.
I am using ColdFusion MX 7 version 7,0,2,142559
If you can reproduce this error, please let me know. If you have a solution,
please!!!! let me know. This is very frustrating... I've been battling this
issue for about a day now.
I can work around this issue by passing the XML as a straight up string and
then perform an XMLParse() on the web service, but that is borderline
unacceptable.
Please see the sample code below.
Webservice Component:
<cfcomponent output="false">
<cffunction access="remote" returntype="string" name="XmlToString">
<cfargument type="xml" required="true" name="XmlObject">
<cfreturn tostring(XmlObject)>
</cffunction>
</cfcomponent>
Test Page:
<cfsavecontent variable="xmltext">
<RootNode>
<ChildNode>123</ChildNode>
<AnotherChildNode>123</AnotherChildNode>
</RootNode>
</cfsavecontent>
<cfscript>
ws =
createobject("webservice","http://ksykora.clay/WebService.cfc?wsdl");
xmlObject = xmlparse(xmltext);
result = ws.XmlToString(xmlObject);
</cfscript>
<cfoutput>WebService Result: #HTMLEditFormat(result)#</cfoutput><br />
<cfoutput>Expected Result: #HTMLEditFormat(ToString(xmlObject))#</cfoutput>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Create Web Applications With ColdFusion MX7 & Flex 2.
Build powerful, scalable RIAs. Free Trial
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJS
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:279089
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4