0 Replies Latest reply on May 9, 2006 4:31 AM by dtotal

    CFC return type XML

    dtotal Level 1
      Hi there,

      I'm using a remote CFC (gateway.cfc) as an interface to another public CFC (service.cfc). Service.cfc does a database search and returns RSS formatted XML to gateway.cfc. A stripped down version of the code is below:

      <cffunction name="search" access="remote" returntype="xml">
      <cfargument name="something" type="string" required="yes" />

      <cfinvoke component="service" method="webSearch" argumentcollection="#arguments#" returnvariable="rss" />
      <cfreturn rss />


      <cffunction name="webSearch" access="public" returntype="xml">
      <cfargument name="something" type="string" required="no">

      <cfxml variable="rss">
      <rss version="2.0">
      <link> http://www.somedomain.com</link>
      <pubDate>#DateFormat(Now(),"ddd, dd mm yyyy")#</pubDate>
      <title>Item Title</title>
      <link> http://www.somewhere.co.uk/</link>

      <!--- <cfdump var="#rss#" />
      <cfabort />--->

      <cfreturn rss />


      I invoke the web service using:

      The error returned is: "The value returned from function webSearch() is not of type xml". But, if you un-comment the CFDUMP and CFABORT, and run it again, it dumps out a properly formatted XML document.

      If you set service.webSearch as returntype="any" and gateway.search as returntype="string", it outputs this:

      Which appears to be a pointer or something!?

      So... does anyone know if it's possible return XML in this way? Or have I missed something obvious? (as usual)