If you're connection from a different machine than the one CF is installed on,
use {content.root} in the endpoint uri attribute.
Mine looks like this:
<endpoint uri="{context.root}/flex2gateway/"
class="flex.messaging.endpoints.AMFEndpoint"/>
If you look at the top of the flex-enterprise-services.xml, you'll notice that
there's already a destination defined, called
'ColdFusion'
When using that destination as the destination of a RemoteObject, you can
access any cfc on your server (without having to modify
the flex-enterprise-services.xml).
You then specify the path to the cfc in the source property of the RemoteObject.
<RemoteObject destination="ColdFusion" source="path.to.cfc.on.server">
<mx:method name="someMethod" result="someMethodResult(event)"
fault="someMethodFault(event)">
</RemoteObject>
Now, this way of accessing cfc's has been added for backwards compatibility
(see docs) and is not recommended.
You should add <destination> tags to the flex-enterprise-services.xml as needed.
Here's an example from the docs:
<destination id="SampleEmployeeRO">
<properties>
<source>samples.explorer.EmployeeManager</source>
<stateful>true</stateful>
</properties>
<adapter ref="java-object"/>
</destination>
The destination id is what you'll use as the destination of the RemoteObject.
And you don't specify a 'source' in the RemoteObject,
since it's defined in the xml file.
<RemoteObject destination="SampleEmployeeRO">
<mx:method name="someMethod" result="someMethodResult(event)"
fault="someMethodFault(event)">
</RemoteObject>
hope this helps,
Muzak
----- Original Message -----
From: "Simeon Bateman" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, April 07, 2006 11:05 PM
Subject: Re: [flexcoders] Re: RemoteObject (Beta2) - cannot find CFC
You probably need to uncomment the specific information in your
flex-enterprise-services.xml file. But just so you dont have to wonder what
that is, I am including the contents of mine below. Just make sure that the
endpoint for the my-cfamf channel uses the correct port.
simeon
<?xml version="1.0" encoding="UTF-8"?>
<services-config xmlns="http://www.macromedia.com/2005/flex-service-config">
<services>
<service id="coldfusionsamples-service"
class="flex.messaging.services.RemotingService"
messageTypes="flex.messaging.messages.RemotingMessage">
<adapters>
<adapter-definition id="cf-object" class="
coldfusion.flash.messaging.ColdFusionAdapter" default="true"/>
</adapters>
<destination id="ColdFusion">
<channels>
<channel ref="my-cfamf"/>
</channels>
<properties>
<source>*</source>
<lowercase-keys>true</lowercase-keys>
</properties>
</destination>
</service>
</services>
<security>
<login-command class="flex.messaging.security.JRunLoginCommand"
server="JRun"/>
</security>
<channels>
<channel-definition id="my-cfamf" class="
mx.messaging.channels.AMFChannel">
<endpoint uri="http://localhost:8304/flex2gateway/" class="
flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
<serialization>
<custom-deserializer type="typed-object" class="
coldfusion.flash.messaging.io.amf.serializers.TypedObjectDeserializer" />
</serialization>
</properties>
</channel-definition>
</channels>
<logging>
<target class="flex.messaging.log.ConsoleTarget" level="Debug">
<properties>
<prefix>[Flex] </prefix>
<includeDate>false</includeDate>
<includeTime>false</includeTime>
<includeLevel>false</includeLevel>
<includeCategory>false</includeCategory>
</properties>
<filters>
<pattern>Endpoint.*</pattern>
<pattern>Service.*</pattern>
<pattern>Configuration</pattern>
<pattern>Message.*</pattern>
</filters>
</target>
</logging>
<system>
<locale>
<default-locale>en</default-locale>
<supported-locale>de</supported-locale>
<supported-locale>fr</supported-locale>
<supported-locale>es</supported-locale>
</locale>
<redeploy>
<enabled>true</enabled>
<watch-interval>20</watch-interval>
<watch-file>{context.root}/WEB-INF/flex/flex-
enterprise-services.xml</watch-file>
<touch-file>{context.root}/WEB-INF/web.xml</touch-file>
</redeploy>
</system>
</services-config>
On 4/7/06, Ryan Pieszak <[EMAIL PROTECTED]> wrote:
> I think I've gotten past this point, I can get the swf to compile and
> load in the browser. My problem is that it can't connect to the
> CFC. It tells me 'Unknown destination', that it cannot find the cfc.
>
> I don't know if I have to predefine it in the flex-enterprise-
> services.xml file, and the reference some sort of ID, or if it's
> completely created and connected to in the mxml file.
>
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/