Connect to an OData Source

The Datajs JavaScript library supports reading and writing to an OData service using both the JSON and ATOM-based formats.

The endpoint is an HTTP based URI exposed by the server.

You can use the OData.read API with a URI to read data from a server. To add, update, or delete data, the ODATA.request API can be used along with a POST, PUT, or DELETE method.

You can see examples at http://datajs.codeplex.com/wikipage?title=OData%20Code%20Snippets&referringTitle=Using%20OData

In your Hybrid App, you can connect to the Proxy endpoint exposed by SAP Mobile Platform using the Datajs library.  This gives administrators and developers control over the endpoint as only white listed endpoints are accessible from the Hybrid App and also restricts who is able to access the endpoint based on built in SAP Mobile Platform security mechanisms.

When using Datajs to access an OData service from the Hybrid Web Container, you must employ POST tunneling to use the PUT, MERGE, and DELETE methods. There is an explanation of how to use POST tunneling with Datajs here:  http://datajs.codeplex.com/wikipage?title=Frequently%20Asked%20Questions#post-tunneling.