title: Configuring a web service endPoint and contract from C# code?
body: <p><strong>Edit</strong>: I decided to just convert this to a normal web page, as I only need to provide one integer parameter and retrieve a string.</p>
  
  <p>I'll leave the question open if anyone has a good answer.</p>
  
  <hr>
  
  <p>I have a web service that I want to call, but because this must be called from a plugin to another system, an application config file with all the configuration in won't do, as the plugin system doesn't read that file at all, just the DLL.</p>
  
  <p>So, the question is, how can I take the relevant parts from the config file and translate this to code instead?</p>
  
  <p>The parts I probably need to convert are:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;bindings&gt;
          &lt;basicHttpBinding&gt;
              &lt;binding name="TooltipServiceSoap" 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;
      &lt;/bindings&gt;
      &lt;client&gt;
          &lt;endpoint address="http://localhost:2952/TooltipService.asmx"
              binding="basicHttpBinding" bindingConfiguration="TooltipServiceSoap"
              contract="TooltipService.TooltipServiceSoap" name="TooltipServiceSoap" /&gt;
      &lt;/client&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>The URL and such will of course change, but that's for me to figure out if someone can just point me in the right direction on how to get the necessary code into the application so that if I delete the application config file, it will still work.</p>