开发者

Are there any specific complex types that can't be returned by a WCF Service?

I have a question on the types that can be returned by a WCF service.Are there any specific complex types that can't be returned by a WCF service? To put more clearly, can we have any kind of complicated datatypes to be defined as开发者_如何学编程 Data Contracts and have them returned by the Service operations? Is there any limitation to any type?


Yes - anything that cannot be serialized into a message constrained by a XML schema file.

This includes:

  • interfaces (only concrete types)
  • generics
  • any data structure that doesn't just contain data, but also behavior (like a SqlConnection or something like that)
  • the Windows API primitives, like a Brush or other drawing elements

The main point is: whatever you're trying to send from client to server must be able to be serialized into an XML message, expressed in a XML schema, and deserialized back into a new object

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜