开发者

WCF return types

What is the list of valid WCF return types? I know some but I want to know all of them:

  • Primitive types (string, int32, etc...)
  • Complex types with DataContract o开发者_高级运维r Serializable attributes
  • Stream
  • Message
  • SyndicationFeedFormatter

void? POCOs?


Basically everything that the serializer used in the binding could handle. Also note that since .NET 3.5 SP1 DataContract and DataMemeber are no longer necessary, WCF will serialize all public properties, but it is a good practice to put them.


Everything you stated. Everything Darin stated.

Plus...

Void is a valid return type. Wrapped in a (intentionally omitted) SOAP envelope:

<VoidResponse xmlns="http://tempuri.org/" />

POCOs with DataContracts and DataMembers are valid just like any other serializable object.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜