AnsweredAssumed Answered

Web script cannot be called from Share  if name end with '/'

Question asked by sunquanbin on Sep 19, 2014
Latest reply on Sep 20, 2014 by kaynezhang

I've got a quite strange issue which is the Webscript defined in Alfresco cannot be called from Share if it ends with "/" in its url tag.

To be more specific, I have defined an Alfresco side web service "mytest"(defined as <url>/mytest/</url>) which is working when I access it with the url: http://localhost:8080/alfresco/service/mytest/.

So in share (in client js), The following should work:

                        url: Alfresco.constants.PROXY_URI + "mytest/",
                        type: "GET",
                        contentType: 'application/json',
                        success: function TestAjaxCall(response) {
                        error: function test_error(response) {

What I get now is a 404 says: mytest/ does not map to a Web Script.

I then noticed that if I change the url in desc.xml from "<url>/mytest/</url>" to "<url>/mytest</url>", the web service will work in both Alfresco and Share. It looks like the suffixed "/" has caused the problem.

Does anyone know the reason?

Many Thanks,