Understanding the bindings of httpGetEnabled and Mex

In the WCF service, I removed the default binding binding, and I set the httpGetEnabled attribute in the default behavior of the service to false.

With this, I understand that the service will not allow the loading of WSDL. However, servicing existing customers will work without problems.

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

  • Create behavior for the service.
  • In the serviceMetadata element, create the httpGetEnabled attribute and set it to true.
  • Create a mex anchor endpoint. iee

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

Now let me come to my question.

When I just do httpGetEnabled = "true", I can load the WSDL. I do not see the value of the mex endpoint here.

What is the real significance of the mex endpoint here? What is the need to create a mex endpoint when only HTTPGetEnabled gives me the ability to load WSDL?

+3
source share
1 answer

The Mex endpoint becomes meaningful if you want to use WS-MetadataExchange instead of WSDL to capture service metadata. You can include one or the other, or both.

AFAIK, svcutil.exe can use either WSDL or mex, so it is not so much worried; but you may have clients that only support one or the other.

+4
source

Source: https://habr.com/ru/post/1785958/


All Articles