Wiley.com
Print this page Share

Professional WCF Programming: .NET Development with the Windows Communication Foundation

ISBN: 978-0-470-08984-2
Paperback
430 pages
April 2007
Professional WCF Programming: .NET Development with the Windows Communication Foundation (0470089849) cover image
This title is out-of-print and not currently available for purchase from this site.

Acknowledgments xiii

Introduction xv

Part I: Introduction to Windows Communication Foundation 1

Chapter 1: Windows Communication Foundation Overview 3

The Need for SOA 4

A Look Back 5

Understanding Service Orientation 6

Service-Oriented Architecture Principles 7

Microsoft’s Commitment to SOA 8

SOA Wrap-up 9

Why Windows Communication Foundation 9

WCF Architecture 10

The Makeup of WCF 13

WCF Features 15

Summary 16

Chapter 2: Windows Communication Foundation Concepts 17

Messages 18

Message Structure 18

Messaging Programs 23

Messaging Patterns 26

Channels 28

Channel Stacks 29

Services 30

Endpoint 33

Addresses 33

Bindings 33

Contracts 34

Behaviors 36

Summary 36

Chapter 3: Understanding Windows Communication Foundation 39

WCF Programming Model 40

SO or OO 40

Service Model 41

WCF Programming Methods 49

WCF Programming Levels 51

The Development Process 52

And the Answer Is . . . 53

Installing WCF 53

Creating Your First WCF Service 56

Service Code 71

Service.svc 71

Web.config 71

Summary 72

Part II: Programming Windows Communication Foundation 73

Chapter 4: Addresses 75

WCF Addresses 75

Address Types 76

Address Formats 77

Programming WCF Addresses 80

EndpointAddress Class 80

Programming Addresses 83

Summary 86

Chapter 5: Understanding and Programming WCF Bindings 87

Understanding WCF Bindings 87

Predefined Bindings 88

Programming WCF Bindings 109

Using Code 110

Using Configuration Files 124

Summary 126

Chapter 6: Understanding and Programming WCF Contracts 127

WCF Contracts 128

Contracts and Their Relationship with the CLR 128

Service Contracts 128

Service Types 134

Data Contracts 140

Message Contracts 145

Programming WCF Contracts 151

Data Contract 151

Message Contract 158

Summary 163

Chapter 7: Clients 165

Client Architecture 165

Client Objects 166

Client Channels 168

Channel Factories 169

Client Communication Patterns 172

One-Way 172

Request-Reply 173

Duplex 174

Asynchronous 178

Creating Client Code 180

Generating Client Code 180

Defining Client Bindings and Endpoints 181

Typed versus Untyped Services 183

Invoking Operations of a Typed Services 183

Invoking Operations of an Untyped Service 184

Useful Information 184

Initializing Channels Interactively 184

Session and Channel Duration 185

Blocking Issues 185

Exception Handling 186

Client Programming Example 187

ChannelFactory 187

Duplex 193

Summary 199

Chapter 8: Services 201

Overview 201

Service Types 202

Service Contracts 205

Service Endpoints 206

Service Behaviors 208

ServiceBehavior Attribute 209

OperationBehavior Attribute 216

Using Configuration to Specify Behaviors 218

InstanceContext 220

Handling Exceptions 220

FaultException 221

FaultContract Attribute 222

Programming Example 224

Summary 228

Chapter 9: Transactions and Reliable Sessions 231

Transactions 231

Overview 232

Transaction Attributes in System.ServiceModel 233

Reliable Sessions 237

Overview 237

Message Exchange 238

Securing Messages 240

Queues 243

Summary 251

Chapter 10: Security 253

Security Overview 254

Concepts 254

Why WCF Security? 256

Credentials 262

Security Behaviors and Bindings 263

Security Behaviors 263

Bindings 267

Securing Clients and Services 269

Best Practices 272

Summary 272

Chapter 11: Customizing Windows Communication Foundation 273

Extending ServiceHost and Service Model Layer 274

Client 274

Dispatcher 279

Behaviors 283

Extending the Channel Layer 284

Client Channel 285

Service Channel 286

Channel Development 287

Extending Bindings 290

Building Custom Bindings 290

User-Defined Bindings 292

Summary 293

Chapter 12: Interoperability and Integration 295

Interoperability 296

Web Service Protocol Support 296

WSE (Web Service Enhancements) 298

ASP.NET Web Services 303

Integration 305

COM+ 305

MSMQ 308

Summary 310

Part III: Deploying Windows Communication Foundation 311

Chapter 13: Deploying Windows Communication Foundation 313

Installing WCF Services 313

Support Operating Systems 313

Required Software 314

Installing the WCF Service 317

WCF Service Configurations 319

Upgrading Services 320

Troubleshooting WCF Installations 320

Client/Service Communication 320

Unexpected Service Behavior 321

Exceptions 322

Summary 322

Chapter 14: Managing Windows Communication Foundation 323

Tracing 324

End-to-End Tracing 324

Service Trace Viewer 326

Message Logging 333

Service Configuration Editor 336

Configuration 337

Tasks 341

Detail 341

Performance Counters 341

Summary 342

Chapter 15: Hosting Windows Communication Foundation Services 343

Hosting versus Self-Hosting 344

Hosting 344

Self-Hosting 344

Quick Comparison 344

Hosting Options 345

Hosting in IIS 345

Hosting in Managed Code 351

Hosting in a Windows Service 352

Hosting in WAS 353

Hosting Example 356

Summary 364

Appendix A: WCF Template Extensions in Visual Studio 365

Appendix B: Case Study 371

Index 409

Related Titles

More By This Author

General Programming & Software Development

by Randy Holloway, Andrej Kyselica, Steve Caravajal
by David A. Wilkinson
by Brett O'Connor
by Francis Shanahan
Back to Top