何时使用 wcf mex 端点

编程入门 行业动态 更新时间:2024-10-22 12:35:28
本文介绍了何时使用 wcf mex 端点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时送ChatGPT账号..

我对 MEX 端点感到困惑.如果我错了,请纠正我.有两种方法可以公开元数据.一种带有 MEX 端点,另一种带有 <serviceMetadata httpGetEnabled="true"/>.第一个将使用 WS-MetadataExchange 公开元数据,第二个将使用 WSDL.

I've confusion with MEX endpoint. Please correct me if I'm wrong. There're 2 ways to expose metadata. One with MEX endpoint and one with <serviceMetadata httpGetEnabled="true" />. The first one will expose metadata using WS-MetadataExchange and second one will use WSDL.

我有以下问题:

这两种方法有什么区别?我们什么时候使用一个而不是另一个?两者都限于某些绑定吗?如果是,哪个属于哪个绑定?

提前致谢.

推荐答案

暴露元数据有两种方式:

There are two ways to expose metadata:

使用合约IMetadataExchange添加行为和端点添加 <serviceMetadata httpGetEnabled="true"/> 行为(或 httpsGetEnabled) Adding <serviceMetadata /> behavior and endpoint with contract IMetadataExchange Adding <serviceMetadata httpGetEnabled="true" /> behavior (or httpsGetEnabled)

第一种方法是发布到端点的标准 SOAP 消息 = 端点可以使用任何支持双向 SOAP 通信的绑定和任何传输.它是其他工具使用的标准化方式 - 例如 WCF 发现可以使用它来获取有关已发现端点绑定的信息.它仍然传输 WSDL 和 XSD.

The first approach is standard SOAP message posted to the endpoint = endpoint can use any binding and any transport supporting two-way SOAP communication. It is standardized way used by other tools - for example WCF discovery can use it to obtain information about binding of discovered endpoint. It still transports WSDLs and XSDs.

第二种方法更像 REST.您将使用 HTTP 的 GET 操作来检索 WSDL 和 XSD.也可以配置,但只支持 HTTP(S) 协议.

The second approach is more REST like. You will use HTTP's GET operation to retrieve WSDLs and XSDs. It can be also configured but it supports only HTTP(S) protocol.

这篇关于何时使用 wcf mex 端点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

更多推荐

[db:关键词]

本文发布于:2023-04-26 20:06:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1141146.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:wcf   mex

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!