Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is tempuri.org?

Why does tempuri.org exist? Why does each XML Webservice require its own namespace, unique from any other on the web?

like image 345
SpoiledTechie.com Avatar asked Oct 08 '08 00:10

SpoiledTechie.com


2 Answers

Unfortunately the tempuri.org URL now just redirects to Bing.

You can see what it used to render via archive.org:

https://web.archive.org/web/20090304024056/http://tempuri.org/

To 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[sic] 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 } 

Visual Basic.NET

<WebService(Namespace:="http://microsoft.com/webservices/")> Public Class MyWebService     ' implementation End Class 

Visual J#.NET

/**@attribute WebService(Namespace="http://microsoft.com/webservices/")*/ public class MyWebService {     // implementation } 

It's also worth reading section 'A 1.3 Generating URIs' at:

http://www.w3.org/TR/wsdl#_Toc492291092

like image 160
Kev Avatar answered Sep 20 '22 22:09

Kev


Webservices require unique namespaces so they don't confuse each others schemas and whatever with each other. A URL (domain, subdomain, subsubdomain, etc) is a clever identifier as it's "guaranteed" to be unique, and in most circumstances you've already got one.

like image 34
Oddmund Avatar answered Sep 21 '22 22:09

Oddmund



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!