Table Of Contentwww.it-ebooks.info
Microsoft Windows
Server AppFabric
Cookbook
60 recipes for getting the most out of WCF and WF
services, including the latest capabilities in AppFabric 1.1
for Windows Server
Hammad Rajjoub
Rick G. Garibay
professional expertise distilled
P U B L I S H I N G
BIRMINGHAM - MUMBAI
www.it-ebooks.info
Microsoft Windows Server
AppFabric Cookbook
Copyright © 2012 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, without the prior written permission of the publisher,
except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the
information presented. However, the information contained in this book is sold without
warranty, either express or implied. Neither the authors, nor Packt Publishing, and its dealers
and distributors will be held liable for any damages caused or alleged to be caused directly or
indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies
and products mentioned in this book by the appropriate use of capitals. However, Packt
Publishing cannot guarantee the accuracy of this information.
First published: July 2012
Production Reference: 1190712
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-84968-418-7
www.packtpub.com
Cover Image by Artie Ng (artherng@yahoo.com.au)
www.it-ebooks.info
Credits
Authors Project Coordinator
Hammad Rajjoub Joel Goveya
Rick G. Garibay
Proofreader
Reviewers Aaron Nash
Adnan Masood
Indexer
Zubair Ahmed
Hemangini Bari
Alvin Lau
Graphics
Acquisition Editors
Valentine D'silva
Sarah Cullington
Manu Joseph
Kerry George
Production Coordinator
Lead Technical Editor
Nilesh R. Mohite
Azharuddin Sheikh
Cover Work
Technical Editors
Nilesh R. Mohite
Joyslita D'Souza
Unnati Shah
www.it-ebooks.info
www.it-ebooks.info
Foreword
Have you ever set foot in the kitchen with a certain hunger and found that you had no clue
as to how to make that dish? At such a time a cookbook is a wonderful thing. That's why I
appreciate this concept of a cookbook for workflows and services. At Microsoft when we build
products they are often chocked full of little known but wonderful capabilities and guys like
Hammad and Rick are just the sort of chefs that have what it takes to make you successful
with it. AppFabric brings some terrific capabilities to Windows Server and IIS with distributed
caching and terrific hosting features for WCF Services and WCF Workflow Services at no
additional cost, so using it is a no-brainer but maximizing it will take the kind of insight you will
find in this book. So break out the mixing bowls, spatulas, and turn on the oven… I can almost
smell success from here.
Ron Jacobs
Senior Program Manager, Microsoft Corporation
www.it-ebooks.info
About the Authors
Hammad Rajjoub works as an Architect Evangelist with Microsoft. Before joining
Microsoft, he was awarded Microsoft's Most Valuable Professional award, seven years in a
row. Along with being an MVP he was also a Microsoft Business Platform Technology Advisor.
Being an MVP in Connected Systems gave him early access to Windows Communication
Foundation, Windows Workflow Foundation, as well as Windows Server AppFabric. In his
previous roles he has been a CTO at a technology startup, Vice President at one of the largest
financial institutions, as well as a Solutions Architect at a leading consulting company.
He has over a decade of experience using Microsoft Technologies, especially .NET since its
beta 1 release. He is a published author and a frequent speaker at technology conferences
(including TechEd and Cloud Computing Asia). He has founded a number of developer and
architect communities over the years and remains a passionate speaker and contributor at
local technical communities in Singapore. He is also an active member of the International
Association of Software Architects (IASA) - Singapore Chapter. His areas of interest include
Cloud Computing, Enterprise Architecture, Design Patterns, and Quantum Computation.
At home he is a busy husband and father of twin girls and a baby boy. For more details visit
his website at http://www.hammadrajjoub.net or on twitter: @hammadrajjoub.
Alhamdulillah - This work would not have been possible without the help
and support from my family. Special thanks to my mother Noor and my wife
Iman for being supportive and giving me time and help to complete this
book. I would also like to express my gratitude to my friend and co-author
of this book, Rick Garibay, for accepting my invitation to co-author this book
and sharing his feedback throughout the lifecycle of this book. Also, special
thanks to Adnan Masood, Zubair Ahmed, and Alvin Lau for technically
reviewing the book, providing feedback, and correcting numerous mistakes.
Last but not the least, thanks to the editorial and project team at Packt
Publishing for giving me the opportunity to write this book, and also being
patient and understanding through the process of writes, re-writes, technical
edits, as well as cases of missed deadlines.
www.it-ebooks.info
Rick G. Garibay is a developer, architect, speaker, and author on distributed technologies
and is the General Manager of the national Connected Systems Practice at Neudesic. With
over 13 years' experience delivering distributed solutions across industry sectors such as
finance, transportation, hospitality, and gaming, he specializes in distributed technologies
such as Microsoft .NET, Windows Communication Foundation, Workflow Foundation, and
Windows Azure to help his clients deliver business value and drive revenue while reducing
operational costs.
As a five-time Microsoft Connected Systems MVP, he is an active speaker, writer, and
passionate community advocate and is the Co-Founder of the Phoenix Connected Systems
User Group (pcsug.org), celebrating four years in operation. He serves as an advisor to
Microsoft in a number of roles as a member of the Microsoft Application Platform Partner
Advisory Council and long-time member of the Business Platform Advisors and Azure
Technology Advisors groups.
Recent presentations include talks at the Microsoft SOA and Business Process Conference,
Microsoft TechEd, Dev Connections, .NET Rocks, Desert Code Camp, and numerous Microsoft
events and user groups throughout North America. He is a frequent contributor to industry
publications such as CODE Magazine and maintains a blog at http://rickgaribay.net.
You can catch up with Rick on Twitter @rickggaribay.
I would like to thank my loving, patient, and amazing wife Christie for being
my rock and providing a foundation which has allowed us to grow a beautiful
family while enduring the sometimes overbearing demands of my career.
I'm also grateful to my wonderful children, Sarah and Ricky for tolerating
the many lost nights and weekends holed up in my home office working
on this book.
I would also like to thank Mickey Williams, VP Technology Platform Group
at Neudesic for his support in taking on this project along with his words
of encouragement and (always timely) sense of humor along the way.
Last but not least, I would like to thank my friend and co-author, Hammad
Rajjoub for inviting me to participate in this project and trusting me to help
carry out his vision for this book. Hammad and I both share a labor of love
as it applies to the Microsoft distributed technology stack affectionately (and
somewhat nostalgically) known as "Connected Systems" and this book is
both a reflection and an acknowledgment of the tremendous work the WCF,
WF, and Dublin teams have done in putting these tremendous capabilities
within reach of developers tasked with solving tough distributed challenges
today.
www.it-ebooks.info
About the Reviewers
Adnan Masood is a Software Engineer and Architect with zeal for solving interesting
algorithmic, business, and technology problems. With special interest in scalable
architectures, algorithm design, application security, and software development, he has over
a decade of hands-on experience in financial services and application service providers.
He currently works as a System Architect for Green Dot Corporation, a leading pre-paid
financial institution where he develops robust, scalable, and secure SOA based middle-tier
architectures, distributed systems, and web applications. He is a Microsoft Certified Trainer
and holds various technical certifications including MCPD (Enterprise Developer), MCSD .NET,
and SCJP-II. He is attributed and published in print media and on the Web; he also taught
Windows Communication Foundation (WCF) courses at the University of California, San Diego.
He regularly presents at local code camps and user groups. He is actively involved in the .NET
community as Co-founder and President of the of San Gabriel Valley .NET Developers group
and recipient of the INETA Community Champion Award for contributions to the developer
community in Southern California.
He holds a Master's degree in Computer Science and is currently pursuing a doctorate in
Machine Learning; specifically interestingness measures in outliers using belief networks.
He also holds systems architecture certification from MIT and SOA Migration, Adoption,
and Reuse Technique certificate from SEI, Carnegie Melon University. He can be reached at
adnan@nova.edu.
Alhamdullilah - Thanks to my family for their constant support during the
process of editing this book. I would also like to thank Hammad for the
opportunity and both Hammad and Rick for putting up with my feedback
and tech edits. Last but not least, thank you Joel for your great project
coordination skills.
www.it-ebooks.info
Zubair Ahmed is an experienced software developer, blogger, and technical presenter. His
interests include software architecture, improving code quality, and keeping an eye on the
latest technologies. He works as a Software Consultant for Infusion Development in Dubai.
When he is not working he likes to spend time in front of his large monitor at home writing
some code, go for long drives with his wife, or socialize with friends.
His technical blog is at zubairahmed.net and his tweet handle is @zubairdotnet.
For technology updates, subscribe to his Facebook page at
http://facebook.com/zubair.ahmed.public.
www.it-ebooks.info