且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将XML注释从WCF服务添加到Wsdl文件

更新时间:2023-11-24 21:48:52



一句话...不.

或至少不容易.

在WSDL中的评论 [
Hi,

In a word... No.

Or at least not easily.

Comments in WSDL[^]

If this is WCF in IIS then you could possibly register a custom http module or http handler for generating the WSDL. Although this would be a hack.

And even then, the comments wouldn''t translate through to the client IDE consuming the service.

My advice, if comments are essential, would be to build a .Net COM component. If you put XML comments on the interface which describes the methods used by the COM and then develop the COM to consume the service, you could supply your users with the COM which would then give them the usage comments within the IDE.