开发者

when to use wcf mex endpoint

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.

I've following questions:

  • What is the difference between these 2 methods?
  • When do we use one over the other?
  • Are both restricted to certain bindings? If yes which one belongs to which bindings?

Thanks in advance.


There are two ways to expose metadata:

  1. Adding <serviceMetadata /> behavior and endpoint with contract IMetadataExchange
  2. Adding <serviceMetadata httpGetEnabled="true" /> behavior (or httpsGetEnabled)

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.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜