Please clear up something for me. I'm learning WCF and see a ServiceContractAttribute parameterized with Namespace = "http://www.mywebsite.com/andsoforth"
I read in another question that Namespaces are unique opaque keys. Instead of using GUIDs they are often URLs because legitimate ones are guaranteed unique.
Why is the "http:" scheme specified with a namespace URL? Why not just the URL?
Thanks for clarifying this.
Specifying the protocol, practically always http://
, as part of the namespace URI is just a convention, and a bad one at that. (Check the threads from July 2009 on XML-DEV to see some discussion of how XML namespaces are badly botched on various accounts, including the (fixable) convention of using URLs (instead of URNs) as URIs. Key XML people themselves are admitting XML namespaces are badly botched, but what can you do? They're here to stay.)
Why are HTTP URLs such a bad choice? Protocol colon double slash lots of letters slash directory more slashes and directory and now a final slash or rather not? Because one trailing slash does make a difference.
What should it have been like? Well, DNS, or Java namespaces. Does the job without confusing people.
Here's a practical recommendation. Make your life easier by choosing easy namespaces. Take a look at URNs, they're pretty close to DNS and Java.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With