• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Remotely Accessing CFC

LEGEND ,
Jul 26, 2007 Jul 26, 2007

Copy link to clipboard

Copied

I have a cfc currently in the CustomTag folder so that is available to
any Colfsuion application on the server with the following path:
createObject("component","Security.ITB_User"). This has worked nicely
to date.

How would I access this CFC remotely for use with a new Flex
application? To use my CFC's in this application I have had to very
accurately map the CFC from the webroot. With this security cfc being
in the Custom tag folder it is not in the webroot. Is it possible to
somehow map to this cfc directly? If not, I presume I would need some
kind of facade cfc? What exactly are the characteristics of a facade?

TIA
Ian Skinner
TOPICS
Advanced techniques

Views

394

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 26, 2007 Jul 26, 2007

Copy link to clipboard

Copied

You could create a proxy CFC under your webroot.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jul 27, 2007 Jul 27, 2007

Copy link to clipboard

Copied

You can easily invoke the CFC remotely as a webservice. It could be very easy to achieve.

<cfinvoke
webservice = " http://localhost/cfcomponent/coldcomponent.cfc?wsdl"
method = "method_name"
returnVariable = "foo">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 27, 2007 Jul 27, 2007

Copy link to clipboard

Copied

LATEST
Yes, it is possible to map to the CFC directly, by setting the access attribute to "remote". However there is a catch. For this to work through a mapping, you must edit the services-config.xml file that is located in the cfusion.ear\cfusion.war\WEB-INF\flex directory of your CF server instance. Somewhere around line 22 of that file you should see:

<use-mappings>false</use-mappings>

change that to:

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

I'm not sure if you need to restart the CF instance or not.

However, from a security standpoint I would recommend using a remote facade similar to what jmmorgan suggested. In fact, if you use ColdSpring, you can get ColdSpring to generate this for you.

Hope this helps,
Sean

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation