Discuss this help topic in SecureBlackbox Forum

EDI: Manage errors in the created receipt

If you created a receipt from the AS2 or AS3 message, the error list was copied from the message as well. So you need to remove the existing errors and/or warnings from the receipt. This is done via Errors property. Also you can add your own error or warning messages to the receipt also via Errors property.

Examples:

C#:


TElAS2Receipt receipt = new TElAS2Receipt();

// configure the receipt automatically
receipt.Assign(message);

// optionally, it's possible to change errors list

// you can remove errors you donít want to be reported
// to the message originator, for example, warnings
int i = 0;
while (i < receipt.Errors.Count)
{
    // this removes all the warnings found in the original message
    if (receipt.Errors[i].Modifier == TSBASDispositionModifier.dmWarning)
        receipt.Errors.Delete(i);
    else
        i++;
}
// also, it's possible to add errors and/or warnings
// specific to your application
receipt.Errors.Add(MY_ERROR_CODE, "error-summary", "My error description",
    TSBASDispositionModifier.dmError);

// check if the receipt has to be signed
if (receipt.Signature.Enabled)
{
    // assign a certificate storage with your certificate and its
    // private key loaded
    receipt.Signature.CertStorage = signingCertificates;
}

// assemble the receipt and save it to a stream
receipt.Save(receiptStream);

How To articles about AS2 and AS3 messages

Discuss this help topic in SecureBlackbox Forum