none
IgnoreExtensionDataObject seems not to be working RRS feed

  • Question

  • Hi,

    I introduced a new data field member in the data contract on service side and marked it as data member. I DID NOT update the service reference on client side though. 

    I have marked added the IgnoreExtensionDataObject on the client side. 

    [ServiceBehavior(IgnoreExtensionDataObject = true)]
        public partial class Service1Client : System.ServiceModel.ClientBase<ConsoleApplication1.ServiceReference1.IService1>, ConsoleApplication1.ServiceReference1.IService1 {

    Also, I have added it in the config file too.

    <behaviors>
          <serviceBehaviors>
            <behavior>
              <dataContractSerializer ignoreExtensionDataObject="true" />
            </behavior>
          </serviceBehaviors>
        </behaviors>

    Now, when I get the data contract from service on client, I do see the newly added member on service side in Members field of ExtensionDataField. Ideally it should have ignored and should be null, right? Am I missing anything?

    Thoughts?

    Thanks!

    Sunday, June 8, 2014 8:28 AM

Answers

All replies

  • It is using late bindings.  The data is being transferred as XML tagged data. So the object is being recognized at runtime using late bindings.

    jdweng

    Sunday, June 8, 2014 12:50 PM
  • I can't seem to make any sense of this answer, nor how it is a solution.

    Since we have run into this a couple of times, I thought I'd share what was causing this issue for our team and how we fixed it.

    While we had the ServiceBehavior decorated with ignoreExtensionDataObject in our config, we also had an EndpointBehavior with the dataContractSerializer without the ignoreExtensionDataObject.  The EndpointBehavior overrides the ServiceBehavior. 

    Once we added ignoreExtensionDataObject=true to the EndpointBehavior, our clients no longer received the additional data elements that were added to the data contracts.


    Monday, January 4, 2016 5:06 PM