[
https://issues.apache.org/jira/browse/OLINGO-510?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Christian Amend reassigned OLINGO-510:
--------------------------------------
Assignee: Christian Amend
> 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
> Assignee: Christian Amend
>
> 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)