Book description
Over 85 easy recipes for managing communication between applications
- Master WCF concepts and implement them in real-world environments
- An example-packed guide with clear explanations and screenshots to enable communication between applications and services and make robust SOA applications
- Resolve frequently encountered issues effectively with simple and handy recipes
- Explore the new features of the latest .NET 4.0 framework/Visual Studio 2010
In Detail
The Windows Communication Foundation 4.0 (WCF 4.0) is a .NET-based application programming interface for building and running connected systems. It enables secure and reliable communication among systems within an organization or across the Internet. This book deals with the difficult issues faced by a .NET developer while working with WCF.
WCF 4.0 is a communications infrastructure that unifies a broad array of distributed systems' capabilities in a composable, extensible architecture that supports multiple transports, messaging patterns, encodings, network topologies, and hosting models. This book is a collection of focused real-world recipes and covers basic recipes on topics such as working with contracts to more advanced topics such as extending WCF runtime. By the end of this book you will have valuable information that helps transform the potentially unproductive habits of .Net developers who work with WCF.
This book will take you through many concepts starting with complete support for contract-related design for WCF service development. You will learn to use WCF's built-in feature for building various service endpoints. Service hosting and configuration are important areas for building WCF services, especially at the service deployment stage, and are detailed in this book. You will find it easy to work with WCF client proxy generation and metadata publishing and discovery when you go through recipes such as customizing auto-generated service proxies.
The author then discusses the exchange of data in WCF service operation features, related to WCF data serialization. You will discover some useful tips for security in WCF service development and built-in features for developing concurrency control for your services built upon it.
One big plus is that you will learn to extend the existing WCF framework to achieve advanced functionality. You will find a dedicated chapter for RESTful and AJAX-enabled service development. Moving on, you will find several useful WCF service interoperability cases, which are important for a distributed service development platform. Towards the end of this book you will find some handy and useful diagnostic methods for troubleshooting.
Extend and secure the WCF framework and develop robust SOA applications with ease
Table of contents
-
Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications
- Table of Contents
- Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications
- Credits
- Foreword
- About the Author
- About the Reviewers
- Preface
-
1. Working with Contracts
- Introduction
- Defining a one-way Contract
- Make DataContract forward-compatible
- Generate DataContract from an XML Schema
- Using XMLSerializer to control message serialization
- Using MessageContract to control the SOAP message
- Adding a custom SoapHeader via Contract
- Return custom exception data through FaultContract
-
2. Endpoint, Binding, and Behavior
- Introduction
- Configuring Default Endpoints
- Setting up two-way communication over MSMQ
- Building a Publish-Subscribe service with dual binding
- Creating a multiple-endpoint service
- Implementing a POX HTTP service
- Defining a CustomBinding without a timestamp header
- Suppressing mustUnderstand validation on unknown SoapHeaders
- Sharing a physical address between multiple endpoints
-
3. Hosting and Configuration
- Introduction
- Hosting a service in a console application
- Hosting a service in Windows Service
- Hosting a HTTP service with ASP.NET-compatible context
- Hosting a non-HTTP service in IIS 7
- Customizing IIS ServiceHost via ServiceHostFactory
- Specifying a dedicated service instance for a singleton service
- Hosting a service in WSS 3.0
-
4. Service Discovery and Proxy Generation
- Introduction
- Creating a typed service client
- Choosing a specific type for representing a collection parameter
- Reusing types between service and client
- Customizing an auto-generated service proxy class in Visual Studio
- Building an ad-hoc auto-discoverable service
- Using managed ServiceDiscovery
- Generating a service proxy in code
- Customizing auto-generated service metadata
- 5. Channel and Messaging
-
6. Dealing with Data in Service
- Introduction
- Binding a WPF element with data from a WCF service
- Returning ReadOnlyCollection data
- Using raw XML as an operation parameter
- Returning a DataTable/DataSet in a service operation
- Transferring binary data with MTOM encoding
- Specifying ServiceKnownType information in a programmatic way
- Using XmlSerializer for custom data serialization
-
7. Security
- Introduction
- Setting up ad hoc Windows authentication over plain HTTP
- Getting an authenticated client identity in a service operation
- Using username authentication with an ASP.NET membership provider
- Sending a clear text username token over unsecured HTTP transport
- Using transport and message security at the same time
- Authorizing through declarative role-based access control
- Impersonating with a client caller identity
- Adding multiple tokens in a service request (supportingToken)
- Supplying dedicated credentials for firewall or proxy authentication
- Securing a dynamic SoapHeader
- 8. Concurrency
-
9. Extending WCF Runtime
- Introduction
- Using a custom ServiceHost
- Intercepting operation parameters in a strong-type manner
- Filtering operation requests based on message
- Generic operation error handling with OperationInvoker
- Altering operation messages via MessageInspector
- Building a custom MessageEncoder
- Centralizing authorization through a custom ServiceAuthorizationManager
-
10. RESTful and AJAX-enabled WCF Services
- Introduction
- Building a self-hosted REST service
- Using an auto-generated Help page
- Mapping URL suffix to operation parameters
- Applying OutputCache in a REST service
- Implementing file download via REST endpoint
- Consuming a WCF service from an ASP.NET AJAX client
- Accessing a remote REST service in an AJAX client
- 11. Interoperability
-
12. Diagnostics
- Introduction
- Using the WCF Test Client tool to test a service
- Capturing WCF request/response messages via Fiddler tool
- Using built-in tracing and message logging
- Debugging in a Windows service host
- Creating a custom Visual Studio Debugger Visualizer for WCF debugging
- Using PerformanceCounters for WCF service monitoring
- 13. Miscellaneous WCF Development Tips
- Index
Product information
- Title: Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications
- Author(s):
- Release date: October 2010
- Publisher(s): Packt Publishing
- ISBN: 9781849680769
You might also like
book
Windows® Communication Foundation 4 Step by Step
Your hands-on, step-by-step guide to building connected, service-oriented applications. Teach yourself the essentials of Windows Communication …
book
Pro WCF 4: Practical Microsoft SOA Implementation, Second Edition
Pro WCF 4.0: Practical Microsoft SOA Implementation is a complete guide to Windows Communication Foundation from …
book
Windows® 98 Unleashed
Windows 98 Unleashed provides you with comprehensive coverage of the newest Windows features. This complete reference …
book
Microsoft® Windows® Communication Foundation Step by Step
Teach yourself the essentials of Windows Communication Foundation—one step at a time. With this practical tutorial, …