Skip to Content
avatar image
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jul 08, 2014 at 01:06 PM

    Not possible. The response will only be returned to the client once all processing is complete.  The only way to even get close to this is to use the XSJOB and schedule a job run immediately to perform the processing. Job Scheduling is available as of SPS7.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Thomas Jung

      At moment we haven't any consulting request open to SAP .

      We want use SAP Hana XS because all the datawarehouse data are stored into the Hana Database and at moment we don't have other software like ESP .

      The basic idea is to

      - Receive the client requests via HTTP REST in the XSJS

      - Resolve the request via Hana SQL in pushdown 

      - Sent the resolved request by consuming an external web services on another server (non SAP) .

      we can do all of this task in hana XS but at moment the problem is that the transaction betwen CLIENT/ SERVER XS the remain open...

      what do you think about that ?