Note that there are some explanatory texts on larger screens.

plurals
  1. POIExtensibleDataObject usage in clients
    primarykey
    data
    text
    <p>I have converted my web service to wcf service which has some datacontracts. As a best practice it is mentioned and advisable that the DataContracts should inherit from IExtensibleDataObject. I get the point that in case of addition or removal of datamembers, IExtensibleDataObject is helpful. But i am not able to get how will the clients access removed datamembers. Here is my code:</p> <pre class="lang-cs prettyprint-override"><code>[ServiceContract(Namespace = "http://mycompany.com/2010/08/")] public class MyWebService { [OperationContract] public Employee Add(Employee emp) { // Some Processing } } [DataContract(Name = "Employee", Namespace = "http://mycompany.com/2010/08/")] public class Employee : IExtensibleDataObject { [DataMember] public string FirstName; [DataMember] public string LastName; public ExtensionDataObject ExtensionData { get; set; } } </code></pre> <p>Now in my next version of web service I made some changes to DataContract as</p> <pre><code>[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; } } </code></pre> <p>However my client that is accessing my older version of web service is now getting error for not supplying the MiddleName field. I am still confused for the usage of IExtensionDataObject.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload