Skip to main content
Participant
November 12, 2007
Question

CF8 - Flex-3 remoteObject configuration

  • November 12, 2007
  • 1 reply
  • 3481 views
I am sure I have done this right but nothing I do seems to work...

I get an error asking for a <gatewayid>. Not sure where I need to apply that and I have never seen any reference to it in any example code. If I pull the <gatewayid> out of the config file then LCDS won't start because "COLDFUSION... Don't know where to send messages"

The error is;
faultCode:Server.Processing
faultString:'Message header 'gatewayid' required in message when sending to destination 'ColdFusion''
faultDetail:'null'

I am running this on a LINUX system (blackmagic), CF-8 is located @/opt/coldfusion8/
My CFC is the standard Hello World cfc and I have it @ /opt/coldfusion8/wwwroot/CFC/hw.cfc

Any ideas will be greatly appreciated.

The FLEX script looks like;

<mx:RemoteObject id="helloWorld"
destination="ColdFusion"
source="CFC.hw"
fault="faultHandler(event)"
endpoint=" http://blackmagic/flex2gateway/"
>

<mx:method name="GetHello" result="GetHello_handler(event)" fault="faultHandler(event)" />
</mx:RemoteObject>

services-config.xml (abbreviated) looks like;
<?xml version="1.0" encoding="UTF-8"?>
<services-config>

<services>
<service-include file-path="messaging-config.xml" />
</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://{server.name}:{server.port}{context.root}/flex2gateway"
class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
<serialization>
<instantiate-types>false</instantiate-types>
</serialization>
</properties>
</channel-definition>

</channels>

<logging>
<target class="flex.messaging.log.ConsoleTarget" level="Error">
<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>
<manageable>false</manageable>
<!--
<redeploy>
<enabled>true</enabled>
<watch-interval>20</watch-interval>
<watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file>
<watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file>
<watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file>
<watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file>
<watch-file>{context.root}/WEB-INF/flex/data-management-config.xml</watch-file>
<touch-file>{context.root}/WEB-INF/web.xml</touch-file>
</redeploy>
-->
</system>

</services-config>

Messaging-config.xml looks like::

<?xml version="1.0" encoding="UTF-8"?>
<service id="message-service" class="flex.messaging.services.MessageService" messageTypes="flex.messaging.messages.AsyncMessage">

<adapters>
<adapter-definition id="actionscript" class="flex.messaging.services.messaging.adapters.ActionScriptAdapter" default="true" />
<adapter-definition id="jms" class="flex.messaging.services.messaging.adapters.JMSAdapter"/>
<adapter-definition id="cfgateway" class="coldfusion.flex.CFEventGatewayAdapter" />

</adapters>

<destination id="ColdFusion">
<adapter ref="cfgateway" />
<properties>
<gatewayid>*</gatewayid>
</properties>
<channels>
<!-- <channel ref="cf-rtmp" /> -->
<channel ref="my-cfamf" />
</channels>
</destination>

</service>
This topic has been closed for replies.

1 reply

Participant
November 27, 2007
something is wrong with your configuration files.
your cf destination inside messaging-config.xml should be called ColdFusionGateway , that's for messaging and your ColdFusion destination designed for Remoting calls (in the remoting-config.xml) should be something like this:

<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service"
class="flex.messaging.services.RemotingService"
messageTypes="flex.messaging.messages.RemotingMessage">

<adapters>
<adapter-definition id="cf-object" class="coldfusion.flash.messaging.ColdFusionAdapter" default="true"/>
<adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter"/>
</adapters>

<default-channels>
<channel ref="my-cfamf"/>
</default-channels>

<destination id="ColdFusion">
<channels>
<channel ref="my-cfamf"/>
</channels>
<properties>
<source>*</source>
<!-- define the resolution rules and access level of the cfc being invoked -->
<access>
<!-- Use the ColdFusion mappings to find CFCs, by default only CFC files under your webroot can be found. -->
<use-mappings>true</use-mappings>
<!-- allow "public and remote" or just "remote" methods to be invoked -->
<method-access-level>remote</method-access-level>
</access>

<property-case>
<!-- cfc property names -->
<force-cfc-lowercase>false</force-cfc-lowercase>
<!-- Query column names -->
<force-query-lowercase>false</force-query-lowercase>
<!-- struct keys -->
<force-struct-lowercase>false</force-struct-lowercase>
</property-case>
</properties>
</destination>

</service>