Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does an ASP.NET Web Service Namespace subdomain matter?

meaning is there a difference between

<WebService(Namespace:="http://theurl.com/")>

and

<WebService(Namespace:="http://www.theurl.com/")>

?

like image 404
MetaGuru Avatar asked Mar 01 '23 00:03

MetaGuru


2 Answers

Don't know if you're asking one of two things so I'll mention both.

1. What's the namespace for?

The reasons all derive from the W3C standards.

Very short answer: If you're doing some simple ASP.NET web services, all connecting through .NET you'll probably never know any difference. In fact, a lot of web services I've seen I see are still using tempuri.org ;-) Shame. If you're doing interop or are publishing a number of web services, a proper namespace guarantees uniqueness for similarly named services.

2. Does the subdomain matter?

Yes, different subdomain, therefore, while semantically equivalent, they're different namespaces. A namespace can look like a Url, but it's not. You could just as easily use something like "urn:org.tempuri" as a valid namespace.

like image 165
joshua.ewer Avatar answered Mar 07 '23 00:03

joshua.ewer


This indicates the XML Namespace of the web service, and has nothing to with an actual address.

So yes, the namespaces mentioned are different. Just as the System.Data and the System namespaces in C# are different namespaces.

Does it matter which one you choose when creating the service? No, just pick one...

Does it matter which one you choose when consuming the service? Yes, use the one that the creator picked. (Which is described in the WSDL)

like image 33
Arjan Einbu Avatar answered Mar 07 '23 00:03

Arjan Einbu