All about WSDL vs MEX?

£可爱£侵袭症+ 提交于 2019-12-18 15:03:02

问题


I am not able to open the meta data url http://localhost:8082/Tasks/mex, even though I've added the mexHttpBinding in the config file. Can I view this MEX endpoint in a browser?

The config files look like:

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

Questions:

  • Is MEX is different from WSDL? If not, then why do we require a MEX endpoint over WSDL?
  • In the WSDL, I see the WSDL type information is missing. Is it by default? Can I look at the type information in WSDL?

回答1:


Aakash, Did you add a service behavior with a <serviceMetadata> element? It can be empty, i.e. <serviceMetadata />, but it must be present. The service definition needs to reference the service behaviorConfiguration. Check out the following for examples:

http://www.request-response.com/blog/PermaLink,guid,c9513d28-f580-4a33-b4e8-c15476799a9d.aspx




回答2:


Check out serviceMetadata for more information regarding the WCF configuration file.

To answer your questions though, MEX is a newer W3C standard for the presentation of Service description information; WSDL was the previous method. If you need to allow older clients to access your service description information, you may have to expose that information via WSDL.

The information for exposing your service description information as WSDL (httpGetEnabled) is also in the link provided above.

Also, try using the wcftestclient.exe to access your WCF service. It provides more functionality and information than a browser.




回答3:


If you look at that endpoint, you'll see it looks like every other endpoint. There's even a service contract (IMetadataExchange). You can look at System.ServiceModel.Description.IMetadataExchange and see what that contract is all about.



来源:https://stackoverflow.com/questions/2763318/all-about-wsdl-vs-mex

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!