Error when creating service reference to WCF 5.1 data service RRS feed

  • Question

  • I have an application that is built using an Entity Framework model generated from the database and then exposed using WCF Data Services 5.1. The main reason for using 5.1 is the support for DateTimeOffset, but I have run into an error. The service seems to be working properly as I'm able to access data using a browser but if I when I try to create a service reference for a client app, it fails with the following error:

    "The custom tool 'DataServicescoreClientGenerator' failed. Data service client code-generation failed: Schema specified is not valid. Errors: (0,0): error 0063: Precision facet isn't allowed for properties of type String." (The last part repeats for all the DataTimeOffset columns in the model.)

    I can recreate the problem as follows:

    1. Generate a Entity Data Model from a single table with a DateTimeOffset column.
    2. Create a WCF Data Service 5.1 and select the entities from step 1.
    3. In a separate (WPF) project select "Add Service Reference", click "Discover" and select the service created in step 2. At this point, code generation fails with the error shown above.

    Does anyone have a workaround? I need for other team members to be able to access the service, and I need WCF 5.1 (or 5.0 I guess) to support numerous DateTimeOffset columns in the data.

    • Moved by Haixia_Xie Monday, December 17, 2012 3:15 AM WCF Data Services Issue (From:Windows Communication Foundation (WCF))
    Friday, December 14, 2012 3:25 PM

All replies

  • I forgot to add that I'm using Visual Studio 2012 and .NET 4.5, if it matters.

    Friday, December 14, 2012 3:30 PM
  • Hi,

    According to your description, the issue is related to WCF Data Services, so I will move the thread to WCF Data Services forum, there are more professionals on this issue, so you can get better support there.

    Best Regards.

    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, December 17, 2012 3:14 AM
  • Hi,

    I haven't used DateTimeOffset in my services but since you are asking for a advise for workaround could you try editing generated proxy code manually? I.e.

    • Remove the offending column from the model;
    • Generate the proxy code by executing "Add Service Reference" from Visual Studio;
    • Manually extend the code with the missing column.

    If the problem is with the WCF DS proxy generator, then this workaround should work. Of course if WCF Data Service client library has similar limitation, then you are stuck (unless you choose ditching WCF DS client library in favour of other libs), but WCF DS client libs are frequently updated (get newest from NuGet), so I hope they will work fine.

    Vagif Abilov

    Monday, December 17, 2012 1:56 PM