Reputation: 273
We have Java OData service and Client is in Dotnet.
In Java service we have declared List[Long] and when we are trying to read metadata mentioned in Jen-Blog. we are getting error.
Metadata of Java Service:
<EntityType Name="Products" Abstract="false">
<Property Name="ProductIdList" Type="Edm.Int64" Nullable="false" CollectionKind="Bag" />
</EntityType>
Error at dotnet end:
The metadata document could not be read from the message content.
UnexpectedXmlAttribute : The attribute 'CollectionKind' was not expected in the given context. : (1, 183892)
Upvotes: 1
Views: 722
Reputation: 153
CollectionKind is not a valid CSDL attribute in EntityType. You have to remove this attribute from your service metadata.
In latest EdmLib, it adds a new feature to ignore the unknown attribute in EdmxReader. You can try that. However, it is only available in EdmxReader, not ODataMessageReader. ODataMessageReader use EdmxReader, but the default behavior of it is not to ignore unknown attribute.
Upvotes: 1