views:

741

answers:

4

meaning is there a difference between

<WebService(Namespace:="http://theurl.com/")&gt;

and

<WebService(Namespace:="http://www.theurl.com/")&gt;

?

A: 

Short answer: No.

Long answer: Maybe.

If you are going to use the SOAP protocol yourself. The name space of the XML return might be required to be "www.*" in the code (a security "feature").

Jeremy
A: 

If you can type both into a browser and they work, then there's no difference. A lot of it depends on how the site is set up at the host. The option for the non "www" URL is simply a DNS entry.

criddar
+4  A: 

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.

joshua.ewer
+1  A: 

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)

Arjan Einbu