I have tryed your function, with code:

<cffunction name="getNavigation" access="remote" returntype="any"
output="false">
<cffile action="" file="c:\inetpub\wwwroot\tk\gb\data\data1.xml"
variable="myString">
<cfreturn xmlFormat(toString(myString))>
</cffunction>

Works fine. Try to copy above exactly, maybe it is your /> at the tag ends.
Check the actual XML file, what is in it. Etc. Function works fine on CF6.1

TK
http://www.tomkitta.com
  -----Original Message-----
  From: Christopher Dempsey [mailto:[EMAIL PROTECTED]
  Sent: Wednesday, June 02, 2004 11:03 AM
  To: CF-Talk
  Subject: RE: Returning XML via webservice, cont

  Oops, wrong version of the function.  Here is the right code:

  <cffunction name="getNavigation2" access="remote" returntype="any"
output="false">
  <cffile action="" file="D:\inetpub\wwwroot\ssoNavigation.xml"
variable="myString" />
  <cfreturn toString(myString) />
  </cffunction>

  On Wed, 2 Jun 2004, Tom Kitta wrote:

  > Why is your function return type "void" it should be "string" if you
want to
  > return a string[Tom Kitta] . Change it to string and give it a go.
  >
  > TK
  >   -----Original Message-----
  >   From: Chris Dempsey [mailto:[EMAIL PROTECTED]
  >   Sent: Wednesday, June 02, 2004 10:24 AM
  >   To: CF-Talk
  >   Subject: Returning XML via webservice, cont
  >
  >
  >   Dear List,
  >
  >   I saw this thread a few days ago, about returning an XML document as a
  >   string from a CFC.  I tried using returntype="any" and the toString()
  >   function - neither worked.  What ends up happening is that the XML
  >   document gets returned as a WDDX packet.  Is it possible to just
return
  >   it as a string, with no further changes?
  >
  >   Here is the XML doc: http://www.graddiv.ucsb.edu/ssoNavigation.xml
  >
  >   Here is the simplified CFC code:
  >
  >   <cfcomponent extends="base">
  >   <cffunction name="getNavigation" access="remote"
  >   returntype="void" output="false">
  >   <cffile action="" file="#path#ssoNavigation.xml"
  >   variable="myString" />
  >
  >   <cfreturn toString(myString) />
  >   </cffunction>
  >   </cfcomponent>
  >
  >   The cfc is located here: http://www.graddiv.ucsb.edu/sso.cfc
  >
  >   Thanks!
  >
  >   Chris
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to