Webservices namespace- What does it do?

R

RobGSCL

I have three questions about the namespace parameter of a webservice:

What does it do?

Is it necessary for it to be unique?

Is there a way to modify it at runtime? I'll be deploying an app at
multiple locations and I don't want to have to recompile every time we
implement.

TIA
Rob
 
S

Scott M.

The WebService Namespace (as identified by the compiler attribute) looks
like a URL, but does not need to represent (in its entirety) a REAL
browseable resource on your organization's web server. It is not meant to
reflect the location the webservice is being served from and should remian
static.

It is used in conjunction with the XML data that will be sent to and
returned from the WebService. Since XML tags can be made up, we need a way
to "group" tags into logical containers. Just like .NET makes use of
Namespaces to group, organize and prevent naming collisions of classes, XML
uses Namespaces to do the same for XML markup. The format of an XML
namespace, however, takes the form of something that we know to be unique to
us (because if we just made up a word for our namespace name, it is possible
that others could inadvertently come up with the same term. So, we make a
namespace name from our company or organization's URL. Why in the world
would widget.com use "http://acme.com" in their namespace names? Well, they
wouldn't. Since our domain name is guaranteed to be unique in the world, we
START (key word here - START) our namespace off with our domain name. But
then, we add more to that (and this is the part to be clear on) that is
completely made up. So the whole URL becomes something that may not really
exist on the web, but that doesn't matter, because we're not trying to
browse to that address. We're just trying to identify our XML markup in a
way that no one else would.

For example: http://wallStreetMillionaires.com/services/stockQuote may
contain an XML tag called "string" and
http://dotComMillionaires.com/services/realTimeQuote might also contain an
XML tag called "string", but we'd now have a way to know who's "string" is
who's. But, we don't need to browse to either address, nor is our code
going to attempt to resolve those addresses. They're just names for our
tags.

Hope this helps.

-Scott
 
J

John Saunders

Scott M. said:
The WebService Namespace (as identified by the compiler attribute) looks
like a URL, but does not need to represent (in its entirety) a REAL
browseable resource on your organization's web server. It is not meant to
reflect the location the webservice is being served from and should remian
static.

In fact, it looks like a URL because it's a URN, and every URL is a URN.

You can also use something like urn:myService.myApplication.company.com.
That makes it clear that you're not describing the location of some file on
the Internet.

John
 
S

Scott M.

Actually, it looks like a URL because it is a URI (Uniform Resource
Indicator), not a URN, and every URL is a URI. URN's (Uniform Resource
Names) look very different from URL's (Uniform Resource Locator).

The World Wide Web Consortium standard for XML namespace names says that the
namespace should take the form of a URI (which both URL's and URN's are).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top