Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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 ""Direct=OS:Server Name\private$\TestQ"" 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 "TestQ" 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 "TestQ" receive function.
Check your receive function configuration in BizTalk Server Administration.
Note In this error message, Server Name is a placeholder for the name of your computer that is running BizTalk Server.

↑ Back to the top


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 "Symptoms" section.

↑ Back to the top


Resolution

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("FormatName:DIRECT=OS:.\\private$\\TestQ");
		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);
	}
}

↑ Back to the top


Status

This behavior is by design.

↑ Back to the top


More information

Steps to reproduce the behavior

To reproduce the behavior, follow these steps:
1.Create a private Message Queuing queue that is named TestQ. Mark the TestQ queue as a transactional queue.
2.Create a channel and a messaging port in the BizTalk Server Messaging Manager:
a. Click Start, point to Programs, point to Microsoft BizTalk Server 2002, and then click BizTalk Messaging Manager.
b. Create a new document definition that is named DocNull. Leave the document specification blank.
c. Create a new messaging port to a file.
d. Create a new channel to the messaging port. Name the channel ChannelPassThrough.
e. For the ChannelPassThrough channel, use DocNull for both the inbound document and the outbound document.
3.Click Start, point to Programs, point to Microsoft BizTalk Server 2002, and then click BizTalk Server Administration.
4.Create a new Message Queuing receive function. In the Polling location box, type the following:
Direct=OS:Server Name\private$\TestQ
Note Server Name is a placeholder for the name of your computer that is running BizTalk Server.
5.Click to select the Submit with a pass-through flag check box.
6.In the Channel name box, click ChannelPassThrough.
7.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.
8.Add a reference to the System.Messaging namespace.
9.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("FormatName:DIRECT=OS:.\\private$\\TestQ");
		System.Messaging.Message msg = new System.Messaging.Message();
		msg.Formatter = new ActiveXMessageFormatter();
		msg.Body = bytArray;
		msg.AppSpecific = -1;
		mq.Send(msg, MessageQueueTransactionType.Single);
	}
}
10.Press CTRL+F5 to build and then run the project.

REFERENCES

For more information about BizTalk Server receive functions, visit the following Microsoft Web site: For more information about Message Queuing messages and about message body types, visit the following Microsoft Web site: For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
283035 MSMQ receive function may return PassThrough error

↑ Back to the top


Keywords: KB839064, kbprb

↑ Back to the top

Article Info
Article ID : 839064
Revision : 6
Created on : 3/19/2007
Published on : 3/19/2007
Exists online : False
Views : 390