Uploaded image for project: 'Olingo'
  1. Olingo
  2. OLINGO-957

Crash when trying to add data to server

    XMLWordPrintableJSON

    Details

    • Type: Question
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: (Java) V4 4.0.0-beta-03
    • Fix Version/s: None
    • Component/s: odata4-client

      Description

      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

        Attachments

          Activity

            People

            • Assignee:
              chrisam Christian Amend
              Reporter:
              CoOstOFF Konstantin Kustov Sergeevich
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: