EldoS | Feel safer!

Software components for data protection, secure storage and transfer

Can you explain how to use AS2Message without saving files to disk?

Also by EldoS: BizCrypto
Components for BizTalk® and SQL Server® Integration Services that let you securely store and transfer information in your business automation solutions.
#24213
Posted: 03/21/2013 07:42:33
by John Anderson (Priority Standard support level)
Joined: 03/15/2013
Posts: 24

I am trying to understand how AS2Message is supposed to be used.
I cannot find any articles in the knowledgebase describing how to correctly use AS2 components and the sample code does not quite show how to do what I require. The sample code uses an AS2Message instance to read the string from a text file and save the prepared message to an as2m file. Then it uses an AS2Client to send the as2m file.
Is it only possible to do this by saving a file to disk? My application will not be allowed to save to disk due to the high security environment in which it runs.
Once an AS2Message has been "loaded" does it contain the message or is it just a black-box that converts text to and from encoded bytes and read/writes files?
In the other direction how am I supposed to receive an AS2 message without saving to disk?
#24321
Posted: 03/27/2013 07:05:28
by Alexander Ionov (EldoS Corp.)

Thank you for request and sorry for delayed answer.

If you check the documentation for AS2Message.Load method, you will see, it can accept as a parameter not only a file name, but also a stream. This may be a memory stream or any other stream that supports repositioning (required for parsing). If you don't want to save incoming messages to a file and you are sure there is enough memory on the computer to process incoming message of any size, you can store it into a MemoryStream and pass the stream into the Load method.

Also AS2Client class does provide corresponding Send message which also accepts a stream parameter. So you're able to store your message into a memory stream by using corresponding AS2Message.Save method and then pass that stream to AS2Client.Send method.


--
Best regards,
Alexander Ionov
#24322
Posted: 03/27/2013 07:14:13
by John Anderson (Priority Standard support level)
Joined: 03/15/2013
Posts: 24

Thanks for that answer, I had eventually worked that out for myself, although the warning about memory available is something I hadn't thought of.

Can you tell me what the answer to
Quote
Once an AS2Message has been "loaded" does it contain the message or is it just a black-box that converts text to and from encoded bytes and read/writes files?
is please? I have not yet grasped how that part of the flow should work...
#24327
Posted: 03/27/2013 08:08:47
by Alexander Ionov (EldoS Corp.)

Quote
John Anderson wrote:
Once an AS2Message has been "loaded" does it contain the message or is it just a black-box that converts text to and from encoded bytes and read/writes files?

Sorry, I don't understand the question. What "message" the AS2Message class you suppose to contain? This class parses the passed stream, decrypts it (if it's encrypted), then checks the signature (if it's signed) and extracts the binary data it contains. The data is stored into the stream which you pass to AS2Message.Load method as the second parameter.


--
Best regards,
Alexander Ionov
#24332
Posted: 03/27/2013 09:21:58
by John Anderson (Priority Standard support level)
Joined: 03/15/2013
Posts: 24

Fine, that answers my question.

AS2Message is not itself a message; it is a message-generator & the stream that is emitted contains the message.

Thanks!
Also by EldoS: MsgConnect
Cross-platform protocol-independent communication framework for building peer-to-peer and client-server applications and middleware components.

Reply

Statistics

Topic viewed 712 times

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




|

Back to top

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

Got it!