Do we close the connection to the webservice of the backoffice?
On the Tomcat server hosting the (REST) webservices of the backoffice we sessions being created. These sessions are only terminated after the idle time-out has been passed.
Can anyone verify that we are closing the connection to the backoffice webservice after each request, in other words: that we have implemented the Servoy side correctly?
The following two functions handle the webservice calls to the backoffice:
function fillData(url, requestObj) {
var client = plugins.http.createNewHttpClient();
if(client)
{
var request = client.createPutRequest(url);
if(requestObj)
{
var jsonString = JSON.stringify(requestObj);
request.setBodyContent(jsonString, 'application/json');
}
request.addHeader('accept','application/json')
var response = request.executeRequest();
var httpCode = response.getStatusCode();
}
if(httpCode == plugins.http.HTTP_STATUS.SC_OK)
{
return true
}
return false
}
function getPostData(url)
{
var client = plugins.http.createNewHttpClient();
if(client)
{
var request = client.createGetRequest(url);
request.addHeader('accept','application/json')
var response = request.executeRequest();
var httpCode = response.getStatusCode();
}
if(httpCode == plugins.http.HTTP_STATUS.SC_OK)
{
var content = response.getResponseBody();
var data = plugins.serialize.fromJSON(content)
}
return data
}
With kind regards,
Serge de Wit