WCF Mex End Points for Multiple Snaps

I am creating a WCF service that will show the BasicHttp and NetTcp bindings. I also added two corresponding Mex endpoints, i.e.

<service name="WCFTest.CalculatorService" behaviorConfiguration="WCFTest.CalculatorBehavior"> <host> <baseAddresses> <add baseAddress = "http://localhost:8000/WCFTest/CalculatorService/" /> <add baseAddress = "net.tcp://localhost:9000/WCFTest/CalculatorService/" /> </baseAddresses> </host> <endpoint address ="basicHttpEP" binding="basicHttpBinding" contract="WCFTest.ICalculatorService"/> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> <endpoint address ="netTcpEP" binding="netTcpBinding" contract="WCFTest.ICalculatorService"/> <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"/> </service> 

Do I really need to add a NetTcp Mex endpoint as well as a BasicHttp Mex endpoint? Will clients not always use the Http mex endpoint to isolate metadata regardless of whether they are going to communicate using tcp or not?

thanks

+6
c # wcf mex
source share
2 answers

Yes, you can only use the HTTP mex endpoint. I think it is assumed that your client can communicate through HTTP.

+1
source share

No, the assumption in your code is that the communication channel can either http or net tcp.

If you do not declare this, it means that you prohibit the service / client from contacting only one binding.

+1
source share

All Articles