This project is read-only.
1
Vote

ForwardOnlyEventingReadStream does not support Seek()

description

The line 'inMsg.BodyPart.Data.Position = 0' in IBaseMessage Execute(IPipelineContext, IBaseMessage) fired an error 'ForwardOnlyEventingReadStream does not support Seek()' while using the pipeline in an appending file send port.

Fix:
...
using Microsoft.BizTalk.Streaming;

namespace BizTalk.Archiving.PipelineComponents
{
    /// <summary>
    /// IComponent Implementation
    /// </summary>
    public partial class ArchiveComponent
    {
        public IBaseMessage Execute(IPipelineContext pContext, IBaseMessage inMsg)
        {

            Stream inputStream = inMsg.BodyPart.GetOriginalDataStream();

            if (!inputStream.CanSeek)
            {
                ReadOnlySeekableStream seekableStream =
                    new ReadOnlySeekableStream(inMsg.BodyPart.GetOriginalDataStream());

                inMsg.BodyPart.Data = inputStream = seekableStream;                
            }
...

comments