Microsoft Knowledge Base Email Alertz

(837379) - Explains the error message that appears if you invoke a Web service where the Web service name contains a space character ( ).

Search KbAlertz

Advanced Search

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]











Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks

Article ID: 837379 - Last Review: March 12, 2004 - Revision: 1.4

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

On This Page

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.

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.

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

STATUS

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

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.

APPLIES TO
  • Microsoft ASP.NET 1.1
  • Microsoft ASP.NET 1.0
  • Microsoft Visual C++ .NET 2003 Standard Edition
  • Microsoft Visual C++ .NET 2002 Standard Edition
  • Microsoft Web Services Enhancements for Microsoft .NET 1.1
  • Microsoft Web Services (included with the .NET Framework) 1.0
Keywords: 
kbpending kbwebservices kbwebbrowser kbweb kbprogramming kbbrowsing kbappdev kbbug KB837379
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate