我想通過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