﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - Crosslight - How get REST response?</title><link>http://www.intersoftsolutions.com/Community/Crosslight/How-get-REST-response/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>How get REST response?</title><link>http://www.intersoftsolutions.com/Community/Crosslight/How-get-REST-response/</link><pubDate>Wed, 17 Dec 2014 16:50:09 GMT</pubDate><dc:creator>manolo.sbsoftware</dc:creator><category>Mobile Studio</category><category>REST</category><description>Hello again.&amp;nbsp;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I tried running the MyInventory_WebApi example, I have not gotten to do it work.Please, I need help understanding how to get a response from Rest. Could you make a documentation of how the sample code works? I am new to MVVM and data flow is quite hard to see.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;How Calling Rest? I have seen that is configured in the AppService but not to have to put my URI attributes (for example, my BaseAppUrl is https: //www.../api/login/ {username} / {password}). The answer he gave me Yudi a RestResponse await used, but not to have to put this code, giving me problems because it gets me the async method. Do I need any specific reference?&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;The response from the service load a class called User that is in the DomainModels and that inherits from EntityModel and it is serializable.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;div&gt;I'll share two test projects. One gets the data from a local xml, and the other is an attempt from a REST service (which is included in the project).&lt;/div&gt;&lt;div&gt;The project I share from dropbox because the attach file has given me problems.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;TEST PROJECT:&amp;nbsp;https://www.dropbox.com/s/kd1rvg9w77myjca/Sample%20Projects.zip?dl=0&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;Sorry to comment as extensive, but I have many problems enteder this part.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&amp;nbsp;Thank you so much, sorry for my English and hope you can help me.&lt;/div&gt;</description></item><item><title>How get REST response?</title><link>http://www.intersoftsolutions.com/Community/Crosslight/How-get-REST-response/</link><pubDate>Thu, 04 Dec 2014 10:12:26 GMT</pubDate><dc:creator>yudi</dc:creator><category>Mobile Studio</category><category>REST</category><description>&lt;p&gt;&lt;span style="color: #1f497d;"&gt;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.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #1f497d;"&gt;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.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;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&lt;complexdata&gt; response = await client.ExecuteAsync&amp;lt;complexdata&amp;gt;(request);&lt;/complexdata&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Notice that the &lt;a href="http://developer.intersoftpt.com/display/crosslightapi/RestClient+Class" target="_blank"&gt;ExecuteAsync&lt;/a&gt; method has the target deserialization type.&lt;/span&gt;&lt;/p&gt;
&lt;pre&gt;IRestResponse&lt;complexdata&gt; response = await client.ExecuteAsync&amp;lt;complexdata&amp;gt;(request);&lt;/complexdata&gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;It will deserialize the HTTP response content to ComplexData object and you can get the deserialized object from the &lt;a href="http://developer.intersoftpt.com/display/crosslightapi/RestResponse+Class" target="_blank"&gt;response.Data&lt;/a&gt; property.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;For more detail information, please check the Crosslight documentation on &lt;a href="http://developer.intersoftpt.com/display/crosslight/Understanding+REST+Client+Data+Serialization+Process" target="_blank"&gt;Understanding REST Client Data Serialization Process&lt;/a&gt; topic.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;WebAPI-enabled Inventory Tracker sample (Link to Git: &lt;a href="http://git.intersoftpt.com/projects/CROS/repos/samples/browse/MyInventory_WebApi" target="_blank"&gt;http://git.intersoftpt.com/projects/CROS/repos/samples/browse/MyInventory_WebApi&lt;/a&gt;.) is recommended for you. One of its features highlight is: Efficient use of the RestClient Class and QueryDescriptor Class to demonstrate web data retrieval.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: #1f497d;"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>How get REST response?</title><link>http://www.intersoftsolutions.com/Community/Crosslight/How-get-REST-response/</link><pubDate>Wed, 03 Dec 2014 11:40:07 GMT</pubDate><dc:creator>manolo.sbsoftware</dc:creator><category>Mobile Studio</category><category>REST</category><description>&lt;p&gt;Hi!&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;I'm new in CrossLight Plataform.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;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.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;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).&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;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.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;&lt;br&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size: 10pt;"&gt;Thank you very much and sorry for my english.&lt;/span&gt;&lt;/p&gt;</description></item></channel></rss>