cancel
Showing results for 
Search instead for 
Did you mean: 

Invoking a webscript from Script

leonardo_celati
Champ in-the-making
Champ in-the-making
I have a set of webscripts that I would like to invoke from an Alfresco Script.
Don't know if it's relevant, the script is a part of a folder rule.

By looking at the documentation it is stated that any client capable of doing http request can invoke a webscripts, so it seems it is not possible from within a Script.

If instead is possible, could you provide some example ?

EDIT
Just a few notes about what I am trying to achieve.

This is the starting point: a folder MyFolder with a rule, a Script 'MyScript' and a WebScript 'MyWebScript'.
Whenever a file is added or removed in MyFolder the workflow invoke 'MyScript'.

'MyScript' is in turn invoking 'MyWebScript' which is doing some CMIS queries and give back an XML file.
'MyScript' should get that xml and create a node/file with such content, or at least save the file itself.

The webscripts set is already well consolidated, so I would like to reuse the logic as much as possible.
1 REPLY 1

romschn
Star Collaborator
Star Collaborator
It is possible to invoke a webscript from the javascript/java based actions.You can use HttpClient, RestClient to invoke the webscripts.

If you are using javascript then you will have to create custom javascript extension and inside it's java code invoke a webscript to complete your required processing.
Please refer - http://forums.alfresco.com/comment/146025#comment-146025 - to get detail about how to create a javascript extension for reference.