IPWorks EDI 2020 Node.js Edition

Questions / Feedback?

ProcessRequest Method

Processes the EDI data, and generates the receipt.

Syntax

as2receiver.processRequest([callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

Invoking ProcessRequest automates the entire AS2 server process. The method scans the request, determines the EDIData, and generates the MDNReceipt. In a server environment the receipt may be returned by invoking SendResponse.

The method's functionality is the same as the combined functionality of ParseRequest and CreateMDNReceipt. The method's operation is controlled by ErrorProcessingFlags and ErrorReportingFlags, and ScanResult will be populated as in ParseRequest.

The method will throw an exception, as ParseRequest does, if a problem is found while processing the request. However, if the problem does not prevent an MDN from being generated, MDNReceipt will still be generated before the exception is thrown. In all cases, the receipt will be suitable for returning to the client. If an exception is thrown, the MDNReceipt will provide more detail on the cause of the error.

The class will populate EDIData if no errors occurred scanning the request, or if ErrorProcessingFlags had been previously configured to allow the error.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks EDI 2020 Node.js Edition - Version 20.0 [Build 8203]