title: Why doesn't WSDL from WCF service include the custom binding for the STS?
body: <p>I'm writing a C# WCF service that publishes an endpoint using a WSHttpFederationBinding. We have our own security token server providing tokens, for which callers need to use a custom binding.</p>
  
  <p>This is all working fine for a C# client I've written: this has a custom binding in its app.config like so:</p>
  
  <pre><code>&lt;bindings&gt;
    &lt;customBinding&gt;
      &lt;binding name="CustBind"&gt;
        &lt;security authenticationMode="UserNameForCertificate" requireDerivedKeys="true"
                  messageProtectionOrder="SignBeforeEncryptAndEncryptSignature"
                  requireSecurityContextCancellation="false"
                  requireSignatureConfirmation="false"&gt;
          &lt;secureConversationBootstrap/&gt;
        &lt;/security&gt;
        &lt;httpTransport/&gt;
      &lt;/binding&gt;
    &lt;/customBinding&gt;
    &lt;wsFederationHttpBinding&gt;
      &lt;binding name="FedBind"&gt;
        &lt;security&gt;
          &lt;message issuedTokenType="http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1"
                   negotiateServiceCredential="false"&gt;
            &lt;issuer address="http://STSHost/MySTS" binding="customBinding"
                    bindingConfiguration="CustBind"&gt;
              &lt;identity&gt;
                &lt;certificateReference x509FindType="FindBySubjectName" findValue="localhost"/&gt;
              &lt;/identity&gt;
            &lt;/issuer&gt;
          &lt;/message&gt;
        &lt;/security&gt;
      &lt;/binding&gt;
    &lt;/wsFederationHttpBinding&gt;
  &lt;/bindings&gt;
  </code></pre>
  
  <p>However, what I want is for users to be able to generate their own clients in whatever language they want, just given the WSDL that the WCF service publishes. The problem with this is that when I try such a thing with Developer Studio's "Add Service Reference" functionality, the resulting client doesn't work.</p>
  
  <p>The reason it doesn't work is because the generated client's app.config is clearly wrong: while the STS is there in the "issuer" element, there's no sign of the custom binding. Looking at the WSDL this isn't too surprising, as there's no mention of anything there other than the issuer address.</p>
  
  <p>Is there any way to get WCF to add something to the WSDL to describe this situation? My server's app.config bindings look okay to me: the "issuer" element is exactly the same as for the working client, including the address and details of the custom binding. Does anyone know why WCF seems to be ignoring this when generating the WSDL?</p>