2
votes

I have below directory structure -

  • rootFolder
  • ---CFC (contains all cfc file)
  • ---SERVICES (contains all service file)
  • application.cfc

I have created one service named (userService.cfc) which have the below script

import services.userService;

component accessors="true" alias="services.userService"
{
    remote userService function init()
    {
        return This;
    }

    remote any function getUser()
{
   var userObj = new cfc.sessionUser();  

          return userObj;        
}
}

If i call this service from inside the application, this is working fine

Again if i am trying to call it from outside the application, need to change this statement as below and again it is working fine.

 import rootFolderName.services.userService;

    component accessors="true" alias="rootFolderName.services.userService"
    {
        remote userServicefunction init()
        {
            return This;
        }

            remote any function getUser()
        {
             var userObj = new rootFolderName.cfc.sessionUser();  

                return userObj;        
         }
    }

But If i put this code on another rootFolder suppose on "rootFolderName1" name i have to changed all the place where i used the rootFolderName. I got one solution by CFADMIN folder mapping on server level. but i want it on application level.

Can we configure it on Application.cfc? I have used Mappings also but that is not working.

Actually i have two separate application one flex application which is trying to access the second application services remotely. second application have cfc and sevices.

Please help on this.

1
What have you placed in your this.mappings variables? You should be able to set the mappings in each application to point to your root services folder. - Dan Short

1 Answers

3
votes