开发者

WCF return types

开发者 https://www.devze.com 2023-01-14 14:37 出处:网络
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...)

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

精彩评论

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