Web services and namespaces

Discussion in 'ASP .Net Web Services' started by Erik Cruz, Dec 7, 2003.

  1. Erik Cruz

    Erik Cruz Guest

    Hi.

    VS.NETO help says the following about the webservice attribute:

    "The WebServiceAttribute is not required for an XML Web service to be
    published and executed. You can use the WebServiceAttribute to specify a
    name for the XML Web service that is not restricted by the rules for a
    common language runtime identifier, which is used in the service description
    and the Service help page for the XML Web service."

    I removed the WebService attribute from a web service I am writing, since
    the help says that it is not necessary. When I run the web service I noticed
    that the http://tempuri.org namespace was used automatically. I believe
    then, that the WebService attribute is necessary. What is the real role of
    this attribute? What kind of problems I may have if my web service does not
    have a namespace?

    TIA,
    Erik Cruz
     
    Erik Cruz, Dec 7, 2003
    #1
    1. Advertising

  2. Erik Cruz

    Erik Cruz Guest

    Hi Scott.

    No problems with the syntax for designating the namespaces. I would like to
    know if it is possible to create a web service without a namespace and if
    so, what disadvantages or problems can I find when running the web service?

    TIA,
    Erik Cruz

    "Scott M." <> wrote in message
    news:...
    > The Namespace is an XML designation that you create to help organize your
    > stuff. TempURI is just an example. If you look at the comments generated
    > in VS.NET when you make a web service, you'll see syntax for designating
    > your custom namespace.
    >
    >
    > "Erik Cruz" <> wrote in message
    > news:%...
    > > Hi.
    > >
    > > VS.NETO help says the following about the webservice attribute:
    > >
    > > "The WebServiceAttribute is not required for an XML Web service to be
    > > published and executed. You can use the WebServiceAttribute to specify a
    > > name for the XML Web service that is not restricted by the rules for a
    > > common language runtime identifier, which is used in the service

    > description
    > > and the Service help page for the XML Web service."
    > >
    > > I removed the WebService attribute from a web service I am writing,

    since
    > > the help says that it is not necessary. When I run the web service I

    > noticed
    > > that the http://tempuri.org namespace was used automatically. I believe
    > > then, that the WebService attribute is necessary. What is the real role

    of
    > > this attribute? What kind of problems I may have if my web service does

    > not
    > > have a namespace?
    > >
    > > TIA,
    > > Erik Cruz
    > >
    > >

    >
    >
     
    Erik Cruz, Dec 8, 2003
    #2
    1. Advertising

  3. Erik Cruz

    Scott M. Guest

    The Namespace is an XML designation that you create to help organize your
    stuff. TempURI is just an example. If you look at the comments generated
    in VS.NET when you make a web service, you'll see syntax for designating
    your custom namespace.


    "Erik Cruz" <> wrote in message
    news:%...
    > Hi.
    >
    > VS.NETO help says the following about the webservice attribute:
    >
    > "The WebServiceAttribute is not required for an XML Web service to be
    > published and executed. You can use the WebServiceAttribute to specify a
    > name for the XML Web service that is not restricted by the rules for a
    > common language runtime identifier, which is used in the service

    description
    > and the Service help page for the XML Web service."
    >
    > I removed the WebService attribute from a web service I am writing, since
    > the help says that it is not necessary. When I run the web service I

    noticed
    > that the http://tempuri.org namespace was used automatically. I believe
    > then, that the WebService attribute is necessary. What is the real role of
    > this attribute? What kind of problems I may have if my web service does

    not
    > have a namespace?
    >
    > TIA,
    > Erik Cruz
    >
    >
     
    Scott M., Dec 8, 2003
    #3
  4. Erik Cruz

    Scott M. Guest

    You need to investigate XML a bit more and this will become clear. In XML,
    namespaces are used to qualify and define what xml tags are what, similarly
    to how in .NET, namespaces keep classes straight.

    You do need a namespace for your web service and it can take the form of a
    URL. You can then make up the rest. If you put it in the form of a URL
    though, you can use your company's domain name (which is guaranteed by DNS
    to be unique).

    Namespaces for web services help not only you keep your stuff straight, they
    also help the consumers of the web service understand what they are
    consuming.


    "Erik Cruz" <> wrote in message
    news:...
    > Hi Scott.
    >
    > No problems with the syntax for designating the namespaces. I would like

    to
    > know if it is possible to create a web service without a namespace and if
    > so, what disadvantages or problems can I find when running the web

    service?
    >
    > TIA,
    > Erik Cruz
    >
    > "Scott M." <> wrote in message
    > news:...
    > > The Namespace is an XML designation that you create to help organize

    your
    > > stuff. TempURI is just an example. If you look at the comments

    generated
    > > in VS.NET when you make a web service, you'll see syntax for designating
    > > your custom namespace.
    > >
    > >
    > > "Erik Cruz" <> wrote in message
    > > news:%...
    > > > Hi.
    > > >
    > > > VS.NETO help says the following about the webservice attribute:
    > > >
    > > > "The WebServiceAttribute is not required for an XML Web service to be
    > > > published and executed. You can use the WebServiceAttribute to specify

    a
    > > > name for the XML Web service that is not restricted by the rules for a
    > > > common language runtime identifier, which is used in the service

    > > description
    > > > and the Service help page for the XML Web service."
    > > >
    > > > I removed the WebService attribute from a web service I am writing,

    > since
    > > > the help says that it is not necessary. When I run the web service I

    > > noticed
    > > > that the http://tempuri.org namespace was used automatically. I

    believe
    > > > then, that the WebService attribute is necessary. What is the real

    role
    > of
    > > > this attribute? What kind of problems I may have if my web service

    does
    > > not
    > > > have a namespace?
    > > >
    > > > TIA,
    > > > Erik Cruz
    > > >
    > > >

    > >
    > >

    >
    >
     
    Scott M., Dec 9, 2003
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nick
    Replies:
    1
    Views:
    6,256
    Alvin Bruney - ASP.NET MVP
    Sep 12, 2005
  2. Anup
    Replies:
    1
    Views:
    2,828
    Mark Rae
    May 9, 2006
  3. va
    Replies:
    0
    Views:
    197
  4. IanT
    Replies:
    1
    Views:
    136
    Dino Chiesa [Microsoft]
    Jun 30, 2004
  5. John
    Replies:
    4
    Views:
    501
Loading...

Share This Page