FIX: Cannot Process Binary Data by Using a C# Postprocessor and the BizTalk Adapter for MQSeries 1.0 (816369)



The information in this article applies to:

  • Microsoft BizTalk Server 2002
  • Microsoft BizTalk Adapter for MQSeries 1.0

SYMPTOMS

When you exchange binary data by using a custom C# preprocessor or postprocessor with the BizTalk Adapter for MQSeries, you may notice that your custom processor does not manage the data correctly.

CAUSE

This problem occurs because the application integration component (AIC) passes binary data into and out of the dictionary. However, a C# component can manage only string data.

RESOLUTION

A supported hotfix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Only apply it to systems that are experiencing this specific problem. This hotfix may receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next Microsoft BizTalk Server 2002 service pack that contains this hotfix.

To resolve this problem immediately, contact Microsoft Product Support Services to obtain the hotfix. For a complete list of Microsoft Product Support Services telephone numbers and information about support costs, visit the following Microsoft Web site:Note In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question. The English version of this fix has the file attributes (or later) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time tool in Control Panel.
   Date         Time   Version     Size    File name
   ----------------------------------------------------------------
   05-Nov-2003  22:29  3.0.2509.0  33,040  Workingdatamarshaler.dll
Note Because of file dependencies, the most recent hotfix or feature that contains these files may also contain additional files.

STATUS

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section of this article.

MORE INFORMATION

This .dll is a COM component. To use it, you first register it with "regsvr32" and add a reference to it in your C# project. Then you can create a runtime callable wrapper of the CWorkingDataMarsher class.

In your C# component, you must pass the data through the MarshalNativeToManaged function before you gain access to the working_data field of the dictionary object.

After you have completed working with the data, and before you return to the AIC, you must do the reverse operation by passing the data through the MarshalManagedToNative function.
HRESULT MarshalNativeToManaged(VARIANT_BOOL bBinaryData, IDictionary* pDict, IDictionary** ppOutDict)
  • bBinaryData - If true, the BSTR in the input dictionary is converted to a Variant of VT_ARRAY|VT_UI1 so that the C# program can gain access to it as byte[]. If false, the BSTR is marshaled as a string in C#. However, if the input string contains an odd number of bytes, an extra byte is added to make the input string even.
  • pDict - The input dictionary object.
  • ppOutDict - The output dictionary object.
HRESULT MarshalManagedToNative(VARIANT_BOOL bBinaryData, IDictionary* pDict, IDictionary** ppOutDict)
  • bBinaryData - If true, and if the input Variant is of type VT_ARRARY|VT_UI1, it is converted to packed BSTR. If false, the input dictionary is copied to the output dictionary object as-is.
  • pDict - The input dictionary object.
  • ppOutDict - The output dictionary object.

If you are using binary data, you should set bBinaryData to true when calling these two functions.

Modification Type:MinorLast Reviewed:10/11/2005
Keywords:kbHotfixServer kbQFE kbBizTalk2002SP1fix kbBizTalk2002preSP1fix kbfix kbbug KB816369 kbAudDeveloper