Going binary with BizTalk - Christof Claessens' WebLog
Going binary with BizTalk
Published 08 July 04 08:36 PM
When you want to create new message programmatically within an orchestration, you'd normally assign an XmlDocument object to your message. However: did you ever wonder how you could create non-XML messages within BizTalk Server orchestrations? (Assigning an XmlDocument would clearly not work here :-) )
For all of you "bitheads", here it is :
Imports SystemImports System.Runtime.InteropServicesImports Microsoft.XLANGs.BaseTypes
Namespace CLAESSENS.BTS2004.SAMPLES
<Serializable()> _ Public Class MyStreamFactory Implements Microsoft.XLANGs.BaseTypes.IStreamFactory
Private m_mystringdata As String = ""
Public Sub New(ByVal stringdata As String)
m_mystringdata = stringdata End Sub
Public Overridable Function CreateStream() As System.IO.Stream _ Implements Microsoft.XLANGs.BaseTypes.IStreamFactory.CreateStream return New IO.MemoryStream( _ System.Text.ASCIIEncoding.ASCII.GetBytes(m_mystringdata ))
Public Class MyMessageCreator Public Sub CreateMyMessage(ByVal mydestmsg As XLANGMessage) mydestmsg(0).LoadFrom(New MyStreamFactory("this is my data to create message from"))
The trick here is in the IStreamFactory. BizTalk Server is able to create messages from such a factory class. In this example, I've just created a 'binary' message from a string, using ASCII encoding. However: you could just as well assign something like a .PDF file or image to your message if you want.
No limits! BizTalk Server rocks!
said on July 12, 2004 02:14 AM: Hi Christof,
I am currently having problems sending binary attachments with the SMTP adapter.
Do you think I could use this to send Binary messages via FTP ? (and if I could could you hint a littlebit)
Christof Claessens said on July 14, 2004 05:29 PM: Hi Patrick,
yes you may use this with the SMTP adapter. We are addressing your question in the public newsgroup :-)
You might need to do some BASE64 encoding as well.
said on October 21, 2004 02:49 AM: #
said on October 21, 2004 02:51 AM: #
http://www.sacburberryecharpe.co/burberry-femmes-clutch-c-44.html
said on February 21, 2013 06:01 AM: If ones own photostream possesses photos which usually - regardless of whether good or possibly not -- triggered a fabulous spirited comments¡ä carefully thread, we like to see it again!
http://www.sacburberryecharpe.co/burberry-femmes-echarpe-c-50.html
said on February 28, 2013 10:35 AM: The Solo continues to be deemed the official PC games headset regarding MLG (Huge League Igaming). When it arrives to gaming while in front of a substantial, noisy audience, you call for a headset intended to block additional noise¡­
Going binary with BizTalk - Christof Claessens' WebLog
Going binary with BizTalk
Published 08 July 04 08:36 PM
When you want to create new message programmatically within an orchestration, you'd normally assign an XmlDocument object to your message. However: did you ever wonder how you could create non-XML messages within BizTalk Server orchestrations? (Assigning an XmlDocument would clearly not work here :-) )
For all of you "bitheads", here it is :
Imports SystemImports System.Runtime.InteropServicesImports Microsoft.XLANGs.BaseTypes
Namespace CLAESSENS.BTS2004.SAMPLES
<Serializable()> _ Public Class MyStreamFactory Implements Microsoft.XLANGs.BaseTypes.IStreamFactory
Private m_mystringdata As String = ""
Public Sub New(ByVal stringdata As String)
m_mystringdata = stringdata End Sub
Public Overridable Function CreateStream() As System.IO.Stream _ Implements Microsoft.XLANGs.BaseTypes.IStreamFactory.CreateStream return New IO.MemoryStream( _ System.Text.ASCIIEncoding.ASCII.GetBytes(m_mystringdata ))
Public Class MyMessageCreator Public Sub CreateMyMessage(ByVal mydestmsg As XLANGMessage) mydestmsg(0).LoadFrom(New MyStreamFactory("this is my data to create message from"))
The trick here is in the IStreamFactory. BizTalk Server is able to create messages from such a factory class. In this example, I've just created a 'b
inary' message from a string, using ASCII encoding. However: you could just as well assign something like a .PDF file or image to your message if you want.
No limits! BizTalk Server rocks!
said on July 12, 2004 02:14 AM: Hi Christof,
I am currently having problems sending binary attachments with the SMTP adapter.
Do you think I could use this to send Binary messages via FTP ? (and if I could could you hint a littlebit)
Christof Claessens said on July 14, 2004 05:29 PM: Hi Patrick,
yes you may use this with the SMTP adapter. We are addressing your question in the public newsgroup :-)
You might need to do some BASE64 encoding as well.
said on October 21, 2004 02:49 AM: #
said on October 21, 2004 02:51 AM: #
http://www.sacburberryecharpe.co/burberry-femmes-clutch-c-44.html
said on February 21, 2013 06:01 AM: If ones own photostream possesses photos which usually - regardless of whether good or possibly not -- triggered a fabulous spirited comments¡ä carefully thread, we like to see it again!
http://www.sacburberryecharpe.co/burberry-femmes-echarpe-c-50.html
said on February 28, 2013 10:35 AM: The Solo continues to be deemed the official PC games headset regarding MLG (Huge League Igaming). When it arrives to gaming while in front of a substantial, noisy audience, you call for a headset intended to block additional noise¡­