M Carissimi created OLINGO-1068:
-----------------------------------
Summary: 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: Bug
Components: odata2-core
Affects Versions: V2 2.0.8
Reporter: M Carissimi
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)