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.

BUG: You receive a "Server error" error message if you try to invoke a Web service that has a name that contains a space character by using Visual C++ .NET


View products that this article applies to.

Symptoms

You may use Microsoft Visual C++ .NET to create an XML Web service that contains a space character (" ") in its name. When you try to call this XML Web service, you receive an error message that is similar to the following:

Server Error in '/my webs' Application.
The resource cannot be found. Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly. Requested Url: /my webs/my+webs.asmx
Version Information: Microsoft .NET Framework Version:1.1.4322.573; ASP.NET Version:1.1.4322.573
Note The word "Url" is not capitalized correctly in this error message.

↑ Back to the top


Cause

If you name a Web service and if that name contains a space character (" "), during run time the space character is not escaped and the space character is replaced by a plus sign ("+") instead of by "%20". The plus sign ("+") value instead of a space character generates an address that either does not exist or may be irrelevant for that corresponding Web service or method.

↑ Back to the top


Workaround

To work around this problem, use any of the following methods:
  • Do not use space characters when you name a Web service. Use a name for the Web service that does not contain any space characters (" ").
  • Replace "+" with "%20" in the Address bar when you address the Web service. To do this with the example that is described in the "More Information" section of this article, follow these steps:
    1. After you click the HelloWorld link, a Web browser window opens with an address in the Address bar.
    2. Replace the following line in the Address box
      http://localhost/My%20Web2/my+webs.asmx?op=HelloWorld
      with the following line:
      http://localhost/My%20Web2/my%20webs.asmx?op=HelloWorld

↑ Back to the top


Status

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

↑ Back to the top


More information

Steps to reproduce the behavior

  1. Start Microsoft Visual Studio .NET.
  2. On the File menu, point to New, and then click Project. The New Project dialog box appears.
  3. Under Project Types, click Visual C++ Projects, and under Templates, click ASP.NET Web Service.

    Note In Microsoft Visual Studio .NET 2002, under Templates, click Managed C++ Web Service.
  4. In the Name box, type my webs, and then click OK.
  5. Press F5 to run the application. The mywebsClass Web Service Web page appears.

    Note In Microsoft Visual Studio .NET 2002, the Class1 Web Service Web page appears.
  6. On the Web page, click the HelloWorld link.

    You may notice the error message that is mentioned in the "Symptoms" section of this article.

↑ Back to the top


Keywords: kbwebservices, kbwebbrowser, kbweb, kbprogramming, kbbrowsing, kbappdev, kbbug, kbpending, KB837379

↑ Back to the top

Article Info
Article ID : 837379
Revision : 5
Created on : 3/12/2004
Published on : 3/12/2004
Exists online : False
Views : 459