none
Prevent Base64String In DataContract From Being Converted To ExtensionData RRS feed

  • Question

  •  Hi,

    I am sending a DataContract to an WCF Http Client.  The DataContract contains a field called RowVersion.  In the database the datatype is byte[8].  I need to store this on the client for concurrency checks.  WCF sends RowVersion as a Base64 string to the client and places it in the ExtensionData property, not the RowVersion property.  In an attempt to get the value placed in the RowVersion field, I converted RowVersion to Base64 prior to sending it to the client (by changing the DataContract Property to a string instead of byte[8] and calling Convert.ToBase64String(x)).  The value still appears in ExtensionData, not RowVersion.    How can I get WCF to write this value into the RowVersion property instead of ExtensionData.  

    Thanks,

    Mark


    • Edited by Mark Phillips Thursday, October 3, 2013 5:31 PM Correct name of ExtensionData from ExtendedData
    Thursday, October 3, 2013 4:20 PM

Answers

  • The reason ExtensionData was being used is that the WCF Proxy was not in sync with the Service.  Adding the RowVersion field to the service proxy allows for the proper serialization.
    • Marked as answer by Mark Phillips Thursday, October 3, 2013 5:53 PM
    Thursday, October 3, 2013 5:53 PM

All replies

  • The reason ExtensionData was being used is that the WCF Proxy was not in sync with the Service.  Adding the RowVersion field to the service proxy allows for the proper serialization.
    • Marked as answer by Mark Phillips Thursday, October 3, 2013 5:53 PM
    Thursday, October 3, 2013 5:53 PM
  • Hi Mark,

    Glad to see that the issue is solved, thanks for sharing.

    Best Regards.


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Friday, October 4, 2013 1:03 AM
    Moderator