EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Loading TElAS2Message

Posted: 09/24/2013 08:06:54
by Katit (Basic support level)
Joined: 09/19/2013
Posts: 14

I have following dev issue, not sure what would be the best practice to solve this.

My AS2 sending goes like this:

1. I create TElAS2Message, prepare it, add certificates, set properties and Save() to get actual binary of message to send over HTTP
2. I save this binary in database so if send operation fails I can retry at a leter time
3. I have another routine that goes and sends out messages that need to be sent or resent (if failed). In that routine I use TElAS2Client and just load binary stream from database. This works.

var status = as2Client.Send(this.ediConnection.As2Url, messageStream, receiptStream);

Where I get in a trouble is when I need to check receipt. From what I understand about AS2 - receipt checking basically involves checking 2 hash codes. One from message and another returned in MDN receipt.

I do it like so:

if (!SBUtils.__Global.CompareContent(as2Receipt.ReceivedContentDigest, as2Message.ContentDigest))

Problem is, I don't have as2Message object anymore. I tried to reconstruct message using as2Message.Load like so:

var as2Message = new TElAS2Message();
            messageStream.Position = 0;
            as2Message.Load(messageStream, null);

I see core properties in this message but I don't see ContentDigest and few other things (of course certificates not there)

What is your suggestion on rebuilding as2Message?
Posted: 09/24/2013 08:32:29
by Alexander Ionov (Team)

Thank you for the question.

I would suggest you to store message digests in your database also. Message digest becomes available right after TElAS2Message.Save call.

Best regards,
Alexander Ionov



Topic viewed 477 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!