Skip to main content
Known Participant
December 9, 2009
Question

"public and remote" not working in CF9

  • December 9, 2009
  • 2 replies
  • 890 views

In CF8 setting the method-access-level for a particular destination to "public and remote" would expose CFC Methods labelled public to Flex applications. In CF9 that does not appear to be the case and possibly this is a bug.  Yes, I am aware of the change of location of this attribute in CF9 and what DOES work is method-access-level = "public", just not method-access-level = "public and remote".  If I set it to "public and remote" only methods with access="remote" are exposed.

Has anyone encountered this? Is this a known issue?

This topic has been closed for replies.

2 replies

BKBK
Community Expert
Community Expert
January 3, 2010

Just for information, access="remote" already includes public access. In other words, for the sake of argument alone, "public and remote" is tautology.

Known Participant
January 4, 2010

Hi,

services-config.xml has the following line:

<!-- allow "public and remote" or just "remote" methods to be invoked -->

<method-access-level>public</method-access-level>

You could previously put in "public and remote" and stipulate "public" access in your CFCs and Flex/Flash clients would be able to invoke those methods, but they could not be invoked by clients that used only "remote" access.  My desire was to restrict invocations to Flash/Flex clients, which can invoke "public" access methods.

Now, in CF9, you cannot stipulate "public and remote" - it's either "public" or "remote".  It's not a big deal but it is a change in behavior, and requires that only "public" be stipulated in services.xml if you intend to expose only methods with an access level  of "public".  Stipulating "remote" in services.xml does not expose CFC methods of "public", but only methods with access="remote".  If you try to invoke a  CFC method with access="public" when your services.xml stipulates method-access-level = "remote" you'll get an error.

Jeff

BKBK
Community Expert
Community Expert
January 4, 2010
<!-- allow "public and remote" or just "remote" methods to be invoked -->

I would interpret that as either

<method-access-level>public</method-access-level>

<method-access-level>remote</method-access-level>

or

<method-access-level>remote</method-access-level>

Inspiring
December 24, 2009

Are you saying you ahve this in your code:

<cffunction access="PUBLIC and REMOTE">

???

That's not - and never has been - valid, as far as I know.  If you could get away with it in CF8, that was the bug.  CF9 seems to have fixed the bug.

Can you pls provide some example code, and also any error message you get?

--

Adam