title: WCF4 hosting in IIS, WSDL: bindingNamespace is never read
body: <p>In trying to remove the "tempuri" references from a wsdl file. I have followed all existing advice I can think of. Add a </p>
  
  <pre><code>[ServiceBehavior(Namespace="mynamespace")] 
  </code></pre>
  
  <p>attribute to the implementation class, Add a </p>
  
  <pre><code>[ServiceContract(Namespace="mynamespace")]
  </code></pre>
  
  <p>to the contract interface and change the "bindingNamespace" attribute for the end point in the web.config to match.  Yet when loaded (in IIS) the bindingnamespace never gets changed .. its ALWAYS tempuri.  </p>
  
  <p>Does anyone have any other thoughts on fixing this problem?  Below is the sample from the web config...the bindingnamespace is never, no matter what i do, updated to be mynamespace, its always tempuri.org.  If, after loading the endpoints via a host factory, I iterate through the bindings in the host description and update them, they will change, but that seems like a hack.</p>
  
  <p>for a service at: "http://mydomain.com/MyService.svc" the following represents my end point configuration, does this even get used by IIS?</p>
  
  <pre><code>&lt;services&gt;
    &lt;service name="ServiceImplementationClassReference,MyAssembly" &gt;
      &lt;endpoint name=""
                address="MyService.svc"
                binding="basicHttpBinding"
                bindingNamespace="mynamespace"
                bindingConfiguration=""
                contract="IMyContract" /&gt;
  
      &lt;endpoint name="mexHttpBinding" 
                address="mex"
                binding="mexHttpBinding"
                contract="IMetadataExchange" /&gt;        
    &lt;/service&gt;
  &lt;/services&gt;
  </code></pre>
  
  <p>Relavent pieces of generated WSDL file that still reference tempuri.org</p>
  
  <pre><code>  &lt;wsdl:import namespace="http://tempuri.org/" location="http://mydomain.org/MyService.svc?wsdl=wsdl0" /&gt;
  </code></pre>
  
  <p>........</p>
  
  <pre><code>  &lt;wsdl:service name="Directory"&gt;
      &lt;wsdl:port name="BasicHttpBinding_IDirectoryServices"
      binding="i0:BasicHttpBinding_IDirectoryServices"&gt;
        &lt;soap:address location="http://mydomain.org/MyService.svc" /&gt;
      &lt;/wsdl:port&gt;
    &lt;/wsdl:service&gt;
  </code></pre>
  
  <p>in the wsdl:definition node the xml namespace i0 (as referenced by the service listed above) is also set to tempuri.org, hence the need for the import statement.  There is no change in the use of temprui if i Use BasicHttpBinding or wsHttpBinding. In fact, setting the binding to wsHttpBinding in the web.config file still results in the output above, referencing BasicHttpBinding_IdirectoryServices. </p>
  
  <p>Thanks!</p>