IPWorks EDI 2020 JavaScript Edition

Questions / Feedback?

SendResponse Method

In a server environment, responds to the requesting client with MDNReceipt .

Syntax

async as2receiver.sendResponse(): Promise<void>

Remarks

When called from within a server environment, SendResponse will respond to the requesting client. If an MDN was requested, then MDNReceipt will be returned to the client, either in the HTTP response or in a separate transmission, depending on the client request. In case it is returned in a separate transmission, a simple acknowledgement of "200 OK" will also be sent in the HTTP response, unless this was sent previously using AckRequest.

The AS2 headers will be taken from MDNReceipt and will be merged with HTTP headers as appropriate. Note that if ReceiptDeliveryOption indicates a "mailto:" URL, the appropriate SMTP settings should be set using Config.

The exact behavior of the method is specific to the environment. In ASP.NET, the receipt will be sent within the current HTTP context. In Java, the receipt will be sent within the provided HttpServletResponse. Otherwise, the receipt will be directed to stdout. If this is impossible, an exception will be thrown.

Optionally, if an asynchronous MDN is requested, the MDNReceipt and ReceiptDeliveryOption may be saved so that the MDN may be sent later through the SendAsyncMDN method.

This method should only be invoked after MDNReceipt has been generated by CreateMDNReceipt or ProcessRequest.

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