WSDL 和 WSDL 之间有什么区别?WCF 中的 Mex 端点 [英] What was the difference between WSDL & Mex Endpoint in WCF

查看:35
本文介绍了WSDL 和 WSDL 之间有什么区别?WCF 中的 Mex 端点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个关于 mex 端点的问题.

  1. 在旧版 Web 服务中,我们使用 wsdl 创建代理.WSDL 公开 Web 服务的元数据.在 wcf 中,另一个术语是 mex 端点,它也公开元数据,但 wsdl 在 wcf 中仍然存在.我是 wcf 的新手,我对 wsdl 与 之间的差异感到困惑mex 端点?

  2. httpGetEnabled="false" 或 httpGetEnabled="true" 是什么意思?

  3. 如果我设置了 httpGetEnabled="false" 那么会发生什么?这是否意味着客户端将无法从其 IDE 添加服务引用?但是如果我设置了 httpGetEnabled="false",并且看到客户端可以添加服务引用.httpGetEnabled 设置的作用非常令人困惑.

  4. 一个人说

<块引用>

MEX 和 WSDL 是两种不同的方案来告诉潜在客户关于您的服务结构.所以你可以选择要么制作您的服务合同公开为 (MEX) 或 WSDL.

如果上述陈述为真,请告诉我何时使用 MEX &什么时候使用WSDL?

  1. 如何禁用 mex 并仅通过 WSDL 公开我的服务?

  2. WSDL 支持 wshttp、wsdualhttp 或 tcp 等所有出价... 如果可能,请讨论 wsdl &详细信息.

更新

你说

5.如何禁用 mex 并仅通过 WSDL 公开我的服务?不要在您的配置中指定 mex 端点并使用 httpGetEnabled.

您的意思是说配置中不应该有与 mex 端点相关的条目,而 httpgetenable 将如下所示?

你说

<块引用>

WSDL 通常通过 http 或 https get urls 公开,您无法真正配置(例如出于安全限制或向后兼容).MEX 端点公开元数据可配置的端点,并且可以使用不同类型的传输,如 TCP 或 HTTP,以及不同类型的安全机制.

你说 mex 是可配置的,但 wsdl 不是.mex 是可配置的 是什么意思?请讨论 mex 支持什么样的配置以及如何配置.

如果我设置了 httpGetEnabled="false" 那么 WSDL 将无法生成?

解决方案

1) 在旧版 Web 服务中,我们使用 wsdl 创建代理.WSDL 公开网络服务元数据.在 wcf 中,另一个术语是 mex 端点还公开元数据,但 wsdl 仍然存在于 wcf.我是 wcf 的新手因此我很困惑 wsdl & 之间的区别是什么墨西哥端点?

这很相似,但 mex 旨在支持非 HTTP 协议和高级配置/安全方案.WSDL 是传统方式,MEX 是 WCF 的新改进版本.

<块引用>

2) httpGetEnabled="false" 是什么意思或者httpGetEnabled="true"

它会通过 wsdl 通过 defautl url 公开元数据,即使您没有为您的服务定义 mex 端点.

<块引用>

3) 如果我设置 httpGetEnabled="false" 那么会发生什么?是什么意思该客户端将无法从 IDE 添加服务引用?但是我设置 httpGetEnabled="false" 并看到客户端可以添加服务引用.所以我很困惑 httpGetEnabled 是假的还是真的吗?

仅当启用了 httpGetEnabled/httpsGetEnabled 或者您在服务配置中定义了 mex 端点时,客户端才能在 VS 中添加引用.最佳实践是在开发环境中公开元数据,而不是在生产环境中公开元数据.您还可以通过单独的程序集分发您的服务合同并使用 ChannelFactory.

<块引用>

4) 一个人说:- MEX 和 WSDL 是两种不同的方案潜在客户了解您的服务结构.所以你可以选择将您的服务合同公开为 (MEX) 或 WSDL.如果上述陈述属实,请告诉我何时使用 MEX &何时使用 WSDL?

WSDL 通常通过 http 或 https get url 公开,您无法真正配置(例如出于安全限制或向后兼容性).MEX 端点通过可配置端点公开元数据,并且可以使用不同类型的传输,例如 TCP 或 HTTP,以及不同类型的安全机制.

因此 MEX 更具可配置性,而 WSDL 与旧版本的客户端和使用 WSDL 的非 .net 客户端更具互操作性.

<块引用>

5) 如何禁用 mex 并仅通过 WSDL 公开我的服务

不要在您的配置中指定 mex 端点并使用 httpGetEnabled

<块引用>

6) WSDL 支持 wshttp、wsdualhttp 或 tcp 等所有竞价...

公开元数据与调用服务完全不同.

更新

<块引用>

你是想说不应该有与 mex 端点相关的条目在 config 和 httpgetenable 中看起来像

是的,您不必指定 mex 端点和 httpGetEnabled.只需要一个来公开元数据.请勿指定 httpGetUrl,因为这取决于您的托管环境.

<块引用>

你说 mex 是可配置的,但 wsdl 不是.你想表达什么意思mex 是可配置的...请讨论 mex 什么样的配置支持 &如何配置.

MEX 端点是特殊端点,允许客户端使用 SOAP 消息而不是 http get 请求来接收服务的元数据.您可以创建可通过 http、https、tcp 甚至命名管道访问的 MEX 端点.HttpGetEnable 允许您通过 HTTP GET 方法公开元数据,通常是后缀为?wsdl"的服务地址

MEX 和 WSDL 的输出几乎相同.

在大多数情况下,不需要 MEX 端点——使用带有 http get 的 WSDL 通常就足够了.

我理解你想了解这部分的意图,但不要在这上面花太多时间:还有很多其他复杂的功能!

I have couple of question on mex endpoint.

  1. In legacy web services, we create a proxy using wsdl. The WSDL exposes the web service's meta data. In wcf, another term comes that mex endpoint, which also exposes meta data, but wsdl is still alive in wcf. I am new to wcf, and I am confused regarding the difference between wsdl & mex endpoint?

  2. What is the meaning of httpGetEnabled="false" or httpGetEnabled="true"?

  3. If I set httpGetEnabled="false" then what will happen? Does it mean the client will not be able to add service reference from their IDE? But if I set httpGetEnabled="false", and saw client can add service reference. What the httpGetEnabled setting does is very confusing.

  4. One guy said

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 (MEX) or WSDL.

If the above statement is true then tell me when to use MEX & when to use WSDL?

  1. How can I disable mex and expose my service only through WSDL?

  2. WSDL support all bidning like wshttp,wsdualhttp or tcp etc... If possible please discuss about wsdl & mex in details.

UPDATE

You said

5. How can I disable mex and expose my service only through WSDL?

Do not specifiy a mex endpoint in your config and use httpGetEnabled.

Are you trying to mean that there should be no mex endpoint related entry in config and httpgetenable would look like the following?

<serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost:8080/SampleService?wsdl"/>

You said

A WSDL is generally exposed through http or https get urls that you can't really configure (say for security limitations or for backward compatibility). MEX endpoints expose metadata over configurable endpoints, and can use different types of transports, such as TCP or HTTP, and different types of security mechanisms.

You said mex is configurable, but the wsdl is not. What do you mean by mex is configurable? Please discuss what kind of configuration mex support and how it can be configured.

If I set httpGetEnabled="false" then the WSDL will not be possible to generate?

解决方案

1) in legacy web service we create proxy using wsdl. WSDL expose web service meta data. in wcf another term comes that mex endpoint which also expose meta data but wsdl is still live in wcf.i am new in wcf hence i am confusing what is the difference between wsdl & mex endpoint?

It's pretty the same thing but mex is designed to support non-HTTP protocols and for advanced configuration/security scenarios. WSDL is the legacy way and MEX is the new improved version with WCF.

2) what is the meaning of httpGetEnabled="false" or httpGetEnabled="true"

It will expose metadata via wsdl through the defautl url, even if you don't have defined a mex endpoint for your service.

3) if i set httpGetEnabled="false" then what will happen? does it mean that client will not be able to add service reference from IDE? but i set httpGetEnabled="false" and saw client can add service reference. so it is very confusing for me that what httpGetEnabled is false or true does ?

A client can add a reference in VS only if httpGetEnabled/httpsGetEnabled is enable or if you have define a mex endpoint in the configuration of your service. The best practice is to expose metadata on dev environnement but not on production. You can also distribute your service contracts via separate assemblies and use ChannelFactory.

4) one guy said :- 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 (MEX) or WSDL. if the above statement is true then tell me when to use MEX & when to use WSDL?

A WSDL is generally exposed through http or https get urls that you can't really configure (say for security limitations or for backward compatibility). MEX endpoints expose metadata over configurable endpoints, and can use different types of transports, such as TCP or HTTP, and different types of security mechanisms.

So MEX are more configurable, while WSDL is more interoperable with older versions of clients and non-.net clients that work with WSDLs.

5) how could i disable mex and expose my service through only WSDL

Do not specifiy a mex endpoint in your config and use httpGetEnabled

6) WSDL support all bidning like wshttp,wsdualhttp or tcp etc...

Exposing metadata is totally different that invoking the service.

UPDATE

re you try to mean that there should be no mex endpoint related entry in config and httpgetenable would look like

Yes, you don't have to specify a mex endpoint AND httpGetEnabled. Only one is required to expose metadata. Do not specifiy httpGetUrl as this is depending on your hosting environment.

you said mex is configurable but wsdl is not. what r u trying to means mex is configurable...please discuss what kind of configuration mex support & how to configure.

MEX endpoints are special endpoints that allow clients to receive the service’s metadata by using SOAP messages instead of http get requests. You can create MEX endpoint that can be accessed through http, https, tcp, and even named pipes. HttpGetEnable allow you to expose metadata through HTTP GET method, usually the service’s address with the suffix of ‘?wsdl'

MEX and WSDL both output nearly the same thing.

In most cases there is no need for MEX endpoint – using WSDLs with http get is usually enough.

I understand your intention to understand this part, but do not spend to many times on this : there are so many others complicated features !

这篇关于WSDL 和 WSDL 之间有什么区别?WCF 中的 Mex 端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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