【发布时间】:2015-08-04 19:55:41
【问题描述】:
我在调用 WCF 服务时收到以下错误。我在这里错过了什么?
'System.String[]' with data contract name
'ArrayOfstring:http://schemas.microsoft.com/2003/10/Serialization/Arrays'
is not expected. Add any types not known statically to the list of known
types - for example, by using the KnownTypeAttribute attribute or by adding
them to the list of known types passed to DataContractSerializer.'. Please
see InnerException for more details.
{"There was an error while trying to serialize parameter
http://tempuri.org/:myEntity. The InnerException message was
'Type 'System.String[]' with data contract name
'ArrayOfstring:http://schemas.microsoft.com/2003/10/Serialization/Arrays'
is not expected. Add any types not known statically to the list of known
types - for example, by using the KnownTypeAttribute attribute or by adding
them to the list of known types passed to DataContractSerializer.'.
Please see InnerException for more details."}
【问题讨论】:
-
您可以将代码发布到您的服务和/或客户端吗?
-
我是 WCF 的新手...myEntity 是一个 C# 业务对象...您能告诉我如何以及在哪里将这种类型提供给 DataContractSerializer 吗?
标签: wcf web-services