Pro WCF 4_ Practical Microsoft SOA Imple - Pathak_ Nishith.pdf

(10405 KB) Pobierz
THE EXPERT’S VOICE
®
IN .NET
Pro
WCF 4
SECOND EDITION
Practical Microsoft SOA Implementation
Creating the next generation of secure, reliable,
and interoperable services
Nishith Pathak
For your convenience Apress has placed some of the front
matter material after the index. Please use the Bookmarks
and Contents at a Glance links to access them.
Contents at a Glance
Contents ..................................................................................................................... v
About the Author ..................................................................................................... xiv
About the Technical Reviewer .................................................................................. xv
Acknowledgments ................................................................................................... xvi
Introduction ............................................................................................................ xvii
Part I: Introducing Windows Communication Foundation .......................................... 1
■Chapter
1: WCF and SOA Basics .............................................................................. 3
■Chapter
2: What’s New in WCF 4 ........................................................................... 25
■Chapter
3: Exploring the WCF Programming Model .............................................. 55
Part II: Programming with WCF................................................................................ 99
■Chapter
4: Installing and Creating WCF Services ................................................ 101
■Chapter
5: Hosting and Consuming WCF Services .............................................. 145
■Chapter
6: Managing WCF Services .................................................................... 185
Part III: Advanced Topics in WCF ........................................................................... 217
■Chapter
7: Implementing WCF Security .............................................................. 219
■Chapter
8: Implementing Reliable Messaging and
Queue-Based Communications ......................................................... 253
■Chapter
9: Using Transactions in WCF ................................................................ 281
■Chapter
10: Integrating with COM+ .................................................................... 303
■Chapter
11: Working with Data ........................................................................... 337
■Chapter
12: Developing Peer-to-Peer Applications with WCF............................. 371
■Chapter
13: Implementing SOA Interoperability ................................................. 399
■Appendix:
QuickReturns Ltd. ............................................................................... 419
Index....................................................................................................................... 425
iv
Introduction
This book is a complete guide to Windows Communication Foundation (WCF) from a service-oriented
architecture (SOA) perspective. With each new version of the .NET Framework, Microsoft has improved
many key areas of WCF. In .NET 4.0, Microsoft has given developers a better experience and enabled
them to become more productive. The book not only provides deep insight into the new WCF
functionality that ships with .NET 4.0—such as service discovery, routing services, and simplified
configuration—but also provides extensive examples to make it easier to put the new concepts into
practice. You'll learn how to move your current offerings to WCF, and how to integrate those
applications with WCF 4.0. This book offers genuine insight into solving real enterprise problems using
WCF and .NET 4.0. This books covers the following:
The new features of WCF with .NET 4.0
The WCF programming model
Implementing WS-Discovery and routing services in WCF
How queue management and reliable messaging work in WCF
Implementing transaction support in WCF
How to make WCF services interoperable with other SOA offerings
Best practices for using WCF effectively
Developing WCF applications with Visual Studio 2010
It will also address the business drivers that dictate the need for these WCF features, as well as the
industry best practices for applying them.
Who This Book Is For
The release of .NET 4.0 brought a wide range of new functionality to WCF. Developers and architects
with experience using WCF 3.5 or earlier who want to be able to apply this new functionality to their
applications will benefit greatly from the discussions and code samples in this book. This book is also a
great resource for application developers and architects new to SOA and/or the core concepts of WCF.
An Overview of This Book
This book specifically targets WCF in .NET 4.0. The text that you hold in your hands is a massive retelling
of this book’s first printing to account for all of the major changes that are found in .NET 4.0. Not only
will you find brand-new chapters, you will find that many of the previous chapters have been expanded
in great detail. This book divided into three parts, each of which contains related chapters. The following
xvii
INTRODUCTION
sections describe each part. The book also has one appendix, where you’ll find a description of the
sample application used throughout this book.
Part 1: Introducing Windows Communication Foundation
This part of the book explains the business motives and pain points of the various distributed
technologies developed by Microsoft. It explains how you can address these issues using WCF. Once you
understand some of these basic concepts of WCF, including the business and technological factors, you
can appreciate its simplicity and flexibility. Chapter 1 covers the service standards and introduces WCF.
Chapter 2 explains the new features of WCF that ship with .NET 4.0. Chapter 3 discusses the unified
programming model of WCF and how WCF provides the best tools for creating secure, interoperable
web services.
Part 2: Programming with WCF
This part covers the technical features of WCF in detail. You’ll concentrate on the programming aspects
of WCF with the assistance of a fictitious stock market application. Chapter 4 guides you through
installing and creating WCF services. Chapter 5 covers creating services, and the various hosting options
available in WCF services. Chapter 6 discusses how to manage WCF services to obtain the best return on
investment for your application.
Part 3: Advanced Topics in WCF
Real-world SOA applications will have many demanding features to implement. These complex real-world
web service implementations will address security issues (both client and service), reliable messaging,
transactions, COM+ integration, data integration issues, and peer-to-peer communications. In Chapters 7
through 12, you will concentrate on these topics. In addition, you’ll investigate the WCF interoperability
options available to seamlessly communicate with non-Microsoft platforms in Chapter 13.
Prerequisites
To get the most out of this book, you should install WCF and the .NET Framework 4.0. I recommend
using Microsoft Visual Studio 2010 as the development environment to experiment with the code
samples, which you can find in the Source Code section of the Apress web site (www.apress.com).
Obtaining Updates for This Book
As you read through this text, you may find the occasional grammatical or code error (although I sure
hope not). If this is the case my sincere apologies. Being human, I am sure that a glitch or two may be
present, regardless of my best efforts. If this is the case, you can obtain the current errata list from the
Apress web site (located once again on the home page for this book), as well as information on how to
notify me of any errors you might find.
xviii
Zgłoś jeśli naruszono regulamin