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 (839064)



The information in this article applies to:

  • Microsoft BizTalk Server 2002

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.

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.

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);
	}
}

STATUS

This behavior is by design.

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:
    1. Click Start, point to Programs, point to Microsoft BizTalk Server 2002, and then click BizTalk Messaging Manager.
    2. Create a new document definition that is named DocNull. Leave the document specification blank.
    3. Create a new messaging port to a file.
    4. Create a new channel to the messaging port. Name the channel ChannelPassThrough.
    5. 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


Modification Type:MajorLast Reviewed:9/1/2006
Keywords:kbprb KB839064 kbAudDeveloper