<webscript> <shortname>The World's Simplest Webscript</shortname> <description>Hands back a little bit of JSON</description> <url>/demo/simple</url> <authentication>none</authentication> <format default="">argument</format> <family>Alfresco Java-Backed WebScripts Demo</family> </webscript>
4). I add following lines script-services-context.xml
public class SimpleWebScript extends AbstractWebScript { public void execute(WebScriptRequest req, WebScriptResponse res) throws IOException { try { // build a json object JSONObject obj = new JSONObject(); // put some data on it obj.put("field1", "data1"); // build a JSON string and send it back String jsonString = obj.toString(); res.getWriter().write(jsonString); } catch(JSONException e) { throw new WebScriptException("Unable to serialize JSON"); } } }
When my rule is executed. It's working fine in Alfresco 4.0 but it is not working in other versions such as 4.1.3, 4.2.a, 4.2.c… In Alfresco 4.2.C My action code is calling only once when the service is started. When the rule is executed second time onwords Java backed code is not executing. Is it required to do any other configuration settings in alfresco versions beyond 4.0.
Strange any errors in the logs? Also is there any authentication related java code you have used because there might be change in the API's Also have you compiled your script with the respective SDK of new version in which you are deploying?