Search code examples
c#xamarinodataxml-namespaces

Parsing Data in Xamarin Forms


I would like to get the names in collection href(CustomerDemographics, Customers, Employees, Order Details) to populate a listview. I would like to know how to parse these information in Xamarin platform or C#. I am quite new on this environment. I have experience how to parse json data in native ios with objective c, but it is the first time I see this type of data.

enter image description here


Solution

  • From the attached image it seems that you're requesting the service document of the OData service. Namely the http://host/service/ endpoint of the service. If you would like to get the content of the collections, you should append the names of the collections to the end of the service document URL, such as:

    GET http://host/service/Categories
    GET http://hsot/service/CustomerDemographics
    

    The format of the response payload depends on the protocol version of the OData service. If you are talking to a OData V4 service (it actually seems a lot like you are querying the Northwind OData V4 sample service: http://services.odata.org/v4/northwind/northwind.svc/), the response payload will be in JSON format and you can use the ways that you are familiar with to parse the response.

    In addition, I would recommend you go through the basic tutorial on OData.org so that you can get a better grasp of OData requests: http://www.odata.org/getting-started/basic-tutorial/