了解httpGetEnabled和Mex绑定 [英] Understanding httpGetEnabled and Mex binding

查看:42
本文介绍了了解httpGetEnabled和Mex绑定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在WCF服务中,我删除了默认的Mex绑定,并将默认服务行为中的httpGetEnabled属性设置为false.

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.

据我了解,该服务将不允许下载WSDL.但是,该服务的现有客户可以正常工作.

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

现在,当我在Internet Explorer中浏览到.svc时,它会建议3件事,以帮助我了解.svc文件的结构.

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

  1. 为服务创建行为.
  2. 在serviceMetadata元素中,创建httpGetEnabled属性并将其设置为true.
  3. 创建一个mex绑定终点.即

<端点地址="mex" binding ="mexHttpBinding"合同="IMetadataExchange"/>

现在让我问我一个问题.

Now let me come to my question.

当我只使httpGetEnabled ="true"时,就可以下载WSDL.我在这里看不到mex端点的重要性.

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

这里的mex终点的真正意义是什么?当httpGetEnabled允许我选择下载WSDL时,创建mex端点有什么需要?

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?

推荐答案

仅当您要使用WS-MetadataExchange而不是WSDL来获取服务元数据时,Mex端点才有意义.您可以同时启用一个或多个.

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可以使用WSDL或mex,因此不必担心.但您可能拥有仅支持一个或另一个的客户端.

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.

这篇关于了解httpGetEnabled和Mex绑定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆