locked
Inherited entities invalid metadata RRS feed

  • Question

  • We're trying to serve some objects that utilize inheritance. The base class has a collection of 'Address' objects on it. The actual webservice seems to be functioning correctly but the service is failing to provide metadata with the following error occurring when you request /$metadata. This is prevent us from adding a service reference to the service in VS 2012.

    <m:error xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
    <m:code/>
    <m:message xml:lang="en-US">An error occurred while processing this request.</m:message>
    <m:innererror>
    <m:message>
    ResourceAssociationSets 'Person_Addresses' and 'Person_Addresses' have a ResourceAssociationSetEnd referring to the same EntitySet 'Addresses' through the same AssociationType. Make sure that if two or more AssociationSets refer to the same AssociationType, the ends must not refer to the same EntitySet. For CLR context, this could happen if multiple entity sets have entity types that have a common ancestor and the ancestor has a property of derived entity types.
    </m:message>
    <m:type>System.InvalidOperationException</m:type>
    <m:stacktrace>
    at System.Data.Services.Providers.MetadataProviderEdmModel.PairUpNavigationProperty(MetadataProviderEdmEntityContainer entityContainer, ResourceSetWrapper resourceSet, ResourceType resourceType, ResourceProperty navigationProperty)
     at System.Data.Services.Providers.MetadataProviderEdmModel.PairUpNavigationPropertiesForEntitySetAndType(MetadataProviderEdmEntityContainer entityContainer, ResourceSetWrapper resourceSet, ResourceType resourceType)
     at System.Data.Services.Providers.MetadataProviderEdmModel.PairUpNavigationPropertiesForEntitySet(MetadataProviderEdmEntityContainer entityContainer, ResourceSetWrapper resourceSet)
     at System.Data.Services.Providers.MetadataProviderEdmModel.PairUpNavigationProperties()
     at System.Data.Services.Providers.MetadataProviderEdmModel.EnsureFullMetadata()
     at System.Data.Services.Providers.MetadataProviderEdmModel.RunInState(Action action, MetadataProviderState state)
     at System.Data.Services.Providers.MetadataProviderEdmModel.EnsureFullMetadataLoaded()
     at System.Data.Services.ResponseBodyWriter..ctor(IDataService service, QueryResultInfo queryResults, RequestDescription requestDescription, IODataResponseMessage actualResponseMessageWhoseHeadersMayBeOverridden)
     at System.Data.Services.DataService`1.HandleInternalResources(RequestDescription description, IDataService dataService, IODataResponseMessage responseMessage)
     at System.Data.Services.DataService`1.SerializeResponseBody(RequestDescription description, IDataService dataService, IODataResponseMessage responseMessage)
     at System.Data.Services.DataService`1.HandleNonBatchRequest(RequestDescription description)
     at System.Data.Services.DataService`1.HandleRequest()
    </m:stacktrace>
    </m:innererror>
    </m:error>

    Wednesday, December 19, 2012 8:43 PM