IBaseMessage.BodyPart Property
IBaseMessage.BodyPart Property
Gets the body part, or main part, of the message.

Namespace: Microsoft.BizTalk.Message.Interop
Assembly: Microsoft.BizTalk.Pipeline (in microsoft.biztalk.pipeline.dll)
Syntax

Visual Basic
ReadOnly Property BodyPart As IBaseMessagePart
C#
IBaseMessagePart BodyPart { get; }
C++
property IBaseMessagePart^ BodyPart {
    IBaseMessagePart^ get ();
}
J#
/** @property */
IBaseMessagePart get_BodyPart ()
JScript
function get BodyPart () : IBaseMessagePart

Property Value

The body part of the message.
Remarks

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.


Example

The following example was taken from the SDK\Samples\Adapters\SubmitDirect\TransportProxyUtils\ResponseCallback.cs file.

C#
 
      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.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Platforms

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 Professional

Target 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
See Also

Tags :


Page view tracker