title: Create a WCF Client wihout Configuration File
body: <p>Kindly help me with this ..</p>
  
  <p>How to create a WCF client without specifying the client config in the app.config.</p>
  
  <p>I have seen this link </p>
  
  <p><a href="https://stackoverflow.com/questions/7688798/net-deploying-a-wcf-client-without-an-app-config">.NET - deploying a WCF client, without an app.config</a></p>
  
  <p>But there, you need to specify the configuration property by property.
  Is there anyway we can use the app.config configuration as a single string and assign to a class and get it done with?</p>
  
  <p>Like </p>
  
  <pre><code>var config=GetEndpointConfig(endPointName);
  var bindingData=GetBinding(nameodBinding);
  </code></pre>
  
  <p>Where the method returns entire config in string like this.</p>
  
  <p>endpoint:</p>
  
  <pre><code>&lt;endpoint address="http://localhost:61144/Sampler.svc" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_Iervice" contract="IService"
        name="BasicHttpBinding_IService" /&gt;
  </code></pre>
  
  <p>Binding : </p>
  
  <pre><code>&lt;basicHttpBinding&gt;
      &lt;binding name="BasicHttpBinding_IService" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
          messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
          useDefaultWebProxy="true"&gt;
        &lt;readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" /&gt;
        &lt;security mode="None"&gt;
          &lt;transport clientCredentialType="None" proxyCredentialType="None"
              realm="" /&gt;
          &lt;message clientCredentialType="UserName" algorithmSuite="Default" /&gt;
        &lt;/security&gt;
      &lt;/binding&gt;
    &lt;/basicHttpBinding&gt;
  </code></pre>
  
  <p>I don't want to import config file and load the configuration in the current application because, there are other modules which will be effected. I am quoting <a href="http://blogs.msdn.com/b/dotnetinterop/archive/2008/09/22/custom-service-config-file-for-a-wcf-service-hosted-in-iis.aspx" rel="nofollow noreferrer">this</a> example which is using</p>
  
  <pre><code> System.Configuration.Configuration config = 
              System.Configuration.ConfigurationManager.OpenMappedExeConfiguration
              (filemap, 
               System.Configuration.ConfigurationUserLevel.None);
  </code></pre>
  
  <p>Thanks in Advance!!!</p>