我有 WCF 服务。它具有以下属性。
[DataMember]
public List<uttAppointmentPhoneList> AppointmentPhoneList { get; set; }
public class uttAppointmentPhoneList
{
string _PhoneType;
Int32 _PhoneNumber;
bool _IsDelete;
[DataMember]
public string PhoneType
{
get { return _PhoneType; }
set { _PhoneType = value; }
}
[DataMember]
public Int32 PhoneNumber
{
get { return _PhoneNumber; }
set { _PhoneNumber = value; }
}
[DataMember]
public bool IsDelete
{
get { return _IsDelete; }
set { _IsDelete = value; }
}
}
但是当我发送请求时出现以下错误。
格式化程序在尝试反序列化消息时抛出异常:尝试反序列化参数时出错。InnerException 消息是“反序列化 MarshfieldClinic.Denbigh.AppointmentService.Sync.DataContracts.mydayapp 类型的对象时出错。值“3456787463”无法解析为类型“Int32”。有关更多详细信息,请参阅 InnerException。
任何想法为什么会发生这种情况?谢谢