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



The information in this article applies to:

  • Microsoft BizTalk Server 2004 Enterprise Edition
  • Microsoft BizTalk Server 2004 Standard Edition
  • Microsoft BizTalk Server 2004 Developer Edition
  • Microsoft BizTalk Server 2004 Partner Edition

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.

CAUSE

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

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.

STATUS

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

Modification Type:MajorLast Reviewed:7/5/2005
Keywords:kbtshoot kbBTSMessaging kbBug kbprb KB899550 kbAudDeveloper kbAudITPRO