[
https://issues.apache.org/jira/browse/OLINGO-510?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14276694#comment-14276694
]
Thierry Templier commented on OLINGO-510:
-----------------------------------------
Hi Christian,
Thanks very much for the patch.
Unfortunately, I have errors when trying to apply it with the command: git
apply Olingo511.diff.
Here is the error messages:
error: the patch failed :
fit/src/test/java/org/apache/olingo/fit/v4/EntityUpdateTestITCase.java:29
error:
fit/src/test/java/org/apache/olingo/fit/v4/EntityUpdateTestITCase.java : the
patch doesn't applied
error: the patch failed :
lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/cud/v4/CUDRequestFactory.java:34
error:
lib/client-api/src/main/java/org/apache/olingo/client/api/communication/request/cud/v4/CUDRequestFactory.java
: the patch doesn't applied
error: the patch failed :
lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/v4/CUDRequestFactoryImpl.java:37
error:
lib/client-core/src/main/java/org/apache/olingo/client/core/communication/request/cud/v4/CUDRequestFactoryImpl.java
: the patch doesn't applied
Did I do something wrong? Thanks!
Thierry
> Problem when using the ODataReferenceAddingRequest to add a reference to a
> property
> -----------------------------------------------------------------------------------
>
> Key: OLINGO-510
> URL: https://issues.apache.org/jira/browse/OLINGO-510
> Project: Olingo
> Issue Type: Bug
> Components: odata4-client
> Affects Versions: V4 4.0.0-beta-01
> Environment: java version : "1.7.0_72"
> Odata v4 service :
> http://services.odata.org/V4/OData/(S(li4s4wcplcgyiy3uvuog1lxl))/OData.svc
> Reporter: Thierry Templier
>
> When using a ODataReferenceAddingRequest to a reference for a property:
> String serviceRoot = (...);
> URI productCategoriesUri = client.newURIBuilder(serviceRoot)
> .appendEntitySetSegment("Products")
> .appendKeySegment(1)
> .appendNavigationSegment("Categories")
> .appendRefSegment()
> .build();
> URI ref = client.newURIBuilder(serviceRoot)
> .appendEntitySetSegment("Categories")
> .appendKeySegment(1)
> .build();
> ODataReferenceAddingRequest req = client.getCUDRequestFactory()
> .getReferenceAddingRequest(productCategoriesUri, ref);
> ODataReferenceAddingResponse res = req.execute();
> The link of the reference to add isn't sent in the payload of the request.
> Here is the simplified content of the request:
> POST
> /V4/OData/(S(li4s4wcplcgyiy3uvuog1lxl))/OData.svc/Products(1)/Supplier/$ref
> and the simplified content of the response:
> HTTP/1.1 400 Bad Request
> {
> "error":{
> "code":"",
> "message":"An error occurred while processing this request.",
> "innererror":{
> "message":"An unexpected 'EndOfInput' node was found when reading from
> the JSON reader. A 'StartObject'
> node was
> expected.","type":"Microsoft.OData.Core.ODataException","stacktrace":" "
> }
> }
> }
> We should have something like this in the payload:
> {
> "@odata.id":"http://(...)/Suppliers(4)"
> }
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)