Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么我的WCF代理客户端不是强类型的?_Wcf - Fatal编程技术网

为什么我的WCF代理客户端不是强类型的?

为什么我的WCF代理客户端不是强类型的?,wcf,Wcf,我的WCF生成的代理有问题-它们可以工作,但不是强类型的。在服务器端,方法定义如下: /// <summary> /// Gets all ElementSetTypes. /// </summary> /// <returns>All ElementSetTypes</returns> [OperationContract] IList<IElementSetType> GetElementSetTypeList(); 这适用于接口

我的WCF生成的代理有问题-它们可以工作,但不是强类型的。在服务器端,方法定义如下:

/// <summary>
/// Gets all ElementSetTypes.
/// </summary>
/// <returns>All ElementSetTypes</returns>
[OperationContract]
IList<IElementSetType> GetElementSetTypeList();

这适用于接口中的所有my类型,无论是返回类型还是方法参数,它们都将替换为“object”。原因可能是什么?

您的接口上是否有DataContract和DataMembers:IElementSetType?可能是@peer的重复项-我在ElementSetType上设置了DataContract和DataMembers,而不是在IElementSetType上。@CodeMaster-我在服务器端重用接口和实现,所以我不想使用不同的数据类型实现。我的意思是:展示您的尝试和发现,“wcf datacontract return interface”提供了大量点击,解决方案是
(服务)KnownType
属性。
object[] GetElementSetTypeList();