'Olingo v4 Java - Calling Bound Action with POST Body

I am using Olingo v4 Client in Java. In general I am following this tutorial: https://templth.wordpress.com/2014/12/05/manipulating-data-of-odata-v4-services-with-olingo/

With this library I want to call a bounded action. Here is an example how I call the action with postman: enter image description here

So I am sending a body in this POST request which contains the effectiveDate.

What I want is something like:

MyPostBody body = client.getObjectFactory().newPrimitiveProperty("effectiveDate",
                                client.getObjectFactory().newPrimitiveValueBuilder()
                         .buildString(LocalDate.now().format(DateTimeFormatter.ISO_LOCAL_DATE)));

ODataPropertyCreateRequest req = client.getCUDRequestFactory()
                                       .getEntityCreateRequest(personURI,  body);

ODataPropertyUpdateResponse result = req.execute();

My question now is: How can a send a bounded action with a Json-Body in Olingo? Thank you in advance.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source