asynch

Beas WEB Server is a single process. Transactions in SAP B1 take time. While the transaction is running, the WEB Server can't work on other requests.

Idea: The Beas WEB Server return only a request id and send the POST command to the   beas documentation - common service . This don't take time and the Beas WEB Service can answer next requests. The WEB client can use the RequestAnswerService to ask, if the transaction is executed and can delete the request with DEL RequestAnswerService.

 

With asynch=true the system send the command to the beas common service and return only the request number, on which you can read the answer

In this way you don't stop the web server for working on time intensive commands

 

Example

 

Create Work order over common service

 

POST odata4/WorkOrder?async=true

 

Body

{"WorkorderPos":[{"ItemCode":"FP","Quantity":2}]}

 

This return

{

  "TransactionID": 5726

}

 

Now you can ask for the result

This can take longer time. Please ask max. 1 time / 3 seconds.

 

RequestAnswerService?$filter=RequestId eq "5726"

 

This return empty value, if not existing or example this type of string

 

{

  "value": [

       {

          "RequestNumber": 478,

          "RequestId": "5726",

          "SessionId": "mah-de-desktop2828",

          "AnswerType": 0,

          "AnswerText": "6002207",

          "PARAMETER1": "",

          "StationId": "mah-de-desktop",

          "Closed": false,

          "EntryDate": "2021-03-25T10:51Z"

       }

   ]

}

 

 

At end you must close the answer (note: you must send the parameter as String array

RequestAnswerService/Close(["5726"])