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
  1. Home
  2. General Programming
  3. WCF and WF
  4. using a string to create WCF client information instead of a .config file

using a string to create WCF client information instead of a .config file

Scheduled Pinned Locked Moved WCF and WF
questioncsharpwcfannouncementworkspace
3 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.
  • I Offline
    I Offline
    impeham
    wrote on last edited by
    #1

    Hi. I have following question: When creating a WCF client, a ".config" file is created for it containing the endpoints information. What I want to do is this: 1. Copy its text and paste it to some section in another configuration file (of my application which has other configuration elements related to other things). 2. When the client application is executed, it will read the section related to WCF client from my global configuration file and will use it as the endpoints configuration. I do not want to use any logic in step 2. I just want to read the information from my global configuration and tell the client - "here - that's your configuration file - don't try to load it from the file system). The purpose of this is that if anything is changed by Microsoft, it will not require any code changes by me (just update the global configuration at the WCF client's configuration section) Anyone knows if this can be done (something like create an endpoint object from a string)? Thanks.

    C 1 Reply Last reply
    0
    • I impeham

      Hi. I have following question: When creating a WCF client, a ".config" file is created for it containing the endpoints information. What I want to do is this: 1. Copy its text and paste it to some section in another configuration file (of my application which has other configuration elements related to other things). 2. When the client application is executed, it will read the section related to WCF client from my global configuration file and will use it as the endpoints configuration. I do not want to use any logic in step 2. I just want to read the information from my global configuration and tell the client - "here - that's your configuration file - don't try to load it from the file system). The purpose of this is that if anything is changed by Microsoft, it will not require any code changes by me (just update the global configuration at the WCF client's configuration section) Anyone knows if this can be done (something like create an endpoint object from a string)? Thanks.

      C Offline
      C Offline
      christoph brandle
      wrote on last edited by
      #2

      as i understand if there is a config file, it is used anyway. but in your case, maybe a small helper can do the job to examine if the config is used at all. i wrote an article last year which does not use config files at all, what of course also could let go arrive where you want. www.codeproject.com/KB/WCF/WCFbyInterfaces.aspx cheers, Christoph

      I 1 Reply Last reply
      0
      • C christoph brandle

        as i understand if there is a config file, it is used anyway. but in your case, maybe a small helper can do the job to examine if the config is used at all. i wrote an article last year which does not use config files at all, what of course also could let go arrive where you want. www.codeproject.com/KB/WCF/WCFbyInterfaces.aspx cheers, Christoph

        I Offline
        I Offline
        impeham
        wrote on last edited by
        #3

        This will require mappings between the parameters in the client configuration file to the hard coded members which is not good for me. i thought there might be a way to load all the information from a config section as a string and just pass it to an object (supported in .NET framework - not mine) that knows how to process and use it. this way if the config structure is changed, i won't need to maintain it in any way. Thanks.

        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