No recommendation is made to change the http://tempuri.org/ namespace in Visual C++ .NET Managed C++ Web Service applications (811586)



The information in this article applies to:

  • Microsoft Visual C++ .NET (2002)
  • Microsoft Visual C++ .NET (2003)
  • Microsoft Visual Studio .NET (2002), Academic Edition
  • Microsoft Visual Studio .NET (2002), Professional Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition

SYMPTOMS

When you run a Web service in Visual Studio .NET, and you click Start on the Debug menu, a Web page appears that displays the methods that are exposed by the Web service. If the Web service uses "http://tempuri.org/" as its default namespace, a recommendation is made to change the namespace appropriately. Recommendations for changes to namespaces are supplied for Microsoft Visual Basic .NET applications, and for Visual C# .NET applications, but not for Visual C++ .NET Managed C++ Web Service applications.

RESOLUTION

You can change the default namespace by using the Namespace property of the WebService attribute. The WebService attribute is an attribute that is applied to the class that contains the XML Web service methods. The following example sets the namespace to "http://microsoft.com/webservices/":
  [WebService(Namespace="http://microsoft.com/webservices/")]
	public __gc 
        class MyWebServiceClass : public System::Web::Services::WebService
    {
        // Implementation     
    };
Identify your XML Web service with a namespace that you control. For example, you can use the Internet domain name of your company as part of the namespace. Many XML Web service namespaces look similar to URLs, however, namespaces do not have to point to actual resources on the Web. (XML Web service namespaces are URIs.)

STATUS

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

MORE INFORMATION

Each XML Web service must have a unique namespace for client applications to distinguish the Web service from other services on the Web. For XML Web services that are under development, "http://tempuri.org/" is available. However, use a more permanent namespace for published XML Web services. For additional information about XML namespaces, see the following World Wide Web Consortium (W3C) Web site:

REFERENCES

For additional information about the WebServiceAttribute class, see the following Microsoft Developer Network (MSDN) Web site:For additional information about the W3C, see the following W3C Web site:

World Wide Web Consortium
http://www.w3.org

Idea Section

Changing http://TempURI.org/ Namespace in MC++ Applications

Modification Type:MinorLast Reviewed:8/24/2005
Keywords:kbvs2002sp1sweep kbWebServices kbbug KB811586 kbAudDeveloper