You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Sumit ." <su...@adobe.com> on 2017/03/15 09:24:44 UTC

Metadata Parser is unable to parse external references of Microsoft dynamics CRM Odata metadata

Hi All,

I am using Olingo to connect to Odata service endpoints provided by Microsoft Dynamics. But the metadata parsing fails if the main metadata document refers another document which has a different scheme or host name to that of the original metadata document.



Short Description
The metadata document provided by Microsoft Dynamics Odata service refers two other metadata document
http://vocabularies.odata.org/OData.Community.Keys.V1.xml and
http://vocabularies.odata.org/OData.Community.Display.V1.xml

For parsing the original metadata document, Olingo client need to fetch the referenced metadata documents as well. But Olingo client imposes a restriction that the referenced document should have same host, scheme and port as that of the document which is referring to this document. This check fails, and following exception is thrown by Olingo

java.lang.IllegalArgumentException: The referenced EDMX document has the URI 'http://vocabularies.odata.org/OData.Community.Keys.V1.xml' where scheme, host, or port is different from the main metadata document URI 'https://<dynamicsInstance>api/data/v8.1/$metadata'

The JIRA issue [0] has more details.




OData protocol ([1]) does not impose any restriction on where the referenced metadata document should come from - as opposed to Olingo restriction of same scheme, host and port. Can someone please take a look at the JIRA issue and give an idea about the original intention behind this restriction.


[0] - https://issues.apache.org/jira/browse/OLINGO-1008
[1] - http://docs.oasis-open.org/odata/odata/v4.0/odata-v4.0-part1-protocol.html

Regards,
Sumit