simple-odata-client / Simple.OData.Client

MIT License
329 stars 193 forks source link

Issue with Navigational property #255

Open sanket-pattekar opened 8 years ago

sanket-pattekar commented 8 years ago

Hi

I am connecting to a SuccessFactors ODATA V2 service. I am able to create an Entity using Simple Odata client. In this entity I have supplied only properties and the Entity gets created correctly with the provided properties.

However when I try to create a Navigation property, the creation fails. This primarily happens as the URL is escaped which is not accepted by the remote service. The URL is as follows

link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/manager" type="application/atom+xml;type=entry" title="manager" href="https://xxx.yyycom/odata/v2/User(%27test-manager%27)"

If I manually change the above URL (as below) then it works ink rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/manager" type="application/atom+xml;type=entry" title="manager" href="https://xxx.yyycom/odata/v2/User('test-manager')"

Is this a bug in the library ?

Thanks and Regards, Sanket Pattekar

object commented 8 years ago

I have to investigate whether this is a bug in the library or this is something that your service doesn't properly handle. I have a series of tests against live OData V2 service including tests for creation of navigational properties, and they all pass. I will check this out and come back to you.

sanket-pattekar commented 8 years ago

Thanks for the response

The target service OData SuccessFactors V2 service. It is possible that this service has not handled the values correctly.

It is also observed that this service does not support the PATCH mode for updates, Hence we are using the PUT mode in this case. It was very easy to switch the mode using the settings object.

Can we have a similar mechanism for navigational properties as well.

Thanks and Regards Sanket

object commented 8 years ago

Something like this probably. But what should be customized? Escaping algorithm?