Enable “remote” root object in Alfresco 3.4+

From the 3.3 version Alfresco is overriding the Spring Surf webscripts container bean removing the remote definition.

This modification also affects number of custom webscripts developed with previous releases. Let see, how to enable “remote” root object in current Alfresco installation;

1. Find your “web-scripts-application-context.xml” configuration file in alfresco webapp, or in shared classes.
2. Search for “webscripts.container”, and update “map” contents like this:


      Repository
      
         
           
              
           

           
           

         
      
...

3. Restart Alfresco server
4. Check custom configuration with following code:

var serviceUrl = (args.service === null) ? "/api/repository" : args.service;
var conn = remote.connect("alfresco");
var result = conn.get(stringUtils.urlEncodeComponent(serviceUrl));

Just another, non-remote solution: Nathan McMinn: Calling Web Services from the Alfresco Javascript API