• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 25. Integrating with .NET > ColdFusion Web Service (Returning a Complex...

ColdFusion Web Service (Returning a Complex Type)

Next we will return a ColdFusion query via a Web service, to a calling ASP.NET function. First let's create our CFC, which will contain the remote function (Listing 25.6).

Listing 25.6. NameService.cfc

<cfcomponent>
  <cffunction access="remote" 
   name="GetNames" 
   output="false" 
   returntype="query" 
   displayname="GetNames" 
   hint="This function accepts a string filter and returns a query.">
   <cfargument name="sFilter" type="string" required="true" />
   <cfquery name="result" datasource="names">
       SELECT * 
       FROM [names]
       WHERE name LIKE '#sFilter#%'
   </cfquery>
   <cfreturn result>
  </cffunction>
</cfcomponent>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint