Microsoft KB Archive/839064

= You receive an error message when you send a byte array to a Message Queuing receive function by using the ActiveXMessageFormatter object in BizTalk Server 2002 =

Article ID: 839064

Article Last Modified on 3/19/2007

-

APPLIES TO


 * Microsoft BizTalk Server 2002 Standard Edition

-





SYMPTOMS
In Microsoft BizTalk Server 2002, if you use the ActiveXMessageFormatter object to send a byte array to a Microsoft Message Queuing (also known as MSMQ) receive function, an error message that is similar to the following appears in the BizTalk Server application log:

Event ID: 324

Source: BizTalk Server

Category: Document Processing

Description: An error occurred in BizTalk Server.

Details:

--

The &quot;&quot;Direct=OS: \private$\TestQ&quot;&quot; Message Queuing receive function is not

configured for a pass-through submission, but it has encountered a document

that was submitted previously as a pass-through submission.

Change this receive function to accept pass-through submissions or remove the

pass-through document from the queue. This receive function will be shut down.

The receive function &quot;TestQ&quot; has experienced problems, it will be shut down and disabled.

Once these problems have been corrected, re-enable this receive function in BizTalk Server Administration.

There was a failure processing the &quot;TestQ&quot; receive function.

Check your receive function configuration in BizTalk Server Administration.

Note In this error message,  is a placeholder for the name of your computer that is running BizTalk Server.



CAUSE
When the Send method of a MessageQueue object is called, the body is serialized by using the formatter that the Formatter property of the MessageQueue instance specifies. By default, the ActiveXMessageFormatter object sets the BodyType property to VT_VECTOR | VT_UI1.

However, a Message Queuing receive function cannot process a message that has a BodyType property that is set to VT_VECTOR | VT_UI1. If a Message Queuing receive function tries to process the message, BizTalk Server generates the error message that appears in the &quot;Symptoms&quot; section.



Sample code
The following sample code illustrates how to set the correct BodyStream property and the correct BodyType property for a Message instance before you send the message to a Message Queuing queue that a Message Queuing receive function is monitoring.

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements. using System; using System.Messaging; using System.Runtime.InteropServices;

class Class1 {   [STAThread] static void Main(string[] args) {       byte[] bytArray = new byte[] {72, 0, 101, 0, 108, 0, 108, 0, 111, 0}; //Hello MessageQueue mq = new MessageQueue(&quot;FormatName:DIRECT=OS:.\\private$\\TestQ&quot;); System.Messaging.Message msg = new System.Messaging.Message; msg.BodyStream.Write(bytArray,0, bytArray.Length); msg.BodyType = (int) (VarEnum.VT_ARRAY | VarEnum.VT_UI1); msg.AppSpecific = -1; mq.Send(msg, MessageQueueTransactionType.Single); } }



STATUS
This behavior is by design.



Steps to reproduce the behavior
To reproduce the behavior, follow these steps:  Create a private Message Queuing queue that is named TestQ. Mark the TestQ queue as a transactional queue. Create a channel and a messaging port in the BizTalk Server Messaging Manager:  Click Start, point to Programs, point to Microsoft BizTalk Server 2002, and then click BizTalk Messaging Manager. Create a new document definition that is named DocNull. Leave the document specification blank. Create a new messaging port to a file.</li> Create a new channel to the messaging port. Name the channel ChannelPassThrough.</li> For the ChannelPassThrough channel, use DocNull for both the inbound document and the outbound document.</li></ol> </li> Click Start, point to Programs, point to Microsoft BizTalk Server 2002, and then click BizTalk Server Administration.</li> Create a new Message Queuing receive function. In the Polling location box, type the following:

Direct=OS: \private$\TestQ

Note  is a placeholder for the name of your computer that is running BizTalk Server.</li> Click to select the Submit with a pass-through flag check box.</li> In the Channel name box, click ChannelPassThrough.</li> In Microsoft Visual Studio .NET, create a new Console Application project by using Microsoft Visual C# .NET. By default, a file that is named Class1.cs is created.</li> Add a reference to the System.Messaging namespace.</li>  In the Class1.cs file, replace the existing code with the following code: using System; using System.Messaging;

class Class1 {   [STAThread] static void Main(string[] args) {       byte[] bytArray = new byte[] {72, 0, 101, 0, 108, 0, 108, 0, 111, 0}; //Hello MessageQueue mq = new MessageQueue(&quot;FormatName:DIRECT=OS:.\\private$\\TestQ&quot;); System.Messaging.Message msg = new System.Messaging.Message; msg.Formatter = new ActiveXMessageFormatter; msg.Body = bytArray; msg.AppSpecific = -1; mq.Send(msg, MessageQueueTransactionType.Single); } } </li> Press CTRL+F5 to build and then run the project.</li></ol>

<div class="references_section">