PDA

View Full Version : trouble using CFC methods


toddclare
08-17-2005, 10:34 PM
Hey!

I'm a little new to Remoting and VERY new to ColdFusion, but I've run thorugh a lot of tutorials, and things have gone well... until now. I can't make my connection to the service / method of the CFC work. I have done fine connecting to services with .CFM pages... maybe there is a different syntax?

There is a tutorial (http://www.macromedia.com/devnet/flash/articles/delta_packet.html) on MM's website... they give you a coldFusion component to use...

I put the rdbmsResolver.cfc in a folder in my web root, called "timetrax".

To access a method inside the CFC, I tried this:


//connect to the service
this.phoneLogService = new Service("http://{my server ip}/flashservices/gateway", null, "timetrax", null, null);
//call the remote method
getDataPC = phoneLogService.rdbmsResolver.todd();
//set the result event handlers as usual

where "todd" is a method I created in the CFC just to simplify things... just returns a string... No dice.
If I keep the same service and connect to a CFM that I put in there, it works great...

I was assuming the call to the remote function was supposed to be:

myPendingCall = myService.NameOfCFC.NameOfMethod(p1, p2);

Am wrong?

The Netconnection debugger shows that the connection was attempted, but nothing after that.

I can send files, if they would be helpful...

madgett
08-21-2005, 07:10 AM
First download and install this dreamweaver extension (assuming you're using Dreamweaver). http://www.communitymx.com/content/article.cfm?cid=096ED This will allow you to test remoting calls within dreamweaver, just seeing if you can connect to the cfc methods, so no flash is required for the test. This is a great extension. See what error messages you get with the tester panel.

madgett
08-21-2005, 07:15 AM
Another thing, when using the PendingCall class, this is the correct syntax: var pc:PendingCall = myService.todd(); // you don't reference the cfc in there