3
votes

In a WCF service, I have removed the default Mex binding and I have set the httpGetEnabled attribute in the default service behaviour to false.

With this my understanding is that the service would not allow downloading of WSDL. However, the service's existing clients would work without trouble.

Now, when I browse to the .svc in Internet Explorer, it advices 3 things to help me see the structure of .svc file.

  1. Create a behaviour for the service.
  2. In the serviceMetadata element, create httpGetEnabled attribute and set it to true.
  3. Create a mex binding end point. i.e

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />

Now let me come to my question.

When I just make the httpGetEnabled="true", I am able to download the WSDL. I can't see the significance of mex endpoint here.

What is the real significance of mex end point here? What is the need for creating a mex end point when just httpGetEnabled gives me option to download WSDL?

1

1 Answers

4
votes

The Mex endpoint only becomes significant if you want to use WS-MetadataExchange instead of WSDL to grab the service metadata. You can enable one or the other, or both.

AFAIK, svcutil.exe can use either WSDL or mex, so it's not as much worry there; but you might have clients that only support one or the other.