[
https://issues.apache.org/jira/browse/OLINGO-957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15397522#comment-15397522
]
Christian Amend commented on OLINGO-957:
----------------------------------------
Hi [~CoOstOFF],
what error message does the exception have? Have you tried this with the latest
4.2.0 released version as well?
Best Regards,
Christian
> 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)