3 Replies Latest reply on Sep 23, 2009 2:53 AM by Balaji Sridhar

    Invoking CFCs that extend mapped CFCs through the flex2gateway

    Christine Panus

      Hello all,


      I’ve run into an issue with my CFCs and I’m hoping someone can tell me why this is happening.


      Here is my setup in this scenario:


      I have a mapping for my CFCs on my local CF Server where Logical Path /CFC maps to C:\ColdFusion8\common\CFC

      The folder C:\ColdFusion8\common\CFC contains one file test.cfc.  The file test.cfc is an empty component (<cfcomponent></cfcomponent>)


      I have a proxy CFC in my webroot’s proxy folder at C:\ColdFusion8\wwwroot\proxy\pxTestMapping.cfc  pxTestMapping.cfc extends CFC.Test which uses the logical path CFC referenced above pointing specifically to the file test.cfc. 


      I have created a service in Flex that works with pxTestMapping.cfc  On load of the application I run a method HelloWorld from pxTestMapping.cfc.  The helloWorld method just returns the string “Hello World”.  I have a button that you can click to see the resulting string in Flex.


      I can load the method directly in the browser and it works, I can also test and confirm that the Flex application works and the expected string does alert when the button is clicked.  If I then go into the pxTestMapping.cfc file and update the string returned to read “Hello World Updated” and hit save, the CFC will error the next time I run the flex application.  The error message states “Unable to invoke CFC – Could not find the ColdFusion Component or Interface CFC.Test”.  If I then run the Hello World Method directly in the browser (http://localhost:8500/proxy/pxTestMapping.cfc?method=HelloWorld) The component does not error, instead it returns the expected string.  From that point forward the flex app will also work, until I make another change to pxTestMapping at which time I will receive the above message until I manually access the webservice through a web browser.  I have duplicated this issue on both my local development environment and on my staging server.


      How can I get the CFC to invoke correctly after modification without having to directly access the webservice in my browser?




        • 1. Re: Invoking CFCs that extend mapped CFCs through the flex2gateway
          SunilAdobe Adobe Employee

          How are you calling the CFC from Flex? Through RemoteObject calls or through the generated code from the Data Menu -> Connect to ColdFusion?

          At the outset looks like the CFC file is not getting compiled to be accessed through RemoteObject.





          • 2. Re: Invoking CFCs that extend mapped CFCs through the flex2gateway
            Christine Panus Level 1

            I started with an empty Data/Services view and clicked the link "Connect to Data/Service"  I selected ColdFusion, browsed to the CFC in the ColdFusion Component section and used the default service name and package that it created.  I clicked next, entered my login information and clicked Finish on the screen that showed the operations in the service.


            I tried this with the original beta SDK, and


            The original issue described used the original beta SDK


   & errored with VerifyError #1014: Class IVisualELement could not be found, ReferenceError: #1065: Variable CrossFade_CrossFadeShaderClass is not defined,  ReferenceError: #1065: Variable Wipe_WipeShaderClass is not defined, and ReferenceError: Error #1065: Variable _2e124f77eedc07babaa6f5d7b8f173c364f54221c2a0cd01c6886c90f93a6fbf_flash_display_Sprite is not defined.  Additionally, every time I edited anything, the Flash Builder app returned an error that said "An internal build error has occurred.  Right-click for more information" which seems to require a restart of Flash Builder to resolve.


            I didn't have time to continue trying to figure out what about my code, setup or plugin was causing all those problems with the SDKs, so I gave up with testing in them.


            I attached the MXML file I used and the cfc I used in my tests.




            • 3. Re: Invoking CFCs that extend mapped CFCs through the flex2gateway
              Balaji Sridhar Level 2

              Hi Christine,


              This is not an issue with Flex.


              There seems to be a compilation issue once the CFC is changed.


              Work-around: Use "Refresh" service in DCD - this would actually re-compile your CFC.




              a) Create a Flex-CF project in FB.

              b) In the Data/Services panel click on "Data/Services"

              c) Select "ColdFusion" and click NEXT.

              d) Click "Browse" to select the "pxTestMapping.cfc" ,click NEXT and FINISH.

              e) Context click on the function(helloworld()) and select 'Test Operation', hit 'Test', now you should see "Hello World Updated1"

              f) Now change your return in CFC to "Hello World Updated"

              g) In FB, context click on "PxTestMapping" service and select 'Refresh'

              h) Now perform "test Operation", you should see the updated return value ie "Hello World Updated".


              Hope this helps!