using a string to create WCF client information instead of a .config file
-
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.
-
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.
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
-
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
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.