Microsoft Knowledge Base Email Alertz

Information about handling incoming data streams in pipeline components in BizTalk Server 2004

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 905517 - Last Review: May 21, 2007 - Revision: 3.5

Information about handling incoming data streams in pipeline components in BizTalk Server 2004 or in BizTalk Server 2006

INTRODUCTION

When you write custom disassembler code for pipeline components in Microsoft BizTalk Server 2006 or in Microsoft BizTalk Server 2004, you must make sure that you do not close the incoming data stream in the custom disassembler code. The incoming stream from the input message is a shared resource. The incoming stream is also used by the message body tracking component in the BizTalk Server message engine.

If you either implicitly or explicitly close the incoming stream, tracking data may be lost. Therefore, you cannot examine the data in the Health and Activity Tracking (HAT) tool in BizTalk Server.

MORE INFORMATION

You must not close the incoming data stream object. Additionally, you must make sure that you read from the incoming data stream until the end of the stream is reached. For example, if the custom code makes a read request for 300 KB of data and the code only receives 34 KB of data, do not assume that the end of the stream has been reached. The custom code must always read from the incoming stream until 0 bytes is returned.

At the end of a custom pipeline component, make sure that you "rewind" the data stream pointer back to the start of the stream. Typically, you do this just before returning the data stream near the end of the custom component logic. For example, use the following code.
myDataStream.Seek(0, SeekOrigin.Begin);
																	 return myDataStream;
If you do not do this and the stream is read to the end in the current component, the next component receives what appears to be an empty stream because the data stream pointer was not rewound. This can cause unexpected parsing and validation errors in follow-on pipeline components.

For more information about how to handle incoming data streams in BizTalk Server 2006, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/aa577699.aspx (http://msdn2.microsoft.com/en-us/library/aa577699.aspx)
For more information about BizTalk Server 2004, visit the following Microsoft Web site:
http://www.microsoft.com/biztalk/ (http://www.microsoft.com/biztalk/)
For more information about how to create seekable streams in the Microsoft .NET Framework, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/336wast5(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/336wast5(vs.71).aspx)

APPLIES TO
  • Microsoft BizTalk Server 2006 Standard Edition
  • Microsoft BizTalk Server 2006 Enterprise Edition
  • Microsoft BizTalk Server 2006 Developer Edition
  • Microsoft BizTalk Server 2004 Standard Edition
  • Microsoft BizTalk Server 2004 Developer Edition
  • Microsoft BizTalk Server 2004 Enterprise Edition
  • Microsoft BizTalk Server 2004 Partner Edition
Keywords: 
kbbiztalk2004-2006swept kbbtsadapters kbhowto kbinfo KB905517
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate