Looking at a get service I’m putting together, it seems the URI cannot contain a forward slash. For example,
I’ll send a part called DDE0041531828/64 and won’t get DDE0041531828/64 back
and if I send it over as DDE0041531828%2F64, I get a bad request.
Any tips?
/**
* @AllowToRunInFind
*
* // TODO generated, please specify type and doc for the params
* @param {String} list
*
*
* @properties={typeid:24,uuid:"D2647355-B028-43E3-B257-E0653B555A9E"}
*/
function ws_read(list) {
var test = ""
if(list != null)
{
list = utils.stringReplace(list,"%2F","/")
return list;
}
UPDATE:
I just created a global that I can execute. It takes just replaces %charchode with ~charcode. Suitable for what I am doing. Thanks
…/rest_ws/mysolutionname/mybaseform (has the ws_ methods set up here)
and then add as many extra paths as I’m going to need →
function ws_read(baseResourcePath,parameter1){}
So a call for a foundset looks like → /rest_ws/mobile_connector/dataForm/employee → baseResourcePath = “employee”
a call for a specific record looks like → /rest_ws/mobile_connector/employee/123 → baseResourcePath = “employee”, param1 = “123”
a filtered foundset request looks like → /rest_ws/mobile_connector/employee?status=active → baseResourcePath = employee, param1 = {status:active}
i usually then test the type of object param1 is → if it’s a string, it’s going to be UUID/PKid search, whereas if it’s an object it’s normally a parameter object to be parsed…
So you should be able to define as many extra parameters you want, but the parameter map (ie the string after the ? in the url) will always be the LAST parameter passed.
Don’t know if that helps at all but doing it this way I can access any table in my solution with a single base ws_read method.