I converted my web service to a wcf service that has some data. As a best practice, it is mentioned and recommended that DataContracts inherit from IExtensibleDataObject. I understand that in the case of adding or deleting data, IExtensibleDataObject is useful. But I canβt get how clients will be able to access the remote data items. Here is my code:
[ServiceContract(Namespace = "http://mycompany.com/2010/08/")] public class MyWebService { [OperationContract] public Employee Add(Employee emp) {
Now, in my next version of the web service, I made some changes to the DataContract as
[DataContract(Name = "Employee", Namespace = "http://mycompany.com/2010/09/")] public class Employee : IExtensibleDataObject { [DataMember] public string FirstName; [DataMember] public string LastName; [DataMember(IsRequired = true)] public string MiddleName; public ExtensionDataObject ExtensionData { get; set; } }
However, my client, who is accessing my old version of the web service, now receives an error without supplying a MiddleName field. I'm still confused about using IExtensionDataObject.
c # versioning wcf client
Ashish
source share