HttpWebRequest class is another option that
allows web service requests to be made.
WebClient offers a simple yet effective API to
invoke and consume web services from Silverlight applications. All calls
WebClient are actually
passed through the
class under the covers.
basically a simplified wrapper on top of
HttpWebRequest. You should use the
HttpWebRequest class when you require more
granular control over the web service call.
properties that allow customization of the web service call by including
headers through the
and setting the content type through the
ContentType property. Table 7-2 lists some of the
most important members of
HttpWebRequest used in invoking web
Table 7-2. Key methods and properties of HttpWebRequest
Methods and events
Cancels a request made
Begins the asynchronous request for a stream to send HTTP request data to a service.
Begins the asynchronous request for a stream to receive an HTTP response from a service.
Method of the base class
Ends the asynchronous request to obtain a stream to send an HTTP request.
Ends the asynchronous request to obtain a stream to receive an HTTP response.
Gets or sets the ...