发生什么,如果我设置HttpGetEnabled = FALSE [英] What happens if I set HttpGetEnabled = false

查看:486
本文介绍了发生什么,如果我设置HttpGetEnabled = FALSE的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很困惑与元数据发布的概念。

I am confused with Metadata publish concept.

如果在WCF服务配置文件,我曾写过:

If in a WCF Service config file I had written :

  <serviceMetadata httpGetEnabled="false"/>

无论是真的还是假的。当我试图给使用客户端应用程序服务引用添加服务引用...,然后点击查询,我能够检索服务引用。

No matter it is true or false. When I tried to give service reference in a client application using "Add Service Reference..." and clicked on "Discover", I am able to retrieve Service Reference.

但是,当删除以下两行: -

But when removed the following two lines: -

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

<serviceMetadata httpGetEnabled="false"/>

现在以后,当我试图给使用客户端应用程序参照添加服务引用...,并点击查看,我的不可以能够检索服务参考.. ..

Now after that when I tried to give reference in a client application using "Add Service Reference...." and clicked on "Discover", I am NOT able to retrieve Service Reference....

现在谁能告诉我究竟是什么意思。 为什么将它设置为False它仍然允许设定的基准后。为什么消除这些线条是不允许设定基准后。

Now can anyone tell me what exactly it means. Why after setting it False it is still allowing to set reference. And why after removing those lines it is not allowing to set reference.

-Anil

推荐答案

MEX和WSDL是两种不同的模式,告诉潜在的客户对你的服务的结构。所以,你可以选择要么让你的服务合同公开为元数据exchance格式(墨西哥),或在 Web服务描述语言(WSDL) - 。后者是通过HTTP(多个)访问的

MEX and WSDL are two different schemes to tell potential clients about the structure of your service. So you can choose to either make your service contracts public as "metadata exchance format" (MEX) or in the "web service description language" (WSDL) -- the latter being accessible via HTTP(s).

因此​​,为了生成代理,则需要元数据的信息。当您删除serviceMetadata行,你说你不提供元数据WSDL格式。

Thus in order to generate proxies, you need meta data information. When you remove the serviceMetadata-line you say you are not providing meta data in WSDL format.

但前行,在发布MEX元数据,仍处于活动状态,从而可以生成从这些元数据的代理。

But the line before, publishing your metadata in MEX, is still active, thus you can generate a proxy from those metadata.

从这些自然得出结论,当你没有提供的WSDL也不MEX格式的信息,就无法生成一个代理。

From those follows naturally that when you provide neither WSDL nor MEX formatted information, you cannot generate a proxy.

由于乔尔c正确指出的,绑定一个(N几乎)正交的概念。无论您是允许客户端通过基本的HTTP,WS HTTP和你说话,净命名管道或水晶球是相当不依赖于你如何发布服务。

As Joel C correctly pointed out, the bindings are a(n almost) orthogonal concept. Whether you allow clients to talk to you via basic HTTP, ws HTTP, net named pipes or crystal balls is quite not dependent on how you publish your services.

借助 WCF安全指导项目和/或MS的"practises和模式为WCF安全可能会提供更深入的了解。

The WCF security guidance project and / or MS "practises and patterns" for WCF security might provide deeper insight.

这篇关于发生什么,如果我设置HttpGetEnabled = FALSE的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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