You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@olingo.apache.org by "Christian Amend (JIRA)" <ji...@apache.org> on 2018/01/19 09:20:01 UTC

[jira] [Commented] (OLINGO-1222) Unable to create navigation links in Cars Project

    [ https://issues.apache.org/jira/browse/OLINGO-1222?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16331976#comment-16331976 ] 

Christian Amend commented on OLINGO-1222:
-----------------------------------------

Hi Paul,

if I remember correclty this is a feature we did not implement for the sample. Are you using the JPA sample the Annotation sample or the plain library sample?

Best Regards,
Christian

> Unable to create navigation links in Cars Project
> -------------------------------------------------
>
>                 Key: OLINGO-1222
>                 URL: https://issues.apache.org/jira/browse/OLINGO-1222
>             Project: Olingo
>          Issue Type: Bug
>          Components: odata2-core
>    Affects Versions: V2 2.0.10
>         Environment: OSX & Windows
>            Reporter: Paul
>            Priority: Major
>
> When I create the Cars project from the default commands and use the generate data function, the data is generated correctly and all the links such as from a car to a driver work fine.
>  
> Opening postman, I then go and add a new car which also works fine. If I attempt to add a driver to a car then I am getting an "Requested entity could not be found".
>  
> I created a Car with id of 14
> URI:
> [http://localhost:8080/|http://localhost:8080/CarService.svc/Cars] [MyFormula.svc|http://localhost:8080/MyFormula.svc/Cars('14')/$links/Driver] [/Cars|http://localhost:8080/CarService.svc/Cars]
> Headers
> Content-Type: application/json
> Body:
> {
> "Id":"14",
> "Model":"Paul",
> "Price":"132",
> "ModelYear":2013
> }
>  
> I now want to link a driver to this car
> If I do a post
> URI:
> [http://localhost:8080/MyFormula.svc/Cars('14')/$links/Driver]
> Headers:
> Content-Type: application/json
> Body:
> {
>  "Id": "23",
>  "Name":"Jody",
>  "Lastname":"Schecter",
>  "Nickname":"SAMan"
> }
>  
> Then it does not work. and raises the error "Requested entity could not be found".
>  
> If I try to manually link them via a put on the car this also fails.
>  
> I first create the driver above manually by posting to the Drivers collection.
> I do a PUT
> URI:
> http://localhost:8080/MyFormula.svc/Cars('14')/$links/Driver
> Headers:
> content-type: application/xml
> Body:
> ?xml version="1.0" encoding="utf-8" standalone="yes"?>
> <uri xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
> http://localhost:8080/MyFormula.svc/Drivers(23L)
> </uri>
>  
> this also fails
>  
> Any ideas why this would not work? The links seem fine for those created by the script in the source code but external creation does not allow links to be set up



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)