I am learning about WCF deployment in IIS and I have found something strange. Basically my service only uses the default behavior regardless of how I set the behaviorConfiguration attribute of element in web.config.
So here's the relevant piece of my web.config:
<system.serviceModel>
<services>
<service name="TableImport" behaviorConfiguration="MyServiceTypeBehaviors">
<endpoint address="" binding="wsHttpBinding" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="false" />
</behavior>
<behavior name="MyServiceTypeBehaviors" >
<serviceMetadata httpGetEnabled="true" policyVersion="Policy15" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
As you can see the default serviceMetadata element has httpGetEnabled="false" whereas the MyServiceTypeBehaviors serviceMetadata element has httpGetEnabled="true". You can also see that my service's behaviorConfiguration attribute is set to "MyServiceTypeBehaviors".
The result should be that my service publishes metadata however through a browser and through Visual Studio "Add Service Reference" feature I get the same result: no metadata.
On the other hand if I enable metadata in the default behavior and disable it in "MyServiceTypeBehaviors" and continue to have my service use MyServiceTypeBehaviors then I get metadata both through the browser and through VS.
To me, these tests indicate that my service uses default behavior regardless of how I set up my config file... but at the same time I can change the default behavior through web.config so my web.config is in fact able to affect how the service works. Any ideas?