14 Replies Latest reply on Oct 7, 2008 6:36 AM by Newsgroup_User

    Web Service

    mikey999
      hi,

      i am trying to learn how to do a web service.

      I used this example to figure this out
      http://www.quackit.com/coldfusion/tutorial/coldfusion_web_services.cfm

      my code is here
      http://www.climatetech.net/cti_webservice/Test_WebService.cfm

      Code
      ===============================================

      <cfinvoke
      method="listBooks"
      returnvariable="rawXMLFileList"
      webservice=" http://www.climatetech.net/WebService.cfc?wsdl">

      <cfinvokeargument name="category" value="123">
      </cfinvoke>

      <cfset FilesXML = XmlParse(rawXMLFileList)>

      <cfdump var="#FilesXML#">

      ========================================
      and my cfc file is here
      http://www.climatetech.net/cti_webservice/WebService.cfc

      code



      <cfcomponent>
      <cffunction name="listBooks"
      access="remote"
      returntype="string"
      output="no">

      <cfargument name="category"
      type="string"
      required="yes">

      <cfset Var FileList = "">
      <cfset Var getBooks = "">
      <cfquery name="getBooks" datasource="DS" maxrows=100 dbtype="ODBC">
      SELECT FileToolID,FileTitle, FileDescription, File3
      FROM FileTool
      Where FileTool.StatusID = 'Approved'
      AND FileTool.FileCONFIGID = 24
      </cfquery>
      <cfsavecontent variable="FileList">
      <Files>
      <cfoutput query="getBooks">
      <File id="#FileToolID#">
      <Filetitle>#XMLFormat(FileTitle)#</Filetitle>
      <FileLink> http://www.resourcesaver.org/file/toolmanager/#XMLFormat(File3)#</FileLink>
      <Description>#XMLFormat(FileDescription)#</Description>
      </File>
      </cfoutput>
      </Files>
      </cfsavecontent>

      <cfreturn FileList>
      </cffunction>
      </cfcomponent>


      =========================================================

      this is really basic but for some reason i can not get this to work. has any one set one of these up and made it work before. i have never done this before but i figure get a basic example working first to understand this.