Aliaspooryorik
ColdFusion ORM Book

remote cfc calls and this.mappings

I've recently started looking at the remote proxies feature of ColdSpring and found that you can't use this.mappings with remote cfc calls.

In my applications I like to make use of the per-app mappings capabilities of ColdFusion 8. However, unlike mappings set up in the CFIDE, these don't appear to be recognised when you use your cfcs for remote object calls.

If you are trying to use mappings set up in the CFIDE then you'll need to edit the use-mappings node of your services-config.xml file from false (the default) to true.


<use-mappings>true</use-mappings>

I also wrote a bit of code which I have in my onApplicationStart method to detect if the server I'm deploying to allows remote calls to use mappings.


<!---
------------------------------------------------------------------------------
Is ColdFusion configured to allow remote services to use mappings?
------------------------------------------------------------------------------
--->
    
<cfset servicesConfig = XmlSearch( XmlParse( "C:\ColdFusion8\wwwroot\WEB-INF\flex\services-config.xml"), "/services-config/services/service[@id='coldfusion-flashremoting-service']/destination[@id='ColdFusion']/properties/access/use-mappings" ) />
<cfif !servicesConfig[1].XmlText>
<cfthrow type="critical"
message="mappings disabled for remote services"
detail="Need to set '&lt;use-mappings&gt;true&lt;/use-mappings&gt;' in 'C:\ColdFusion8\wwwroot\WEB-INF\flex\services-config.xml'" />

</cfif>


2 comments

  1. In light of this, any idea how to do:

    AS3
    [RemoteClass (alias="com.whatever.whatever")]

    CF
    component alias="com.whatever.whatever" {}

    so that I can use copies of the CF component in different apps so that I don't have to remap the alias of my AS3 class.

    Currently seems you have to use the location of the cfc as its alias. This is a pain.

    Thanks.

    Comment by fosrias – October 08, 2010
  2. @fosrias, good question and I'm afraid I don't know. It's been a while since I've done any Flex.

    Comment by John Whish – October 13, 2010

Leave a comment

If you found this post useful, interesting or just plain wrong, let me know - I like feedback :)

Please note: If you haven't commented before, then your comments will be moderated before they are displayed.

Please subscribe me to any further comments
 

Search

Wish List

Found something helpful & want to say ’thanks‘? Then visit my Amazon Wish List :)

Categories

Recent Posts