BUG: "The document was understood, but it could not be processed" error message occurs when you try to add a Web reference in Visual Studio .NET (820125)



The information in this article applies to:

  • Microsoft Web Services (included with the .NET Framework 1.1)
  • Microsoft Web Services (included with the .NET Framework) 1.0
  • Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2003), Professional Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2002), Professional Edition

SYMPTOMS

Visual Studio .NET 2003

You may type the URL of a local Web Services Description Language (WSDL) document and then click Go in the Add Web Reference dialog box. If the corresponding Web service contains a Web Service method that has a Typed Dataset as a parameter or as a return type, you may receive the following error message:

The document was understood, but it could not be processed.
- The WSDL document contains links that could not be resolved.
- There was an error downloading 'http://WebServerName/%WebServicePath%/Service1.asmx?schema=Dataset1'.
- The request failed with HTTP status 401: Unauthorized.


Note You receive this error only if the WSDL document describes a Web service that uses Basic Authentication.

Visual Studio .NET 2002

You may type the URL of a local Web Services Description Language (WSDL) document and then click Go to in the Add Web Reference dialog box. If the corresponding Web service contains a Web Service method that has a Typed Dataset as a parameter or as a return type, you receive the previous error message. Additionally, you receive the following message:
Web Services
(none)
No Web References were found on this page.

Note You receive this error only if the WSDL document describes a Web service that uses Basic Authentication.

CAUSE

When you create a local WSDL document, documents that are related to the corresponding Web service (including XML Schemas that define Typed Datasets) are also created and then saved on your local disk. When you click Go or you click Go to in the Add Web Reference dialog box, Visual Studio .NET internally starts the Web Services Discovery Tool (Disco.exe). This is done to obtain information about documents that are related to the WSDL document with the URL that you typed. However, when you type the file path of a local WSDL document and then click Go or click Go to, instead of using the locally-saved related documents, Disco.exe incorrectly tries to obtain information from the Web server where the corresponding Web service resides. To access this Web service, Disco.exe must provide credentials that are required for Basic Authentication. However, Disco.exe does not have these credentials and cannot provide them. Therefore, Basic Authentication fails, and you may receive the error message in the "Symptoms" section of this article.

WORKAROUND

To work around this bug, you can modify your local WSDL document so that this document contains the file path of the local XML Schema instead of the URL of the XML Schema that is on the Web server. After you receive the error message in the "Symptoms" section, follow these steps:
  1. In the Add Web Reference dialog box, click Cancel.
  2. Open Service1.wsdl, and then change the location attribute of the import element (<import>) that corresponds to the XML Schema. You can do this by replacing the URL of the XML Schema on the Web server with the file path of the local copy of the same XML Schema. For example, change the location attribute from
    http://WebServerName/%WebServicePath%/Service1.asmx?schema=Dataset1
    to:
    %LocalCopyPath%\Dataset1.xsd
    Note WebServerName is a placeholder for the name of a Web server, and %WebServicePath% is a placeholder for the path of the previously mentioned Web server of a Web service that uses Basic Authentication and that contains a Web Service method that has a Typed Dataset as a parameter or as a return type.

    Note Replace %LocalCopyPath% with the path of the folder that contains Service1.wsdl.
  3. Save Service1.wsdl, and then move to TestBasicAuth.
  4. On the Project menu, click Add Web Reference.
  5. In Visual Studio .NET 2003, type the file path of Service1.wsdl in the URL field of the Add Web Reference dialog box, and then click Go.

    In Visual Studio .NET 2002, type the file path of Service1.wsdl in the Address field of the Add Web Reference dialog box and then click Go to.

    Notice that you do not receive the error message in the "Symptoms" section. You can click Add Reference to add a Web reference to the local WSDL document of your project.
Note These steps are based on the sample from the "More Information" section of this article. Therefore, the code and the file names in these steps may differ from your code and your file names.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

MORE INFORMATION

Steps to Reproduce the Problem

  1. From the Visual Studio .NET command prompt, change the directory path of the location to a convenient folder where you can save local copies of documents that are related to a Web service.
  2. Run the following command from the command prompt:

    Disco /u:UserName /p:Password http://WebServerName/%WebServicePath%/Service1.asmx

    Note Replace WebServerName with the name of the Web server. Replace %WebServicePath% with the path of the previously mentioned Web server. You must have a Web service that uses Basic Authentication and that contains a Web Service method that has a Typed Dataset as a parameter or as a return type. Replace UserName with the user name of a user who has local logon rights for the previously mentioned Web server. Replace Password with the password of the user.

    Note You must use the /u command-line option and the /p command-line option to provide credentials that are required for Basic Authentication.

    Note Disco.exe creates files that correspond to Service1.disco, Service1.wsdl, Dataset1.xsd, Results.discomap.
  3. Start Visual Studio .NET. Create a Microsoft Windows application that is named TestBasicAuth.

    You can use either Visual Basic .NET or Visual C# .NET.
  4. On the Project menu, click Add Web Reference.
  5. In Visual Studio .NET 2003, type the file path of Service1.wsdl (that Disco.exe created in step 2) in the URL field of the Add Web Reference dialog box. Click Go.

    In Visual Studio .NET 2002, type the file path of Service1.wsdl (that Disco.exe created in step 3) in the Address field of the Add Web Reference dialog box. Click Go to.

    You receive the error message in the "Symptoms" section.

Modification Type:MinorLast Reviewed:9/13/2005
Keywords:kbvs2002sp1sweep kbXML kbWebServer kbSchema kbMsg kbide kbWebFolder kbDevStudio kbCommandLine kbClient kbUser kbRemoteProg kblogin kbInetDev kbDownload kbAuthentication kbCmnDlg kbMiscTools kbDiscovery kbDeployment kbConfig kbWebServices kbCompiler kberrmsg kbbug KB820125 kbAudDeveloper