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 may receive an "Index was outside the bounds of the array" error message when you have specified multiple schemas in the Document schemas collection of a receive pipeline in BizTalk Server 2004


View products that this article applies to.

Symptoms

Consider the following scenario. You have specified multiple schemas in the Document schemas collection of a receive pipeline in Microsoft BizTalk Server 2004. Some of the schemas do not have a Target Namespace property specified. When you try to receive an XML document by using a Web service, you may receive the following error message:
Index was outside the bounds of the array.
Note This problem occurs in both the XML disassembler and the BizTalk Framework disassembler.

↑ Back to the top


Cause

This problem occurs when the code that the BizTalk Web Services Publishing Wizard generates does not contain the root element of the schema.

↑ Back to the top


Workaround

To work around this problem, you must change the code that the BizTalk Web Services Publishing Wizard generates. To change the code, follow these steps:
  1. Start Microsoft Visual Studio .NET 2003, and then open the Web project.
  2. In Solution Explorer, right-click the myWebService.asmx file, and then click View Code.

    Note myWebService is the name of the Web service that you are using.
  3. Locate the source code line that is similar to the following code.
    string bodyTypeAssemblyQualifiedName =  "<WebServiceSchema>.Reference, <WebServiceSchema>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=<token>";
    Note <WebServiceSchema> is the schema. <token> is the public key token.
  4. Change the line by appending the root element of the schema to the schema reference as in the following code.
    string bodyTypeAssemblyQualifiedName =  "<WebServiceSchema>.Reference+<RootElement>, <WebServiceSchema>, Version=1.0.0.0, Culture=neutral, PublicKeyToken=<token>";
    Note <RootElement> is the .NET type name of the nested class that represents the root element of the multi-root schema. The identifier name might be different from the actual XML Schema (XSD) root element name.
  5. On the Build menu, click Build Solution.
Note You may have to reset Microsoft Internet Information Services (IIS) if the earlier .dll file is still in the ASPNET worker process.

↑ Back to the top


Status

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

↑ Back to the top


Keywords: KB899550, kbprb, kbbug, kbbtsmessaging, kbtshoot

↑ Back to the top

Article Info
Article ID : 899550
Revision : 2
Created on : 7/5/2005
Published on : 7/5/2005
Exists online : False
Views : 385