我想通过WCF发送Appointment
的清单。我的界面看起来是这样的:通过WCF发送预约清单
[ServiceContract]
public interface IServices
{
[OperationContract]
string addAppointments(List<Appointment> appointmentList);
}
如果我把我的WCF服务我总是收到以下错误:
Type 'Microsoft.Exchange.WebServices.Data.Appointment' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. See the Microsoft .NET Framework documentation for other supported types.
我的服务目前看起来是这样的:
class Service : IServices
{
public string addAppointments(List<Appointment> appointmentList)
{
foreach (Appointment app in appointmentList)
{
Console.WriteLine(app.Organizer.Name);
}
return "true";
}
}
它看起来像'Microsoft.Exchange.WebServices.Data。约会“是你从其他地方获得的类,它不打算序列化。 – 2012-03-29 13:38:45