如何将XML注释从WCF服务添加到Wsdl文件
问题描述:
你好
我在wcf服务的服务合同和操作合同中添加了xml注释,如何在wsdl文件中查看此注释.
谢谢
saurabh
Hello
I added xml comment in service contract and operation contract with wcf services,How to see this comment in wsdl file.
Thanks
saurabh
答
一句话...不.
或至少不容易.
在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.