Microsoft KB Archive/816369

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

Article ID: 816369

Article Last Modified on 11/15/2007

-

APPLIES TO


 * Microsoft BizTalk Server 2002 Standard Edition
 * Microsoft BizTalk Adapter for MQSeries

-



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. However, this hotfix is intended to correct only the problem that is described in this article. Apply this hotfix only to systems that are experiencing this specific problem. This hotfix might receive additional testing. Therefore, if you are not severely affected by this problem, we recommend that you wait for the next service pack that contains this hotfix.

To resolve this problem, submit a request to Microsoft Online Customer Services to obtain the hotfix. To submit an online request to obtain the hotfix, visit the following Microsoft Web site:

http://go.microsoft.com/?linkid=6294451

Note If additional issues occur or any troubleshooting is required, you might have to create a separate service request. The usual support costs will apply to additional support questions and issues that do not qualify for this specific hotfix. To create a separate service request, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

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 &quot;Applies to&quot; section of this article.



MORE INFORMATION
This .dll is a COM component. To use it, you first register it with &quot;regsvr32&quot; 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.

Keywords: kbhotfixserver kbqfe kbbiztalk2002sp1fix kbbiztalk2002presp1fix kbfix kbbug KB816369

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.