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

2. Creating Web Services with F# > Exploring the Output Code

Exploring the Output Code

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.

F# WCF template search on Visual Studio Gallery

Figure 2-1. F# WCF template search on Visual Studio Gallery

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:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

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

  

Start a Free 10-Day Trial


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