cancel
Showing results for 
Search instead for 
Did you mean: 

How to invoke a Java based webscript from inside a Java based WS

spitchaiah
Champ in-the-making
Champ in-the-making
Hi,

Within a Alfresco(4.1) Java based Webscript, I need to invoke another Alfresco Java based Webscript(/alfresco/service/customservice?abc…).

I don't prefer making a Apache HttpClient call as its a bad practice for many obvious reasons . I did come across remote.connect approach but I guess its for calling a JS based WS.

Appreciate your help.

Thanks,
Somu
2 REPLIES 2

kaynezhang
World-Class Innovator
World-Class Innovator
If you want to call alfresco webscript api from share,you can use
org.springframework.extensions.webscripts.ScriptRemote
class,use it like this

        ScriptRemote scriptRemote = serviceRegistry.getScriptRemote();
        Response response = scriptRemote.connect().get(uri);

Hi

How do we call alfresco webscript api from repo side in Java policy class, is ther any way?

Please suggest.