Skip to main content
Participating Frequently
March 26, 2008
Question

application.cfc and invoking by url a cfc

  • March 26, 2008
  • 2 replies
  • 696 views
hi all!

i have to invoke by url a cfc. like this... http://domain/cfcByUrl.cfc?method=get

now, if i add application.cfc to root of my application, my cfc invoked by url not works! it return only a white page!

what happen? where do i wrong?

cfmx7.0.2 on linux

thanks
Rob
    This topic has been closed for replies.

    2 replies

    Astonished_protector15C3
    Participating Frequently
    March 27, 2008
    Hi

    You have to set your function access type to remote

    Then only you can achive this
    Astonished_protector15C3
    Participating Frequently
    March 27, 2008
    Hi

    You have to call the CFC's through the URL by passing the function and its arguments

    For eg: cfcByURL.cfc?method=getList&id=1

    Method = your function name in the CFC
    id= your parameter in your function in cfc if you have more that one parameter you have to specify all parameters seprated with '&'

    robylabAuthor
    Participating Frequently
    March 27, 2008
    vkr, thanks for your reply

    quote:

    You have to call the CFC's through the URL by passing the function and its arguments


    yes, it is.

    quote:

    You have to set your function access type to remote


    yes, it is.


    i make some testing.

    if i remove onRequest method in my application.cfc my cfc called by url works perfectly. but, i think, is not a good choice remove onRequest... :o) this is mine...

    <cffunction name="onRequest" output="Yes">
    <cfargument name="targetPage" type="string" required="yes" />
    <cfinclude template="#arguments.targetPage#" />
    </cffunction>

    i test this situation on linux and windows. i've the same problem.

    thank
    Rob
    robylabAuthor
    Participating Frequently
    March 27, 2008
    doh! :-(

    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=AppEvents_08.html

    <<Do not implement the onRequest method in any Application.cfc file that affects .cfc files that implement web services, process Flash Remoting or event gateway requests; ColdFusion will not execute the requests if you implement this method.>>