Ich möchte eine Liste von Appointment
s über WCF senden. Meine Schnittstelle sieht wie folgt aus:Senden Sie eine Liste mit Terminen über WCF
[ServiceContract]
public interface IServices
{
[OperationContract]
string addAppointments(List<Appointment> appointmentList);
}
Wenn ich meine WCF-Dienst aufrufen Ich bin immer die folgende Fehlermeldung erhalten:
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.
Mein Service sieht derzeit wie folgt aus:
class Service : IServices
{
public string addAppointments(List<Appointment> appointmentList)
{
foreach (Appointment app in appointmentList)
{
Console.WriteLine(app.Organizer.Name);
}
return "true";
}
}
Es sieht aus wie 'Microsoft.Exchange.WebServices.Data. Termin ist eine Klasse, die Sie von woanders bekommen haben und die nicht serialisiert werden soll. –