iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi!
I'm new in CrossLight Plataform.
I try access to REST response to use in my first app, a login screen in WinRT that call to http://localhost:37349/api/Login/{userId} and this return FirstName, LastName and Password. Simple REST Service.
I've seen some sample (as Master/Detail sample) but all example use a xml file in Asserts/Data folder (ie in Master/Detail template is \CrosslightApp.Core\Assets\Data\Category.xml).
I want know how to use Crosslight.Rest library, where call my REST service and how to bind data with my Model Class in Core project.
Thank you very much and sorry for my english.
In accessing REST service you often transfer data from client to the REST service or the other way around. The common way to do it is to serialize the data into JSON format or XML format which already handled by Crosslight RestClient. However the serialization process is more dynamic based on application's requirements, there are many ways to handle serialization and the possibility to have new format in the future. To handle these scenarios, Crosslight RestClient allows you can create your own Serializer and Deserializer that comply with the target REST service.
For deserialization, Crosslight RestClient will create the object based on the specified type, read the specified input string, and attempt to merge all property values available in the input string to the actual object. Properties not available in the actual object will be ignored.
string baseUrl = "http://localhost:27040/api/"; // create the Rest Client IRestClient client = new RestClient(baseUrl); // create and execute RestRequest to access GET api/values. IRestRequest request = new RestRequest("values", HttpMethod.GET); IRestResponse response = await client.ExecuteAsync<complexdata>(request);
Notice that the ExecuteAsync method has the target deserialization type.
IRestResponse response = await client.ExecuteAsync<complexdata>(request);
It will deserialize the HTTP response content to ComplexData object and you can get the deserialized object from the response.Data property.
For more detail information, please check the Crosslight documentation on Understanding REST Client Data Serialization Process topic.
WebAPI-enabled Inventory Tracker sample (Link to Git: http://git.intersoftpt.com/projects/CROS/repos/samples/browse/MyInventory_WebApi.) is recommended for you. One of its features highlight is: Efficient use of the RestClient Class and QueryDescriptor Class to demonstrate web data retrieval.
Hope this helps.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname