I am using Visual Studio to create a Service Reference to the SDL Web 8 Content Service. This is working quite well. When I load a BinaryVariant using a browser query I see something like this

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<entry xml:base="http://my.sdlweb8.server:86/client/v2/content.svc/" xmlns="http://www.w3.org/2005/Atom" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <link href="BinaryVariants(BinaryId=529,PublicationId=777,VariantId='WyNkZWYjXQ==')" title="BinaryVariant" rel="edit"/>
    <link href="BinaryVariants(BinaryId=529,PublicationId=777,VariantId='WyNkZWYjXQ==')/Binary" title="Binary" type="application/atom+xml;type=entry" rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Binary"/>
    <category term="Tridion.ContentDelivery.BinaryVariant" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"/>
    <content type="application/xml">
            <d:PublicationId m:type="Edm.Int32">777</d:PublicationId>
            <d:BinaryId m:type="Edm.Int32">529</d:BinaryId>
            <d:Description m:null="true"/>
            <d:IsComponent m:type="Edm.Boolean">true</d:IsComponent>
            <d:StructureGroupId m:null="true"/>

This looks great, but the BinaryVariant class which is generated doesn't have StructureGroupId property. Does anyone know why this might be missing, and how I can force Visual Studio to generate the class correctly.

The C# code currently crashes when I do something like this:

BinaryVariant test = cdService.BinaryVariants.FirstOrDefault();

I get the following error:

The property 'StructureGroupId' does not exist on type 'ODataService.BinaryVariant'. Make sure to only use property names that are defined by the type.
  • Can you use SDL .Net CIL which contain these classes ? I think there may issue with metadata in these OData V2 entities which may be causing this error. – vinayknl Jul 6 '16 at 10:00
  • I would love to use CIL, but that would mean rewriting the whole DD4T provider that I have. This is an interim step before we migrate the whole app to DD4T 2.0 with CIL, so not realistic to rewrite twice. Do you think that this is a bug I should submit to support? – Chris Summers Jul 6 '16 at 11:05
  • Looks to be a bug as problem appears to be missing info in metadata. – vinayknl Jul 6 '16 at 11:30
  • Is that something I can fix easily? or is it hidden in a JAR somewhere? – Chris Summers Jul 6 '16 at 11:45
  • Metadata is generated by service. I am not sure if this can be fixed at the client side. Needs to be investigated properly. – vinayknl Jul 6 '16 at 14:29

Customer Support have confirmed this is a bug. There will be a hotfix for this shortly.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.