Including XML Comments in DataContract Serializer Metadata

Is there a way to send property summary information to a DataContract?

eg.

[DataContract] public class MyClass { /// <summary> /// My Summary information /// </summary> [DataMember] public int MyProperty {get;set;} } 

Could this be available to a client who receives a datacontract? I doubt it, just hoping that someone knows something that I don’t have, which is likely. :)

+6
serialization wcf datacontract
source share
2 answers

Check out WCFExtras on CodePlex. I have not used it, but it looks like it is doing exactly what you want:

Adding WSDL documentation from XML source code comments

This extension allows you to add WSDL documentation (annotaiton) directly from XML comments in the source file. These comments will be published as part of WSDL and are available for WSDL Tools that know how to take their benefits (e.g. Apache Axis wsdl2java and others). Version 2.0 also includes a client-side importer of WSDL, which will turn these WSDL comments on XML comments into generated proxy code.

+5
source share

If you are referencing XML comments, then no, they cannot be sent. There is a noplace in WSDL in which they can be sent so that the client can use them.

+1
source share

All Articles