You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Christian Amend (JIRA)" <ji...@apache.org> on 2017/01/26 10:23:25 UTC

[jira] [Updated] (OLINGO-1068) EntityProvider writeEntry does not include inline content in ODataResponse

     [ https://issues.apache.org/jira/browse/OLINGO-1068?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Christian Amend updated OLINGO-1068:
------------------------------------
    Issue Type: Question  (was: Bug)

> EntityProvider writeEntry does not include inline content in ODataResponse
> --------------------------------------------------------------------------
>
>                 Key: OLINGO-1068
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1068
>             Project: Olingo
>          Issue Type: Question
>          Components: odata2-core
>    Affects Versions: V2 2.0.8
>            Reporter: M Carissimi
>            Assignee: Christian Amend
>
> Hello,
> I have an OData client written using the Olingo library that takes a set of properties (Map<String,Objects>) and uses it to put data to a OData server.
> The EntityProvider.writeEntry() method is used to obtain an InputStream for the set of properties to send to the server:
> {code}
>   public ConsumerResponse<Object> updateEntry(String anEntitySetName, String anEntryURL, Map<String, Object> someData,
>       String aContentType) throws ConsumerException
>   {
>     ConsumerResponse<Object> myConsumerResponse = null;
>     try
>     {
>       EdmEntityContainer myEntityContainer = getMetadata(anEntryURL).getDefaultEntityContainer();
>       EntityProviderWriteProperties myWriteProperties = 
>           EntityProviderWriteProperties.serviceRoot(new URI(extractServiceURIFromURL(anEntryURL))).build();
>       
>       // serialize data into ODataResponse object
>       ODataResponse myResponse = EntityProvider.writeEntry(aContentType, 
>           myEntityContainer.getEntitySet(anEntitySetName), someData, myWriteProperties);
>       // get entity InputStream
>       InputStream myEntity = (InputStream) myResponse.getEntity();
>       
>       // put data to server
>       HttpResponse myHttpResponse = execute(anEntryURL, HTTP_METHOD_PUT, myEntity, aContentType);
> ...
> {code}
> This works well for single entries, but it does not work for entries with inline content. If the set of properties contain both simple properties (e.g: NAME > "MyName") and inline content (e.g. ENTITY_LINK > Map<String,Object>), the ODataResponse object returned by the EntityProvider.writeEntry() method, does not include the inline content.
> I have attempted to set the inline content as an ODataEntry object rather than a Map<String,Object> but the behaviour is the same.
> Why is the inline content not retained by the writeEntry() method?



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