I believe that an object instantiated from a CFC is behaving differently in 
ColdFusion than in .NET. Specifically, in .NET the object is not retaining its 
internal state between method calls. Hopefully I am doing something wrong. I 
have tried to reduce what I'm doing to the smallest possible test case. I am 
using ColdFusion 7 and VS.NET 2005.

My test CFC in ColdFusion looks like:
<CFCOMPONENT name="Test">
    <CFSET testValue = "state 1">
    
    <CFFUNCTION name="SetTestValue" access="remote" returntype="void">
        <CFARGUMENT name="value" required="true" type="string">        
        <CFSET testValue = value>
    </CFFUNCTION>  
        
    <CFFUNCTION name="GetTestValue" access="remote" returntype="string">    
        <CFRETURN testValue>
    </CFFUNCTION>    
    
</CFCOMPONENT>

When I invoke this from ColdFusion using:
<CFOBJECT component="Test" name="test">
<CFSET test.SetTestValue("state 2")>
<cfdump var="#test.GetTestValue()#">

Result: "state 2" (the expected value)
 
However, when I invoke it from C#/.NET using the following:
localhost.Test testObj = new localhost.Test();         
testObj.SetTestValue("state 2");
Console.WriteLine(testObj.GetTestValue());   
 
Result: "state 1"
 
In other words, the hookup to the webservice is working, but the object is not 
persisted between method calls. I guess I could make my CFC stateless and pass 
all the variables back and forth, but I don't think that's the intention with 
the CFCOMPONENT tag. What am I doing wrong?
 
Thanks,
 

   -Chase


 
Application Developer
B U L L H O R N




Staffing and Recruiting Software On Demand 

The Last Software You'll Ever NeedTM 
313 Congress St, 4th Floor Boston, MA 02210 
617.478.9119 
www.bullhorn.com

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:235778
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to