olingo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sumit (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OLINGO-1060) Unable to retrieve a referenced metadata document referenced by Microsoft dynamics metadata document
Date Mon, 16 Jan 2017 11:50:26 GMT

    [ https://issues.apache.org/jira/browse/OLINGO-1060?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15823825#comment-15823825
] 

Sumit commented on OLINGO-1060:
-------------------------------

[~rareddy] How about adding a method {{setAcceptForRelatedMetadataRequest}} (open to suggestions
for the name) to {{XMLMetadataRequest}}. This accept header will be used while requesting
the metadata document for referenced services. Please note that the same accept will be used
for ALL the related document requests (we are not providing a way to setAccept for individual
requests)

> Unable to retrieve a referenced metadata document referenced by Microsoft dynamics metadata
document
> ----------------------------------------------------------------------------------------------------
>
>                 Key: OLINGO-1060
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1060
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata4-client
>    Affects Versions: (Java) V4 4.3.0
>            Reporter: Sumit
>
> Below is a sample metadata document as given by a microsoft dynamics instance
> {code}
> <?xml version="1.0" encoding="utf-8"?>
> <edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx">
>     <edmx:Reference Uri="http://vocabularies.odata.org/OData.Community.Keys.V1.xml">
>         <edmx:Include Namespace="OData.Community.Keys.V1" Alias="Keys" />
>         <edmx:IncludeAnnotations TermNamespace="OData.Community.Keys.V1" />
>     </edmx:Reference>
>     <edmx:Reference Uri="http://vocabularies.odata.org/OData.Community.Display.V1.xml">
>         <edmx:Include Namespace="OData.Community.Display.V1" Alias="Display" />
>         <edmx:IncludeAnnotations TermNamespace="OData.Community.Display.V1" />
>     </edmx:Reference>
>     <edmx:DataServices>
>         <Schema Namespace="Microsoft.Dynamics.CRM" Alias="mscrm" xmlns="http://docs.oasis-open.org/odata/ns/edm">
>         <!-- Not showing the detailed entity types and other details as this information
is irrelevant for current issue -->
>         </Schema>
>     </edmx:DataServices>
> </edmx:Edmx>
> {code}
> The referenced metadata document http://vocabularies.odata.org/OData.Community.Keys.V1.xml
has 'Content-Type' header set to "text/xml" in response. But olingo's  AbstractMetadataRequestImpl[0]
sets 'Accept' header to "application/xml" in the request for fetching the metadata document.
As a result we get 406 response code (since the accept header does not contain the type as
specified in the respone.
> Should "text/html" be added to Accept header of metadata request ? (I have tried and
tested this solution)
> [0] - https://github.com/apache/olingo-odata4/blob/8515b48dd5e09e4597d0b396326bd6a074efa1f5/lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/retrieve/AbstractMetadataRequestImpl.java#L32



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message