wcf - 在 DataContract Serializer Metadata 中包含 XML 注释

标签 wcf serialization datacontract

有什么方法可以发送 DataContract 中属性的摘要信息吗?

例如

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

这可以提供给获得数据契约(Contract)的客户吗?我对此表示怀疑,只是希望有人知道我不知道的事情,这很有可能。 :)

最佳答案

看看WCFExtras在 CodePlex 上。我没有使用过它,但听起来它完全符合您的要求:

Adding WSDL Documentation from Source Code XML Comments

This extension allows you to add WSDL documentation (annotaiton) directly from XML comments in your source file. These comments will be published as part of the WSDL and are available for WSDL tools that know how to take advantage of them (e.g. Apache Axis wsdl2java and others). Release 2.0 also includes a client side WSDL importer that will turn those WSDL comments to XML comments in the generated proxy code.

关于wcf - 在 DataContract Serializer Metadata 中包含 XML 注释,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3198911/

相关文章:

java - 如何构建适合java客户端的WCF服务

c# - 使用 DataContract Name 属性重命名 WCF 泛型类

WCF 的 endpointConfigurationName 应该是什么?

java - 为什么我的异常类需要序列化?

java - readObject() 方法不打印对象

wcf - 使用代理在 WCF 中序列化委托(delegate)?

c# - 在 WCF 中实现丰富的域模型,其中客户端对象充当远程外观

c - 使用 tpl 通过套接字发送结构以使用 c 进行序列化

.net - DataContractSerializer : Deserialized object with reference id 'xyz' not found in stream. 如何恢复数据?

c# - EnumMemberAttribute 值被 DataContractJsonSerializer 忽略