ASMX: What should tempuri.org be replaced with?

asmx, namespaces, visual-studio, web-services

Solution

It's kind of ironic but the best answer is under : http://tempuri.org/

quote

Each XML Web Service needs a unique namespace in order for client applications to distinguish it from other services on the Web. By default, ASP.Net Web Services use http://tempuri.org/ for this purpose. While this suitable for XML Web Services under development, published services should use a unique, permanent namespace.

Your XML Web Service should be identified by a namespace that you control. For example, you can use your company's Internet domain name as part of the namespace. Although many namespaces look like URLs, they need not point to actual resources on the Web.

For XML Web Services creating using ASP.NET, the default namespace can be changed using the WebService attribute's Namespace property. The WebService attribute is applied to the class that contains the XML Web Service methods. Below is a code example that sets the namespace to "http://microsoft.com/webservices/":

C#
[WebService(Namespace="http://microsoft.com/webservices/")]
public class MyWebService {
    // implementation
}

Problem

Every new web service you create using visual studio comes with a predefined namespace like this: ``` [WebService(Namespace = "http://tempuri.org/")] ``` My web service will run at different clients, and on different domains, so because of this I don't know the domain upfront during development, also I don't want to have to edit this file, each time I deploy to a new client. What exactly should the value of Namespace be? It seems like a web address, but that doesn't make sense to me.

Original source

Related problems