title: How can I programmatically create this custom binding?
body: <p>We've got to access a web service that uses soap11... no problem I'll just set the binding as:</p>
  
  <pre><code>BasicHttpBinding wsBinding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential);
  </code></pre>
  
  <p>Nope. No dice. So I asked the host of the service why we're having authentication issues and he said that our config needed to have this custom binding:</p>
  
  <pre><code>&lt;bindings&gt;
      &lt;customBinding&gt;
          &lt;binding name="lbinding"&gt;
              &lt;security  authenticationMode="UserNameOverTransport" 
                  messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11" 
                  securityHeaderLayout="Strict" 
                  includeTimestamp="false"
                  requireDerivedKeys="true" 
                  keyEntropyMode="ServerEntropy"&gt;
              &lt;/security&gt;
              &lt;textMessageEncoding messageVersion="Soap11" /&gt;
              &lt;httpsTransport authenticationScheme ="Negotiate" requireClientCertificate ="false" realm =""/&gt;
          &lt;/binding&gt;
      &lt;/customBinding&gt;
  &lt;/bindings&gt;
  </code></pre>
  
  <p>Only problem is we're creating our binding programmatically not via the config. So if someone could point me in the right direction in regards to changing my BasicHttpBinding into a custombinding that conforms to the .config value provided I'll give them a big shiny gold star for the day.</p>