Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

10. Talking to REST and WCF Data Service... > Passing credentials and cross-domain... - Pg. 439

Chapter 10 if (e.Result != null) { UserTimeLineListBox.ItemsSource = e.Result; } } The other methods are similar and can be found in the sample code. How it works... As previously explained, Twitter, along with most Web 2.0-type applications, has a locked- down cross-domain file. Silverlight's cross-domain restrictions prohibit us from directly calling the REST API from Silverlight. Therefore, we need to build a service layer in between the Silverlight application and the REST service. As services themselves don't mind cross-domain restrictions, we can call whatever type of REST services (or other types) we want. Our own service will act as a pass-through for data in both directions. See also To understand why Twitter and Flickr need such a different approach, read the previous recipe in this chapter. In the following recipe, we'll see how trusted Silverlight applications can talk directly to Twitter, as they aren't tied to cross-domain restrictions. Passing credentials and cross-domain