Skip to Content
0
Former Member
Jul 08, 2014 at 12:55 PM

SAP HANA XS Server - REST Web Services - How to close the connection

169 Views

Hi all,

we have a REST web services based on an Hana XSJS Project; at moment the steps that the WS perform are the following :

1) Parse the Body of the POST cal

2) Make some elaboration based on the input data

3) set the HTTP 200 Status

Example of AS IS :

$.response.contentType = "text/html";

var va_br = $.request.body.asString();

// -- PERFORM ELABORATION
$.response.setBody(output);
$.Response = $.net.http.OK;

The problem is that the connection with the client is closed only when the XSJS process complete all the operation .

Question :

How to send the HTTP Code "200" and close the connection to the client whithout waiting the XSJS code is completed .

The flow will be :

1) Parse the Body of the POST call

2) Close the connection and send the HTTP 200 Status back to the client

3) Make some elaboration based on the input data

We tried to force the closing of the objects $.response or $.response without any result .

Thank you

Maurizio

Message was edited by: Tom Flanagan