This seems to be useful in the following situation...
<system.serviceModel>
<services>
<service name="WCFService.Service" behaviorConfiguration="ServiceBehavior">
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8080/WCFService"/>
</baseAddresses>
</host>
<!-- Net.Tcp EndPoints-->
<endpoint address=""
binding="netTcpBinding"
contract="WCFService.IService" />
<endpoint address="mex"
binding="mexTcpBinding"
contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpGetEnabled="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
There are no HTTP endpoints defined and you can get to your service in the following ways...
- Browser: http://localhost/WCFService/Service.svc
- svcutil.exe net.tcp://localhost:8080/WCFService/Service.svc/mex
If you comment out the MEX endpoint then neither will work.
You wonder why the meta data can still be seen in the browser as
a) I don't have a HTTP endpoint and
b) I have specifically set ...
<serviceMetadata httpGetEnabled="false" />
The reason for this is that in the advanced settings for the website I had the following defined for Enabled Protocols under Advanced Settings...
http,net.tcp
If you remove http
then the metadata cannot be seen in the browser. It would seem that it is in this scenario, a net.tcp enabled only website, that you need the mex endpoint.