Gets the body part, or main part, of the message.
Namespace: Microsoft.BizTalk.Message.Interop
Assembly: Microsoft.BizTalk.Pipeline (in microsoft.biztalk.pipeline.dll)
ReadOnly Property BodyPart As IBaseMessagePart
IBaseMessagePart BodyPart { get; }
property IBaseMessagePart^ BodyPart {
IBaseMessagePart^ get ();
}
/** @property */
IBaseMessagePart get_BodyPart ()
function get BodyPart () : IBaseMessagePart
Property Value
The body part of the message.
Each message must have at most one body part. A part can be the body part of one message and a non-body part of another message.
The following example was taken from the SDK\Samples\Adapters\SubmitDirect\TransportProxyUtils\ResponseCallback.cs file.
public bool TransmitMessage(IBaseMessage msg)
{
// Note: We need to read the stream which will execute the
// pipeline, we then replace the stream with the one we
// have created
IBaseMessagePart bodyPart = msg.BodyPart;
Stream s = null;
if (bodyPart!=null)
s = bodyPart.GetOriginalDataStream();
// Create a memory stream to copy the data into
Stream memStrm = new MemoryStream();
byte[] buff = new byte[4096];
int dataRead = 0, readOffSet = 0, writeOffSet = 0;
if (s!=null)
{
s.Seek(0, SeekOrigin.Begin);
// Copy the data from the src stream
do
{
dataRead = s.Read(buff, readOffSet, 4096);
memStrm.Write( buff, writeOffSet, dataRead );
}while(dataRead > 0);
}
}
[Jscript, Visual Basic, C++] There is no example for C++, Visual Basic, or Jscript at this time.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Development Platforms
The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); the 32-bit and 64-bit editions of Windows Server 2003 with SP1 or SP2 (except the Web Edition); Windows Small Business Server 2003 with SP1 or SP2; the 32-bit and 64-bit editions of Windows Vista Ultimate, Enterprise and Business editions; the 32-bit and 64-bit editions of Windows XP ProfessionalTarget Platforms
The 32-bit and 64-bit editions of Windows Server 2003 R2 (except the Web Editions); the 32-bit and 64-bit editions of Windows Server 2003 with SP1 or SP2 (except the Web Edition); Windows Small Business Server 2003 with SP1 or SP2