Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Since most of the interesting aspects of this code are in the
Contracts and Services projects, I will only be digging into
these. While this template splits out these two concerns into separate
assemblies, this certainly isn’t a requirement. This is, however, a common
approach in large applications. Additionally, it opens up the ability to
use ChannelFactory to create a channel
to a service endpoint rather than having to use Svcutil.exe to generate code for a client
proxy. I’ll show an example of this later in this section.
The Contracts project provides
two files. The first file contains a CompositeType, which gives an example of a
record type that can be provided to and returned from a service operation.
As I mentioned in Chapter 1,
records should be preferred when possible; however, F# classes are also
perfectly acceptable. The contents of this file are shown in the following
example: