Data points: watching cloud services from Silverlight 2

Source: Internet
Author: User
Tags soap representational state transfer versions web services silverlight advantage

This column is based on the pre-release version of Silverlight 2. All the information in this article may be changed.

Developers who use Silverlight often give a sense of unreality, but can they be blamed? Getting data from a variety of Web services for rich Internet applications (RIA) is becoming a mainstream trend. Silverlight applications can communicate with ASMX Web services, windows®communication Foundation (WCF) Web services, representational state transfer (REST) services, and traditional XML (POX) services. Whether these services are services provided by third parties or custom services hosted on the server where Silverlight applications reside, Silverlight can request data, work with data, and pass data back and forth between Silverlight client applications and such WEB services.

Based on the analysis of the issues presented to me, the developers clearly want to know more about the differences between invoking services from Silverlight 2 applications, using WCF, ASMX, and REST services, and how to use the data provided by these services. In this issue of data points, I will answer some of these questions and demonstrate how to handle data services.

Third-party WEB services are numerous and exhaustive, ranging from accessing their APIs to storing client-specific data and custom data. I'll discuss how to use and pass data between Silverlight applications and the service cloud. In addition, I'll explain how to use several XML parsing libraries to work with this data. For example, you can open and iterate through an entire XML document, or query XML using LINQ to XML. Services like Flickr, Amazon, Twitter, and Live Search provide APIs that can communicate with them using a variety of WEB services technologies. I'll discuss some of these APIs here and explain how to use the rest and SOAP based services to communicate with them. All the examples from this column can be downloaded from the MSDN Magazine Web site (both C # and Visual Basic versions are available).

How do I handle Web services in Silverlight 2?

It's a good idea to discuss this first, because it helps to understand why so many developers are keen to interact with Web services using Silverlight 2. Silverlight 1.x cannot take advantage of the Microsoft. NET Framework support code and does not have any. NET controls. Silverlight 2 introduces a number of complete features that eliminate the limitations of previous versions. Silverlight 2 enables you to write code in C # or Visual Basic and take full advantage of your existing. NET CLR experience. Although the libraries included in Silverlight are only a subset of the complete. NET library, the Silverlight 2 functionality is comprehensive. For example, you can access the WebClient and HttpWebRequest classes from Silverlight, and you can interact with the web-based service by calling the URI. The data can then be used using the XmlReader object or through LINQ to XML.

Silverlight 2 Adds a large amount of functionality for passing data between services. The following are the newly added features in Silverlight 2:

SOAP-based WEB services can be accessed through proxy classes.

You can access a RESTful Web service.

Access to the Ado.net data Service (a restful service that allows remote LINQ queries).

You can use JavaScript Object notation (JSON) and XML to retrieve results from a WEB service.

Duplex communication is supported through WCF (push with server).

Cross-domain access can be supported using either the ClientAccessPolicy.xml file or the Crossdomain.xml file.

Cross-domain network support can be provided using HTTP and sockets.

Asynchronously Initializes a WEB service call.

How do I pass data from a service to Silverlight 2?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.