You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Konstantin Kustov Sergeevich (JIRA)" <ji...@apache.org> on 2016/05/20 19:11:12 UTC

[jira] [Updated] (OLINGO-957) Crash when trying to add data to server

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

Konstantin Kustov Sergeevich updated OLINGO-957:
------------------------------------------------
    Labels: android-studio java  (was: )

> Crash when trying to add data to server
> ---------------------------------------
>
>                 Key: OLINGO-957
>                 URL: https://issues.apache.org/jira/browse/OLINGO-957
>             Project: Olingo
>          Issue Type: Question
>          Components: odata4-client
>    Affects Versions: (Java) V4 4.0.0-beta-03
>            Reporter: Konstantin Kustov Sergeevich
>              Labels: android-studio, java
>
> Hello. When I try to add data to the service happens crash. I did everything I like this: https://github.com/apache/olingo-odata4/blob/master/fit/src/test/java/org/apache/olingo/fit/base/EntityCreateTestITCase.java I would be grateful if you help me.
> I used URL: http://services.odata.org/V4/OData/OData.svc/
> My code:
> ClientEntity entity = oDataClient.getObjectFactory().newEntity(new FullQualifiedName("ODataDemo.Category"));
>       entity.getProperties().add(oDataClient.getObjectFactory().newPrimitiveProperty("ID", oDataClient.getObjectFactory().newPrimitiveValueBuilder().buildInt32(123)));
>         entity.getProperties().add(oDataClient.getObjectFactory().newPrimitiveProperty("Name",              oDataClient.getObjectFactory().newPrimitiveValueBuilder().buildString("TestName")));
> ODataEntityCreateRequest request = oDataClient.getCUDRequestFactory().getEntityCreateRequest(        oDataClient.newURIBuilder(url).appendEntitySetSegment("Categories").build(), entity);
> request.setFormat(ODataFormat.APPLICATION_JSON);
> LogUtil.d(request.execute().getStatusCode());
> request.execute() causes a crash.
> Crash: org.apache.olingo.client.api.http.HttpClientException: org.apache.http.client.ClientProtocolException



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