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. General Programming
  3. C#
  4. namespace of WCF

namespace of WCF

Scheduled Pinned Locked Moved C#
questioncsharpwcfcom
7 Posts 2 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.
  • G Offline
    G Offline
    George_George
    wrote on last edited by
    #1

    Hello everyone, For the namespace defined for WCF, e.g. http://msdn.microsoft.com/en-us/library/ms731835.aspx

    [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples")]

    my question is, what is it usage for developer? The only usage I found is used by the proxy class generated by meta data, and transparent to developer. When do we need to deal with namespace? thanks in advance, George

    J 1 Reply Last reply
    0
    • G George_George

      Hello everyone, For the namespace defined for WCF, e.g. http://msdn.microsoft.com/en-us/library/ms731835.aspx

      [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples")]

      my question is, what is it usage for developer? The only usage I found is used by the proxy class generated by meta data, and transparent to developer. When do we need to deal with namespace? thanks in advance, George

      J Offline
      J Offline
      jkersch
      wrote on last edited by
      #2

      well, at least in my company, we use namespaces e.g. for versioning. for example:

      [ServiceContract(Namespace = "http://www.mycompany.com/product/2007/12")]

      and

      [ServiceContract(Namespace = "http://www.mycompany.com/product/2008/08")]

      notice the difference? at least for us this eases versioning. but i guess this is just one reason for using namespaces

      G 1 Reply Last reply
      0
      • J jkersch

        well, at least in my company, we use namespaces e.g. for versioning. for example:

        [ServiceContract(Namespace = "http://www.mycompany.com/product/2007/12")]

        and

        [ServiceContract(Namespace = "http://www.mycompany.com/product/2008/08")]

        notice the difference? at least for us this eases versioning. but i guess this is just one reason for using namespaces

        G Offline
        G Offline
        George_George
        wrote on last edited by
        #3

        Thanks jkersch, But even if they are of different namespaces, the client of WCF does not need namespace information to access, just need endpoint address, correct? My question is, does the client of WCF needs to use the namespace? regards, George

        J 1 Reply Last reply
        0
        • G George_George

          Thanks jkersch, But even if they are of different namespaces, the client of WCF does not need namespace information to access, just need endpoint address, correct? My question is, does the client of WCF needs to use the namespace? regards, George

          J Offline
          J Offline
          jkersch
          wrote on last edited by
          #4

          hi george, well...i guess this depends on your scenario. if you just want to simply consume a webservice, you probably won't need adding namespaces to your servicecontracts. but if things get larger, complexer, ... i guess it's doesn't harm starting to add namespaces to you services, but as i said, if you're in a simple scenario, your clients probably don't care about namespaces at all. regards j.

          G 1 Reply Last reply
          0
          • J jkersch

            hi george, well...i guess this depends on your scenario. if you just want to simply consume a webservice, you probably won't need adding namespaces to your servicecontracts. but if things get larger, complexer, ... i guess it's doesn't harm starting to add namespaces to you services, but as i said, if you're in a simple scenario, your clients probably don't care about namespaces at all. regards j.

            G Offline
            G Offline
            George_George
            wrote on last edited by
            #5

            Thanks jkersch, I agree with your comments. But from WCF client point of view, there is no need to provide namespace information of the service, only endpoint information is fine. Agree? So, my confusion is how could WCF client use namespace? regards, George

            J 1 Reply Last reply
            0
            • G George_George

              Thanks jkersch, I agree with your comments. But from WCF client point of view, there is no need to provide namespace information of the service, only endpoint information is fine. Agree? So, my confusion is how could WCF client use namespace? regards, George

              J Offline
              J Offline
              jkersch
              wrote on last edited by
              #6

              well, if you ask how you could retrieve the service namespace from withing the client, thats not very complicated. your service proxy has an Endpoint property that contains information about the service endpoint. there you can find a contract-property that contains (with some other information) the namespace. it's up to you wheter you can use the service namespace in the client, but i guess in most cases where you just simply want to communicate with a service, do some stuff and disconnect after it, you don't have to bother with namespace on the client side. But at least there is the possibility to use it (like most of the stuff in WCF, hardly anyone will ever use ALL of its features ;) regards j.

              G 1 Reply Last reply
              0
              • J jkersch

                well, if you ask how you could retrieve the service namespace from withing the client, thats not very complicated. your service proxy has an Endpoint property that contains information about the service endpoint. there you can find a contract-property that contains (with some other information) the namespace. it's up to you wheter you can use the service namespace in the client, but i guess in most cases where you just simply want to communicate with a service, do some stuff and disconnect after it, you don't have to bother with namespace on the client side. But at least there is the possibility to use it (like most of the stuff in WCF, hardly anyone will ever use ALL of its features ;) regards j.

                G Offline
                G Offline
                George_George
                wrote on last edited by
                #7

                Thanks jkersch, 1. My question is, I have read through here, http://msdn.microsoft.com/en-us/library/ms733133.aspx[^] but it does not contain any description about how to use namespace information of the remote WCF service, do you have any samples or documents to refer to me about how to utilize namespace from client side? 2. How namespace information is used at server side? regards, George

                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