How the WSDL is written in WCF?

巧了我就是萌 提交于 2020-01-11 07:15:21

问题


I want to know how the wsdl is written in wcf. As i know the proxy class serialize the data and form a soap message to send over network, in the same way , i want to know who writes the wsdl file and takes care of serializing results of a call.


回答1:


The abstract ServiceHostBase class has a method called CreateDescription that will take your service and operation contracts as well as your fault and data contracts and turns those into a ServiceDescription. This is then further handled by a WsdlExporter and turned into a WSDL and XSD file. What gets output to the WSDL (and XSD) is available on the service class as the "service description" (property "Description") - it contains information about the endpoints, bindings, other config settings etc.

Have a look at the MSDN Docs for the WsdlExporter class. You can even customize this process, if you want to - see these blog posts for more info on that:

  • Control generated WSDL from WCF Service
  • Flattening your WSDL

And have a look at the MSDN docs on:

  • Metadata Architecture Overview
  • Exporting custom metadata for a WCF extension

Marc



来源:https://stackoverflow.com/questions/1554001/how-the-wsdl-is-written-in-wcf

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