Pro WCF 4: Practical Microsoft SOA Implementation, Second Edition Copyright © 2011 by Nishith Pathak All Rights Reserved

Total Page:16

File Type:pdf, Size:1020Kb

Pro WCF 4: Practical Microsoft SOA Implementation, Second Edition Copyright © 2011 by Nishith Pathak All Rights Reserved CYAN YELLOW MAGENTA BLACK PANTONE 123 C BOOKS FOR PROFESSIONALS BY PROFESSIONALS® THE EXPERT’S VOICE® IN .NET Companion eBook Available Pro WCF 4 Pro WCF 4: Practical Microsoft SOA Implementation is a complete guide to Windows Communication Foundation from the SOA perspective, demonstrat- Pro ing why WCF 4 is critical to service-oriented architecture and development. WCF 4 Gain deep insight into the functionality of WCF 4 and the improvements from the .NET 4.0 Framework – learn about service discovery, the routing ser- vice, a new simplified configuration paradigm, and other advanced features. Deepen your mastery of WCF 4 through informative examples that will aid you Nishith Pathak, Author of in understanding and implementing these important additions. Pro WCF: Practical Microsoft Inside, you’ll find coverage of the unified programming model, reliable mes- SOA Implementation saging, security, and the peer-to-peer programming model. You'll also learn Pro how to move your current .NET remoting and web service applications to WCF and how to integrate those applications with WCF 4. This book offers genuine insight into solving real enterprise problems using WCF and .NET 4.0. In Pro WCF 4, learn more about: • New features of WCF with .NET 4.0 • A comprehensive WCF programming model • How queue management and reliable messaging work in WCF • Implementing transaction support in WCF • Making WCF services interoperable with other SOA offerings • Best practices in using WCF effectively • Developing WCF applications with Visual Studio 2010 WCF 4 The release of .NET 4.0 brought a wide range of new functionality to WCF. Practical Microsoft SOA Implementation Developers and architects with experience using WCF 3.5 or earlier who want to apply this new functionality to their application will benefit greatly from the discussions and code samples in this book. Pro WCF 4 is also a great resource for application developers and architects new to SOA or the core concepts of WCF. Creating the next generation of secure, reliable, Companion eBook and interoperable services THE APRESS ROADMAP Pro WCF 4 See last page for details Introducing Expert SECOND EDITION on $10 eBook version .NET 4 WCF 4 SECOND Pro C# 2010 and EDITION the .NET 4 Platform SOURCE CODE ONLINE Pathak www.apress.com ISBN 978-1-4302-3368-8 Nishith Pathak 54999 US $49.99 Shelve in: .NET User level: 9 781430 233688 Intermediate–Advanced this print for content only—size & color not accurate 7.5 x 9.25 spine = 0.875" 472 page count This book was purchased by [email protected] 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
Recommended publications
  • Building Openjfx
    Building OpenJFX Building a UI toolkit for many different platforms is a complex and challenging endeavor. It requires platform specific tools such as C compilers as well as portable tools like Gradle and the JDK. Which tools must be installed differs from platform to platform. While the OpenJFX build system was designed to remove as many build hurdles as possible, it is necessary to build native code and have the requisite compilers and toolchains installed. On Mac and Linux this is fairly easy, but setting up Windows is more difficult. If you are looking for instructions to build FX for JDK 8uNNN, they have been archived here. Before you start Platform Prerequisites Windows Missing paths issue Mac Linux Ubuntu 18.04 Ubuntu 20.04 Oracle Enterprise Linux 7 and Fedora 21 CentOS 8 Common Prerequisites OpenJDK Git Gradle Ant Environment Variables Getting the Sources Using Gradle on The Command Line Build and Test Platform Builds NOTE: cross-build support is currently untested in the mainline jfx-dev/rt repo Customizing the Build Testing Running system tests with Robot Testing with JDK 9 or JDK 10 Integration with OpenJDK Understanding a JDK Modular world in our developer build Adding new packages in a modular world First Step - development Second Step - cleanup Before you start Do you really want to build OpenJFX? We would like you to, but the latest stable build is already available on the JavaFX website, and JavaFX 8 is bundled by default in Oracle JDK 8 (9 and 10 also included JavaFX, but were superseded by 11, which does not).
    [Show full text]
  • Corticon Server: Deploying Web Services with .NET
    Corticon Server: Deploying Web Services with .NET Notices Copyright agreement © 2014 Progress Software Corporation and/or its subsidiaries or affiliates. All rights reserved. These materials and all Progress® software products are copyrighted and all rights are reserved by Progress Software Corporation. The information in these materials is subject to change without notice, and Progress Software Corporation assumes no responsibility for any errors that may appear therein. The references in these materials to specific platforms supported are subject to change. Business Making Progress, Corticon, DataDirect (and design), DataDirect Cloud, DataDirect Connect, DataDirect Connect64, DataDirect XML Converters, DataDirect XQuery, Fathom, Making Software Work Together, OpenEdge, Powered by Progress, Progress, Progress Control Tower, Progress OpenEdge, Progress RPM, Progress Software Business Making Progress, Progress Software Developers Network, Rollbase, RulesCloud, RulesWorld, SequeLink, SpeedScript, Stylus Studio, and WebSpeed are registered trademarks of Progress Software Corporation or one of its affiliates or subsidiaries in the U.S. and/or other countries. AccelEvent, AppsAlive, AppServer, BusinessEdge, Progress Easyl, DataDirect Spy, DataDirect SupportLink, Easyl, Future Proof, High Performance Integration, Modulus, OpenAccess, Pacific, ProDataSet, Progress Arcade, Progress Pacific, Progress Profiles, Progress Results, Progress RFID, Progress Responsive Process Management, Progress Software, ProVision, PSE Pro, SectorAlliance, SmartBrowser,
    [Show full text]
  • Build Prerequisites
    Build Prerequisites Table of Contents 1 Overview 2 Introduction 3 IDE 4 Download 5 Installation 5.1 Git for Windows 5.2 TortoiseGit 5.3 YASM (since MP 1.25 Final, YASM is provided as nuget package, you can skip this ) 5.4 NuGet Package Manager 5.5 NSIS 6 Configuration 6.1 .Net Framework 3.5 6.2 Windows and DirectX SDK Environment Variables 6.3 TortoiseGit 7 Next Steps 8 Changelog Overview How to setup your system with the required software to access and use or contribute to the MediaPortal source code, particularly for compiling and building an installer.. Introduction In order to reduce the size of the MediaPortal Git repository and simplify merging branches and testing, C++ sourced binaries have been removed from the repository as of April, 2013. This change affects the way in which you setup your system to compile and build MediaPortal. This guide is written for anyone who wants access to our MediaPortal source code repository to compile and build individual branches for testing or development, using either Windows 7 or Windows 8. Note: You should have already installed the Required software for MediaPortal on the system where you install Git, see Requirements > System Components IDE Our source repository contains Microsoft Visual Studio 2013 solutions. We recommend using Visual Studio 2013 Community Edition but any commercial edition should work too. Download Let's start with downloading the required software: Git for Windows (get the latest Full Installer) TortoiseGit (32bit or 64bit depends on your OS) Visual Studio 2015 Community
    [Show full text]
  • Winframe API SDK Programmer's Guide
    WFAPI SDK Programmer's Guide Introduction The Citrix WFAPI functions enable application programs to perform tasks that are unique to XenApp and XenDesktop. Appropriate hotfixes and service packs may be needed for the functions defined here to execute properly. In this document XenApp and XenDesktop will be referred to as Citrix VDA. XenApp (RDS VDA) runs on server OSs, Microsoft Windows 2008R2 (Win 7 server) and Windows 2012R2 (Win 8.1 server) and XenDesktop (WS VDA) runs on workstation OSs, Windows 7, Windows 8.1, Windows 10. This SDK allows software developers to programmatically access features specific to Citrix VDAs. For example: • Enumerating servers, sessions, and processes • Managing servers, sessions, and processes • Accessing Citrix-specific user data • Sending messages to a session • Using virtual channels • Waiting on system events The WFAPI SDK comprises a set of function calls to the Wfapi.dll dynamic link library (DLL) for 32- bit applications and Wfapi64.dll for 64-bit applications. These DLLs are available on servers running XenApp and on Windows Workstation platforms running XenDesktop. Example programs are included to assist developers. Using the WFAPI SDK The WFAPI SDK is intended for use by OEMs and customers who need to write applications that directly call WFAPI functions, using Microsoft Visual C++, Version 12.0 (Visual Studio 2013). System Requirements The WFAPI SDK must be installed and built on a Windows 7, Windows 8.1, Windows 10, Windows Servers 2008R2 or 2012R2 computer with sufficient disk space. The SDK does not need more than a few megabytes of disk space; however, third-party development tools (for example, Microsoft Visual C++) may require a substantial amount of disk space.
    [Show full text]
  • IBM Connect:Direct for Microsoft Windows: Documentation Fixpack 1 (V6.1.0.1)
    IBM Connect:Direct for Microsoft Windows 6.1 Documentation IBM This edition applies to Version 5 Release 3 of IBM® Connect:Direct and to all subsequent releases and modifications until otherwise indicated in new editions. © Copyright International Business Machines Corporation 1993, 2018. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Chapter 1. Release Notes.......................................................................................1 Requirements...............................................................................................................................................1 Features and Enhancements....................................................................................................................... 2 Special Considerations................................................................................................................................ 3 Known Restrictions...................................................................................................................................... 4 Restrictions for Connect:Direct for Microsoft Windows........................................................................ 4 Restrictions for Related Software.......................................................................................................... 6 Installation Notes.........................................................................................................................................6
    [Show full text]
  • NET Tutorial for Beginners
    India Community Initiative .NET Tutorial for Beginners Special thanks to the following who have put in sincere efforts to write and bring this tutorial together. Akila Manian (MVP) | Ajay Varghese (MVP) | Amit Kukreja | Anand M (MVP) | Aravind Corera (MVP) | Arvind Rangan | Balachandran | Bipin Joshi (MVP) | C S Rajagopalan | G Gokulraj | G Arun Prakash | Gurneet Singh (MVP) | Kunal Cheda (MVP) | Manish Mehta (MVP) | Narayana Rao Surapaneni (MVP) | Pradeep | Saurabh Nandu (MVP) | Shankar N.S. | Swati Panhale | Reshmi Nair Content 1. Getting Ready .......................................................................................... 4 1.1 Tracing the .NET History..............................................................................4 1.2 Flavors of .NET...........................................................................................5 1.3 Features of .NET.......................................................................................10 1.4 Installing the .NET Framework SDK.............................................................12 2. Introduction to the .NET Initiative and the .NET Platform...................... 15 2.1 Understanding the Existing Development Scenario........................................15 2.2 Challenges faced by developers..................................................................18 2.3 NET Philosophy / Where does .NET fit in? ....................................................21 2.4 Understanding the .NET Platform and its layers ............................................25 2.5
    [Show full text]
  • Visual Build Help
    Visual Build Professional User's Manual Copyright © 1999-2021 Kinook Software, Inc. Contents I Table of Contents Part I Introduction 1 1 Overview ................................................................................................................................... 1 2 Why Visual................................................................................................................................... Build? 1 3 New Features................................................................................................................................... 2 Version 4 .......................................................................................................................................................... 2 Version 5 .......................................................................................................................................................... 3 Version 6 .......................................................................................................................................................... 4 Version 7 .......................................................................................................................................................... 7 Version 8 .......................................................................................................................................................... 9 Version 9 .........................................................................................................................................................
    [Show full text]
  • Scilab for Very Beginners
    Scilab for very beginners Scilab Enterprises S.A.S - 143 bis rue Yves Le Coz - 78000 Versailles (France) - www.scilab-enterprises.com This document has been co-written by Scilab Enterprises and Christine Gomez, mathematics teacher at Lycée Descartes (Descartes HiGh School) in Antony, Hauts-de-Seine (France). © 2013 Scilab Enterprises. All riGhts reserved. Scilab for very beGinners - 2/33 Table of content Introduction About this document 4 Install Scilab 4 MailinG list 4 Complementary resources 4 Chapter 1 – Become familiar with Scilab The General environment and the console 5 Simple numerical calculations 6 The menu bar 7 The editor 8 The Graphics window 9 Windows manaGement and workspace customization 11 Chapter 2 - Programming Variables, assignment and display 12 Loops 16 Tests 17 2 and 3D plots 18 Supplements on matrices and vectors 23 Calculation accuracy 29 SolvinG differential equations 30 Chapter 3 – Useful Scilab functions In analysis 32 In probability and statistics 32 To display and plot 33 Utilities 33 Scilab for very beGinners - 3/33 Introduction About this document The purpose of this document is to Guide you step by step in explorinG the various basic features of Scilab for a user who has never used numerical computation software. This presentation is voluntarily limited to the essential to allow easier handling of Scilab. Computations, Graphs and illustrations are made with Scilab 5.4.0. You can reproduce all those commands from this version. Install Scilab Scilab is numerical computation software that anybody can freely download. Available under Windows, Linux and Mac OS X, Scilab can be downloaded at the followinG address: http://www.scilab.orG/ You can be notified of new releases of Scilab software by subscribinG to our channel notification at the following address: http://lists.scilab.orG/mailman/listinfo/release Mailing list To facilitate the exchanGe between Scilab users, dedicated mailinG lists exist (list in French, list for the education world, international list in English).
    [Show full text]
  • Mastering Powershellpowershell
    CopyrightCopyright © 2009 BBS Technologies ALL RIGHTS RESERVED. No part of this work covered by the copyright herein may be reproduced, transmitted, stored, or used in any form or by any means graphic, electronic, or mechanical, including but not limited to photocopying, recording, scanning, digitizing, taping, Web distribution, information networks, or information storage and retrieval systems except as permitted under Section 107 or 108 of the 1976 United States Copyright Act without the prior written permission of the publisher. For permission to use material from the text please contact Idera at [email protected]. Microsoft® Windows PowerShell® and Microsoft® SQL Server® are registered trademarks of Microsoft Corporation in the United Stated and other countries. All other trademarks are the property of their respective owners. AboutAbout thethe AuthorAuthor Dr. Tobias Weltner is one of the most visible PowerShell MVPs in Europe. He has published more than 80 books on Windows and Scripting Techniques with Microsoft Press and other publishers, is a regular speaker at conferences and road shows and does high level PowerShell and Scripting trainings for companies throughout Europe. He created the powershell.com website and community in an effort to help people adopt and use PowerShell more efficiently. As software architect, he created a number of award-winning scripting tools such as SystemScripter (VBScript), the original PowerShell IDE and PowerShell Plus, a comprehensive integrated PowerShell development system. AcknowledgmentsAcknowledgments First and foremost, I’d like to thank my family who is always a source of inspiration and encouragement. A special thanks to Idera, Rick Pleczko, David Fargo, Richard Giles, Conley Smith and David Twamley for helping to bring this book to the English speaking world.
    [Show full text]
  • Sharepoint Online Custom Solution Resources Applies To: Office 365 Dedicated – Legacy Release
    SharePoint Online Custom Solution Resources Applies to: Office 365 Dedicated – Legacy Release Topic Last Modified: 2014-04-07 This section describes resources available to customers and third party providers building custom solutions for SharePoint Online Dedicated. Custom Solutions Resources for SharePoint Online Dedicated The resources available to developers of SharePoint Online custom solutions include: Custom Solution Policies and Process (FTC) This article describes the policies and process that govern how Microsoft and its subscribers to SharePoint Online for enterprises dedicated plans validate and deploy custom solutions to the SharePoint Online environment. SharePoint Online Custom Solution Developer's Guide (Dedicated Plans) This article provides SharePoint Online Dedicated plan customers with guidelines and best practices to help you develop custom solutions that you can deploy to the SharePoint Online environment. Submitting Custom Solutions to SharePoint Online Using MSOCAF This article describes how to use Microsoft SharePoint Online Code Analysis Framework (MSOCAF), which is the tool you use to validate and submit SharePoint Online custom solutions. SharePoint Online Custom Solution Resources Legacy Release Office 365 Dedicated & ITAR-support Plans © 2015 Microsoft Corporation. All rights reserved. Page 1 of 222 Custom Solution Policies and Process (FTC) Topic Last Modified: 2014-04-11 This article describes the policies and process that govern how Microsoft and its subscribers to SharePoint Online Dedicated validate and deploy custom solutions to the SharePoint Online environment. These custom solutions include solutions and products that are developed by third parties and code developed in-house by customers. Custom solutions can be deployed to any web application in the SharePoint Online Dedicated environment (Portal, Team, Partner, or Personal Sites).
    [Show full text]
  • Micro Focus Enterprise Developer 7.0 Build Tools for Windows
    Micro Focus Enterprise Developer 7.0 Build Tools for Windows Release Notes Micro Focus The Lawn 22-30 Old Bath Road Newbury, Berkshire RG14 1QN UK http://www.microfocus.com © Copyright 2021 Micro Focus or one of its affiliates. MICRO FOCUS, the Micro Focus logo and Enterprise Developer are trademarks or registered trademarks of Micro Focus or one of its affiliates. All other marks are the property of their respective owners. 2021-07-06 ii Contents Enterprise Developer Build Tools for Windows Release Notes .....................4 Installation .......................................................................................................... 5 Prerequisites for Using Enterprise Developer Build Tools for Windows .............................. 5 Installing Enterprise Developer Build Tools for Windows .................................................... 5 Microsoft Package Dependencies .......................................................................................6 Managing the Microsoft Build Tools and Windows SDK Packages .....................................7 The Microsoft Build Tools and Windows SDK Configuration Utility .......................... 7 Restrictions .......................................................................................................10 Licensing Considerations ............................................................................... 11 Updates and Customer Care ........................................................................... 12 Further Information and Product Support ........................................................................
    [Show full text]
  • Using the Microsoft Windows SDK Tools to Compile Against Spincore Libraries
    Using the Microsoft Windows SDK Tools to Compile Against SpinCore Libraries SpinCore Technologies, Inc. November 19, 2013 1 Introduction Recently, SpinAPI's compilation process has moved to the Microsoft Windows SDK C/C++ compiler. The reason behind this move away from GCC is that true 64bit support became necessary. In order to use GCC for 64bit compilation on Windows, plain MinGW is not enough; a Cygwin environment with a 64bit port of MinGW becomes necessary. Requiring the use of Cygwin not only complicates the compilation process for us, but for customers as well. The current solution to this problem is to use the Microsoft Windows SDK C/C++ compiler. The SDK provides an easy way to setup the correct build environment for 64bit or 32bit, and also will use the correct C++ name mangling conventions for C++ libraries compiled with Visual Studio. Additionally, the compilation method is easily scriptable. 2 Install necessary Tools The Microsoft Windows SDK (at least v7.1 is recommended) is required to compile C programs against the SpinAPI library, or other SpinCore API packages. The Windows SDK can be found for free on Microsoft's MSDN website. 3 Setup Build Environment The Microsoft Windows SDK comes with a tool called \setenv.cmd". This is the tool that is used to setup the 64bit and 32bit build environments. It is found in the installation directory of the SDK under the \Bin" folder. If you would like to have this tool available at the command line without typing out the absolute path, you will need to add the \Bin" directory to the system's path variable.
    [Show full text]