Hi everyone,
I have one custom search webscript with me which I am able to call from POSTMAN, in which I need to send 5 different values in json format and I get the related document in response. Now I want to call this webscript from custom share surf page. I have created one surf page and added 5 textbox and 1 button in that page now how can I call webscript with json request parameter to get the same response I'm getting from POSTMAN.
Thanks,
Dhrumil
To call a repository webscript you can do something similar to the below example:
//JSON Payload var searchPayload = { "offerName":"test", "offerPrice":"$100" } Alfresco.util.Ajax.request({ //e.g.: http://localhost:8080/alfresco/service/searchOffers url : Alfresco.constants.PROXY_URI + "/searchOffers", requestContentType:Alfresco.util.Ajax.JSON, responseContentType:Alfresco.util.Ajax.JSON, dataObj:searchPayload, method:Alfresco.util.Ajax.POST,
timeout:180000,
successCallback : { fn : function (response) { //TODO:: do something with response }, scope : this }, failureCallback : { fn : function (response) { //TODO:: do something in case of failure response }, scope : this } });
You can refer to this post as well, its quite old but may be helpful: https://blog.arvixe.com/webscript-call-in-client-side-javascript-of-alfresco/
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.