Adding comments to a WSDL output from WCF/.Net

前端 未结 5 916
暖寄归人
暖寄归人 2020-12-29 23:15

based on the WSDL spec from W3 there is the possibility to add \"wsdl:document\" tags to the WSDL output so that people using that webservice have a better explanation/docum

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-29 23:43

    If you're doing your design / coding in C# classes, adorned with [ServiceContract] and [OperationContract], then I don't know of any way to export documentation you might have on those classes and methods into the WSDL, unfortunately.

    I was appalled by that too - I expected any /// comments on my classes and methods to show up in the WSDL - no luck :-(

    Our solution now is this: 1) we create a basic "mockup" of our service interface with all operations in C# 2) we compile that into an assembly 3) we extract the metadata (WSDL, XSD) from that assembly and then throw away the C# "prototype" 4) we manually add comments (xs:annotation/xs:documentation) to the WSDL and XSD 5) from now on, the WSDL/XSD are the master - and we generate our interface from those descriptions

    Cumbersome and annoying, but it works fairly ok for us.

    I sure hope VS2010 / WCF 4.0 will bring us a bit more support in this area !!

    Marc

提交回复
热议问题