0

为什么我得到 WCFTestClient 不支持的操作,因为它的类型是 ...?(见截图)

类似的方法适用于普通的普通合同,但不适用于引用实体框架类的合同

有两个响应数据合同。

  • 纯数据合约

    [DataContract] 公共类 GetSomeResponseDataContract { 私人收藏 myFund;

    [DataMember]
    public Collection<MyFund> MyFund
    {
        Get { }
    }
    

    }

MyFund 在哪里

[DataContract]
    public class MyFund
    {
        [DataMember]
        public string FundCode { get; set; }

        [DataMember]
        public string FundName { get; set; }
.
.
}
  • EntityDataContract 的数据契约

    [DataContract] 公共类 GetYoursResponseDataContract { 私人收藏 yourFund;

        [DataMember]
        public Collection<YoursFund> YourFund
        {
            Get { }
        }
    }
    

YourFund 在哪里

 [EdmEntityTypeAttribute(NamespaceName="RModel1", Name="YoursFund")]
    [Serializable()]
    [DataContractAttribute(IsReference=true)]
    public partial class YoursFund : EntityObject
    {
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
       [DataMemberAttribute()]
        public global::System.String FundCode
        {
            get
            {
                return _FundCode;
            }
            set
            {
                OnFundCodeChanging(value);
                ReportPropertyChanging("FundCode");
                _FundCode = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("FundCode");
                OnFundCodeChanged();
            }
        }
}

在此处输入图像描述

4

1 回答 1

0

以下是 WCF 测试客户端不支持的功能列表:

类型:Stream、Message、XmlElement、XmlAttribute、XmlNode,实现 IXmlSerializable 接口的类型,包括相关的 XmlSchemaProviderAttribute 属性,以及 XDocument 和 XElement 类型以及 ADO.NET DataTable 类型。

尝试使用其他客户端,例如 WCFStorm 或创建代理客户端并检查

在您的情况下,尝试将结果作为 List Not as Collection 返回

于 2014-03-13T13:04:44.640 回答