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
  • PrintPrint
Share this Page URL
Help

Chapter 8: ReactiveUI > Calling Web Services in XAML Using ReactiveUI

Calling Web Services in XAML Using ReactiveUI

Remember from the previous sections that an IObservable can be used as a future, a “box” that will eventually contain the result of a web service call or other asynchronous function, or the error information. To this end, we’d really like our web service calls to all be vaguely of the following form:

IObservable<Something> CoolWebServiceCall(object Param1, object Param2 / *etc*/);

Recalling back to previous chapters, we're going to use the Observable.FromAsyncPattern in order to map a Begin/End pair of methods into an Rx async method.

An Important Note on Silverlight

Silverlight's web service generated client code does something a bit annoying—it hides away the BeginXXXX/EndXXXX calls, presumably to make the IntelliSense cleaner. However, they're not gone, the way you can get them back is by casting the MyCoolServiceClient object to its underlying interface (i.e. the LanguageServiceClient object has a generated ILanguageServiceClient interface that it implements).


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint