Do you have a good understanding of OOP encapsulation?  If you're looking for the 
properties of this object, you won't be able to get to them using

aCat.ID
aCat.categoryName
aCat.status

Rather, you'll need to get them by using the get() methods, i.e.

aCat.getID()
aCat.getCategoryName()
aCat.getstatus()



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Behalf Of Cutter (CF-Talk)
Sent: Friday, July 30, 2004 4:38 PM
To: [EMAIL PROTECTED]
Subject: [CFCDev] CFC webservice objects


Sorry for cross posting this to more than one list, I'm sure some of you
will see this twice.

OK, maybe I'm just going crazy. I still can't get a CFC object to work 
correctly. I've seen 75 examples, and each one is different in even it's
most basic form (many from the same authors). I even resorted to using 
DWMX 2004 to create a CFC, and create the call for it in another page 
(shiver). What's going on? I created a cfc to use as a webservice with 3
properties and a single init() method. I know that CF automatically 
creates get() and set() methods for each of the properties. Not rocket 
science (at least I didn't think so) but I'm just not getting anything. 
Here's the code:

//** Here's the category5.cfc **//

<cfcomponent displayName="category5">
        <cfproperty name="ID" type="numeric">
        <cfproperty name="categoryName" type="string">
        <cfproperty name="status" type="boolean">
        
        <cffunction name="init" access="remote" returnType="category5">
                <cfargument name="ID" type="numeric" default="0">
                
                <cfif arguments.ID neq 0>
                        <cfquery name="cat" datasource="#application.config.DSN#">
                                select  txtBoutCat as category,
                                                blActive as status
                                from    tblboutcat2
                                where   intBoutCatID = <cfqueryparam 
cfsqltype="cf_sql_integer" 
value="#arguments.ID#">
                        </cfquery>
                        
                        <cfif cat.recordcount eq 1>
                                <cfscript>
                                        this.ID = arguments.ID;
                                        this.category = cat.category;
                                        this.status = cat.status;
                                </cfscript>
                        </cfif>
                </cfif>
                
                <cfreturn this>
        </cffunction>
</cfcomponent>

//** Here's a call to the init **//

<cfinvoke
  webservice="#[the path]#/category5.cfc?wsdl"
  method="init"
  returnvariable="aCat">
        <cfinvokeargument name="ID" value="1"/>
</cfinvoke>

//** And here's the cfdump of #aCat#. Notice the lack of properties **//

object of #[heres_that_path_again]#.Category5_Type

Methods hashCode (returns int)
equals (returns boolean)
getStatus (returns java.lang.Boolean)
setStatus (returns void)
getID (returns java.lang.Double)
setID (returns void)
getSerializer (returns interface org.apache.axis.encoding.Serializer)
getDeserializer (returns interface org.apache.axis.encoding.Deserializer)
getTypeDesc (returns org.apache.axis.description.TypeDesc)
getCategoryName (returns java.lang.String)
setCategoryName (returns void)
getClass (returns java.lang.Class)
wait (returns void)
wait (returns void)
wait (returns void)
notify (returns void)
notifyAll (returns void)
toString (returns java.lang.String)


Any assistance is greatly appreciated. (Just one solid reference...)

Cutter
----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]


----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev'
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to