ferranferri
14 years agoOccasional Contributor
Parse request doesn't work correcly in my test function
Hello,
I'm checking some webservices in my application. The webservices plugin retrieves perfectly the methods and attributes published. The problem is when after retrieve the session token (so the communcation is OK), the contents are not correctly parsed (I thinks). This is what I do:
function setDixioPreferences()
{
// gets the session token in another webservice request
var sessionToken;
if(sessionToken == ""){
sessionToken = SetAuth();
}
websrvInfo = WebServices.CreateWebServiceInfoFromItem("contentOrder");
ReqObj = websrvInfo.PrepareRequestObject("getContents");
ReqObj.sessionToken = sessionToken;
ReqObj.language = "es";
websrvInfo.PrepareRequest("getContents", ReqObj);
response = WebServices.contentOrder.getContents(ReqObj.sessionToken, ReqObj.language);
ll = WebServices.contentOrder.LastResponse;
res = websrvInfo.ParseResponse("getContents", ll);
}
Where getContents is the webservice method that I want to test. The problem is that res is aparently empty. I need to extract an array from res. Checking into a web proxy debugger, I know that communication and contents are correctly sent.
I'm checking some webservices in my application. The webservices plugin retrieves perfectly the methods and attributes published. The problem is when after retrieve the session token (so the communcation is OK), the contents are not correctly parsed (I thinks). This is what I do:
function setDixioPreferences()
{
// gets the session token in another webservice request
var sessionToken;
if(sessionToken == ""){
sessionToken = SetAuth();
}
websrvInfo = WebServices.CreateWebServiceInfoFromItem("contentOrder");
ReqObj = websrvInfo.PrepareRequestObject("getContents");
ReqObj.sessionToken = sessionToken;
ReqObj.language = "es";
websrvInfo.PrepareRequest("getContents", ReqObj);
response = WebServices.contentOrder.getContents(ReqObj.sessionToken, ReqObj.language);
ll = WebServices.contentOrder.LastResponse;
res = websrvInfo.ParseResponse("getContents", ll);
}
Where getContents is the webservice method that I want to test. The problem is that res is aparently empty. I need to extract an array from res. Checking into a web proxy debugger, I know that communication and contents are correctly sent.