Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Web service namespace

Web service namespace

Scheduled Pinned Locked Moved ASP.NET
question
7 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hung_ngole
    wrote on last edited by
    #1

    Hi, I'm writing a web service! Can you tell me how can I get my web service namespace from code. For ex: ... Public Class Service Inherits System.Web.Services.WebService Public Function HelloWorld() As String Return "HelloWorld" End Function Public Sub GetWebServiceNameSpace() 'How can I get Web service Namespace End Sub End Class Thanks, Hung -- modified at 12:01 Thursday 20th April, 2006

    M J 2 Replies Last reply
    0
    • H hung_ngole

      Hi, I'm writing a web service! Can you tell me how can I get my web service namespace from code. For ex: ... Public Class Service Inherits System.Web.Services.WebService Public Function HelloWorld() As String Return "HelloWorld" End Function Public Sub GetWebServiceNameSpace() 'How can I get Web service Namespace End Sub End Class Thanks, Hung -- modified at 12:01 Thursday 20th April, 2006

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      Try this Me.GetType.Namespace[^]

      H 1 Reply Last reply
      0
      • M minhpc_bk

        Try this Me.GetType.Namespace[^]

        H Offline
        H Offline
        hung_ngole
        wrote on last edited by
        #3

        thanks minhpc_bk but I can't get namespace of own webservice for ex:

        M 1 Reply Last reply
        0
        • H hung_ngole

          thanks minhpc_bk but I can't get namespace of own webservice for ex:

          M Offline
          M Offline
          minhpc_bk
          wrote on last edited by
          #4

          Hung, Below is a quick example:

          Namespace myns
          Public Class MyWebservice
          Inherits System.Web.Services.WebService
          Public Function getNameSpace() As String
          'How can I get the namespace of this webservice (it's namespace is "myns"
          getNameSpace = Me.GetType.Namespace
          End Function
          End Class
          End Namespace

          .....

          Dim service As myns.MyWebservice = New myns.MyWebservice()
          Dim nspace As String = service.getNameSpace
          'The nspace object returns the "myns" value.

          H 1 Reply Last reply
          0
          • H hung_ngole

            Hi, I'm writing a web service! Can you tell me how can I get my web service namespace from code. For ex: ... Public Class Service Inherits System.Web.Services.WebService Public Function HelloWorld() As String Return "HelloWorld" End Function Public Sub GetWebServiceNameSpace() 'How can I get Web service Namespace End Sub End Class Thanks, Hung -- modified at 12:01 Thursday 20th April, 2006

            J Offline
            J Offline
            jitendra gupta
            wrote on last edited by
            #5

            r u want to use webservice in your application ???????? jitendra

            H 1 Reply Last reply
            0
            • M minhpc_bk

              Hung, Below is a quick example:

              Namespace myns
              Public Class MyWebservice
              Inherits System.Web.Services.WebService
              Public Function getNameSpace() As String
              'How can I get the namespace of this webservice (it's namespace is "myns"
              getNameSpace = Me.GetType.Namespace
              End Function
              End Class
              End Namespace

              .....

              Dim service As myns.MyWebservice = New myns.MyWebservice()
              Dim nspace As String = service.getNameSpace
              'The nspace object returns the "myns" value.

              H Offline
              H Offline
              hung_ngole
              wrote on last edited by
              #6

              I create a web service (.asmx file) and I don't think I will make new object of my web service as your code: Dim service As myns.MyWebservice = New myns.MyWebservice() Dim nspace As String = service.getNameSpace The VS Studio 2005 generate code like that: Public Class Service Inherits System.Web.Services.WebService Public Function getNameSpace() As String Dim namespace as String = Me.GetType.Namespace Response.Write(namespace) 'So I want to get namespace from here 'not until making new object. End Function End Class End Namespace And I want to get it's namespace without create new object. Thanks, Hung

              1 Reply Last reply
              0
              • J jitendra gupta

                r u want to use webservice in your application ???????? jitendra

                H Offline
                H Offline
                hung_ngole
                wrote on last edited by
                #7

                I create a web service and put it on server. The web service itselft will get it's namespace and respond for client. have you got any ideas? Hung

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups