Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASMX: What should tempuri.org be replaced with?

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.

like image 754
JL. Avatar asked Mar 08 '10 16:03

JL.


People also ask

What is Tempuri org used for?

tempuri.org is the test default namespace URI used by Microsoft development products, like Visual Studio. It is available for XML Web services that are under development, but published XML Web services should use a more permanent namespace.

What is the default namespace for a new Web service?

The service description for a XML Web service is defined in XML, specifically in Web Services Description Language (WSDL). Within the Service Description for an XML Web service, Namespace is used as the default namespace for XML elements directly pertaining to the XML Web service.


2 Answers

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
}
like image 115
Jacob Avatar answered Sep 20 '22 14:09

Jacob


Put in your domain, as developer ;)

it is basically used as resource identifier to schemata. But it seems to ahve no real use except being "part of the standard".

like image 20
TomTom Avatar answered Sep 22 '22 14:09

TomTom