Why can't my operation contracts in my wcf client take interfaces as parameters?

孤街浪徒 提交于 2019-11-29 06:44:04

SOAP has no concept of interfaces. That would tend to make deserialization difficult.

This is because the objects have to be serialized for passing between the client and the server. You are not allowed to pass an "object" type. All types must be concrete so that they can be properly serialized and deserialized. An Interface is nothing more than an "object" type with a sub-type of the Interface. The object as a whole cannot be deserialized and serialized this way, only the interface members can be. This would make for a really messy implementation on both sides.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!