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.
- Create a behaviour for the service.
- In the serviceMetadata element, 开发者_StackOverflowcreate httpGetEnabled attribute and set it to true.
- 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?
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.
精彩评论