Discuss this help topic in SecureBlackbox Forum

EDI: Process an AS2/AS3 message

Incoming message can be loaded for analyzing from a stream or a file. To do this, call the appropriate Load() method. This method loads the message from a stream or a file, extracts the included data and stores that data to another stream or file.

The main goal of Load() method is to extract the included data. So, if the data was extracted successfully, no exception is thrown. But the method can return false to let you know there were some issues during the message parsing (issues which are not critical for data extraction). In this case it is needed to check Errors list and see if there are any issues critical for your tasks. All other issues which are not critical for you could be ignored.

After processing a message you might need to check its signature and, if the receipt has been requested (Message.ReceiptRequest.Enabled was set to true), prepare the receipt.



// create an AS2 message
TElAS2Message message = new TElAS2Message();

    if (message.Load(messageStream, dataStream))
        Console.WriteLine("The data was extracted successfully");
        Console.WriteLine("The data was extracted with some issues:");

        for (int i = 0; i < message.Errors.Count; i++)
            Console.WriteLine("\t{0}: {1} - {2}",
catch (Exception err)
    Console.WriteLine("Failed to extract the included data: {0}", err.Message);

How To articles about AS2 and AS3 messages

Discuss this help topic in SecureBlackbox Forum