i'm trying to get a JSON representation of a view with an ajax request from a XPage.
First of all, i did it with the following url https://myserver/mydb/myview?readviewentries&outputformat=JSON&count=-1
.
It works in browsers but not in IBM Notes Client (my application have to work in the both), i got an error 404, i read on internet that we can't use that syntax in the Notes client. So i tried to use the restService element from XPages to get my JSON.
I create a XPage with the following code :
<xe:restService id="restService1" pathInfo="JoursFeries">
<xe:this.service>
<xe:viewJsonService defaultColumns="true"
databaseName="Applis/JoursFeries.nsf" viewName="JoursFeries">
</xe:viewJsonService>
</xe:this.service>
</xe:restService>
I changed my URL to call my Rest service like that : myXpage.xsp/JoursFeries
(My new XPage is on the same database as the calling XPage). One more time, it works on browsers but still not in IBM Notes client. I called it like that :
var feries = {
url : "xRestJoursFeries.xsp/JoursFeries",
handleAs : "json",
sync : true,
preventCache : this.urlPreventCache,
load : function(json) {
// My callback function
}
}
dojo.xhrGet(feries);
When I activate my XPage debugger in Notes client, I just can see that the page returns an error 500, my console just said that :
WARNING CLFAD####W: State data not available for /xRestJoursFeries because no control tree was found in the cache. ::class.methot=com.ibm.xsp.application.ViewHandlerExImpl_restoreView() ::thread=Thread-348 ::loggername=anonymous
I tried many parameters on my XPages which provides the REST service, but without success.
Thank you in advance.