ptg Praise for this Book “This compendium is the new bible for WS-* design and SOA. The structured approach allows beginners, experts and executives to understand and execute successfully on an SOA Strategy. Thomas Erl and his team did once again a great job.” —Sascha Kuhlmann Global Program Lead Enterprise Architecture, SAP “A first-rate and in-depth dive into service contract and interface design that elaborates on the best book in the field, SOA Principles of Service Design. Over the years Thomas’s books have provided a foundation for defining our SOA standards (for over 200 serv- ices) and contain the latest material and case studies which comprise the singular most important advice for those implementing large-scale SOAs.” —Bob Hathaway Senior SOA Architect SOA Object Systems, Starwood Hotels ptg “Anyone tasked with publishing and evolving Web services ‘contract first’ will welcome this book, packed full of authoritative explanations and advice from authors who truly understand their subject.” —Paul Downey Chief Web Services Architect, BT “This book is an excellent resource for anybody trying to get a comprehensive under- standing of the technical foundation of Web services based service-oriented architecture. It is written by the experts who have worked on the development of the underlying world-wide standards.” —Michael Bechauf Vice President of Standards Strategy and Developer Programs, SAP AG From the Library of WoweBook.Com “This book is a great guide to designing Web service contracts. All aspects of contract design one encounters in real-life SOA projects are described clearly and in detail by the authors. Whether it concerns namespaces, versioning mechanisms, schemas or policies, this book tells you how to deal with them. “An absolute must-read for every architect and developer involved in SOA projects.” —Linda Terlouw Solution Architect, Ordina Researcher, Delft University of Technology “Web Service Contract Design and Versioning for SOA is a clear, authoritative, and inte- grated treatment of the five W3C specifications that form the core of classic Web service description: XML Schema, SOAP, WSDL, WS-Policy, and WS-Addressing. Its authors include committee members who developed these specifications as well as recognized experts in this field. “This book is both an excellent starting point for developers who are seeking to acquire Web service design skills and a reference for experienced designers who want to under- ptg stand the finer points of this topic. The advanced material on designing flexible message formats and on versioning contracts is especially relevant for building Web services that can evolve gracefully over time.” —Arthur Ryman Distinguished Engineer, IBM “While service-orientation is delivering on its promises in many organizations, service contracts must withstand the evolution of maturing service-oriented enterprises. The expert design advice in this work enables enterprise architects to build flexibility into service interfaces and meet the needs of the dynamic modern technology organization. “From WSDL and schema design to advanced WS-Policy and WS-Addressing, the authors simplify complex topics through practical, plain-English examples that will benefit anyone responsible for service design and delivery.” —Kevin P. Davis, Ph. D. Software Architect From the Library of WoweBook.Com Web Service Contract Design and Versioning for SOA ptg From the Library of WoweBook.Com ptg The Prentice Hall Service-Oriented Computing Series from Thomas Erl aims to provide the IT industry with a consistent level of unbiased, practical, and comprehensive guidance and instruction in the areas of service-oriented architecture, service-orientation, and the expanding landscape that is shaping the real-world service-oriented computing platform. For more information, visit www.soabooks.com. From the Library of WoweBook.Com Web Service Contract Design and Versioning for SOA Thomas Erl, Anish Karmarkar, Priscilla Walmsley, Hugo Haas, Umit Yalcinalp, Canyang Kevin Liu, David Orchard, Andre Tost, James Pasley ptg PRENTICE HALL UPPER SADDLE RIVER, NJ • BOSTON • INDIANAPOLIS • SAN FRANCISCO NEW YORK • TORONTO • MONTREAL • LONDON • MUNICH • PARIS • MADRID CAPETOWN • SYDNEY • TOKYO • SINGAPORE • MEXICO CITY From the Library of WoweBook.Com Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this Editor-in-Chief book, and the publisher was aware of a trademark claim, the designations have Mark Taub been printed with initial capital letters or in all capitals. Managing Editor The authors and publisher have taken care in the preparation of this book, but Kristy Hart make no expressed or implied warranty of any kind and assume no responsibil- ity for errors or omissions. No liability is assumed for incidental or consequen- Copy Editor tial damages in connection with or arising out of the use of the information or Language Logistics programs contained herein. Development Editors The publisher offers excellent discounts on this book when ordered in quantity Dmitry Kirsanov for bulk purchases or special sales, which may include electronic versions Songlin Qiu and/or custom covers and content particular to your business, training goals, marketing focus, and branding interests. For more information, please contact: Indexer U.S. Corporate and Government Sales Cheryl Lenser (800) 382-3419 [email protected] Proofreader Williams Woods Publishing For sales outside the United States please contact: International Sales Composition [email protected] Jake McFarland Visit us on the Web: www.informit.com/ph Bumpy Design Library of Congress Cataloging-in-Publication Data: Graphics Web service contract design and versioning for SOA / Thomas Erl ... [et al.]. Zuzana Cappova Tami Young p. cm. ISBN 0-13-613517-X (hbk. : alk. paper) 1. Web services. 2. Computer network Photos architectures. 3. Computer architecture. I. Erl, Thomas. II. Title: Web service Thomas Erl ptg contract design and versioning for Service Oriented Architecture. Johan Odendaal TK5105.88813.E76 2008 006.7’8—dc22 2008025188 Copyright © 2009 SOA Systems Inc. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and per- mission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to: Pearson Education, Inc. Rights and Contracts Department 501 Boylston Street, Suite 900 Boston, MA 02116 Fax (617) 671 3447 ISBN-13: 978-0-13-613517-3 ISBN-10: 0-13-613517-X Text printed in the United States on recycled paper at R.R. Donnelley in Crawfordsville, Indiana. First printing September 2008 From the Library of WoweBook.Com “To my family for their continuing support.” – Thomas Erl “Dedicated to my family: Aai,Baba,Chetan,Swati,Sidsel,and Leena. For making it possible and for making everything worthwhile.” – Anish Karmarkar “To Doug,with love” – Priscilla Walmsley “To my wife,Nicole,for her endless support.” – Hugo Haas “To my sister,Isik Boran.” – Umit Yalcinap ptg “To my children,Julia and Mark,who have made my life meaningful.” – Canyang Kevin Liu “I want to thank my wife Silke and my sons Marc and Jonas for their constant help,support and understanding,not just with this project but with so many others throughout the years.” – Andre Tost “To my wife Patricia and our children Rebecca,James,Robert,Hannah and Alyssa.” – James Pasley From the Library of WoweBook.Com This page intentionally left blank ptg From the Library of WoweBook.Com Contents Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxv Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxxvii CHAPTER 1: Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.1 About this Book. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 1.2 Objectives of this Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 ptg 1.3 Who this Book is For . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.4 What this Book Does Not Cover . . . . . . . . . . . . . . . . . . . . . . 4 1.5 Prerequisite Reading. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 1.6 Supplementary Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 1.7 How this Book is Organized . . . . . . . . . . . . . . . . . . . . . . . . . 6 Part I: Fundamental Service Contract Design. . . . . . . . . . . . . . . . . 6 Chapter 3: SOA Fundamentals and Web Service Contracts . . . . . . . . . 6 Chapter 4: Anatomy of a Web Service Contract. . . . . . . . . . . . . . . . . . . 7 Chapter 5: A Plain English Guide to Namespaces. . . . . . . . . . . . . . . . . 7 Chapter 6: Fundamental XML Schema: Types and Message Structure Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Chapter 7: Fundamental WSDL Part I: Abstract Description Design . . . 8 Chapter 8: Fundamental WSDL Part II: Concrete Description Design . . 8 Chapter 9: Fundamental WSDL 2.0: New Features and Design Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8 Chapter 10: Fundamental WS-Policy: Expression, Assertion, and Attachment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Chapter 11: Fundamental Message Design: SOAP Envelope Structure and Header Block Processing . . . . . . . . . . . . . . . . . . . . . . . . 9 From the Library of WoweBook.Com