Building XML Web Services for the Microsoft .NET Platform.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
Building XML Web Services for the Microsoft .NET Platform by Scott Short ISBN: 0735614067 Microsoft Press © 2002 (426 pages) Understand how to build robust, high-performing business solutions for the Web by exploiting protocols and tools such as SOAP, WSDL, UDDI, and XML. For OR Forum 1 Introduction............................................................................................................10 Whom This Book Is For.........................................................................................10 How This Book Is Organized...............................................................................10 If You Are in a Hurry...............................................................................................11 System Requirements ...........................................................................................11 The Companion CD................................................................................................12 Support........................................................................................................................12 Chapter 1: Why Web Services?........................................................14 Overview.....................................................................................................................14 Web Services Building Blocks ............................................................................16 Web Services Design Decisions........................................................................17 Choosing Transport Protocols...............................................................................17 Choosing an Encoding Scheme............................................................................18 Choosing a Formatting Convention......................................................................18 Choosing Description Mechanisms......................................................................19 Choosing Discovery Mechanisms ........................................................................20 What’s Missing from Web Services?................................................................20 Summary ....................................................................................................................20 Chapter 2: Creating a Basic Web Service..............................22 Overview.....................................................................................................................22 A Simple Commerce Application.......................................................................22 Creating a Web Form .............................................................................................22 Creating a Payment Web Service........................................................................25 Updating the Order Web Form..............................................................................27 The Web File Share Application ........................................................................29 Creating the WebFileShare Web Service............................................................29 Creating the WebFileUtil Program ........................................................................31 Summary ....................................................................................................................35 Chapter 3: SOAP.............................................................................................37 Overview.....................................................................................................................37 Anatomy of a SOAP Message ............................................................................38 SOAP Actors ............................................................................................................39 The Header Element...............................................................................................39 The Body Element...................................................................................................42 Using SOAP RPC Messages..............................................................................44 SOAP Encoding.......................................................................................................46 Simple Types ...........................................................................................................47 Compound Types ....................................................................................................47 Passing Parameters by Reference.......................................................................55 Protocol Binding.......................................................................................................61 2 Summary ....................................................................................................................63 Chapter 4: XML Schema ..........................................................................64 Overview.....................................................................................................................64 Describing XML Documents................................................................................65 Built-In Datatypes ....................................................................................................66 Integers.....................................................................................................................67 Strings .......................................................................................................................67 Binary Data...............................................................................................................68 Namespaces.............................................................................................................70 targetNamespace Attribute ....................................................................................70 xmlns Attribute.........................................................................................................71 schemaLocation Attribute......................................................................................73 noNamespaceSchemaLocation Attribute............................................................74 XML Schema and XML Schema Instance Namespaces ..................................74 Element Definitions.................................................................................................75 Custom Datatypes...................................................................................................75 Simple Types ...........................................................................................................76 Complex Types ........................................................................................................81 Element and Attribute Groups...............................................................................88 Namespace Scoping...............................................................................................89 Polymorphism ..........................................................................................................91 Restricting Inheritance............................................................................................95 Summary ....................................................................................................................97 Chapter 5: Using WSDL to Document Web Services ..........................................................................................................................................100 Overview...................................................................................................................100 WSDL Document Syntax....................................................................................100 definitions Element................................................................................................101 types Element ........................................................................................................102 message Element..................................................................................................104 portType Element ..................................................................................................106 binding Element.....................................................................................................108 service Element.....................................................................................................110 Extensibility Elements ...........................................................................................111 SOAP Extensions ..................................................................................................111 HTTP GET/POST Extensions .............................................................................115 import Element.......................................................................................................121 Documentation.......................................................................................................122 The Calculator Web Service WSDL Document..........................................123 Summary ..................................................................................................................128 Chapter 6: ASP.NET..................................................................................130 Overview...................................................................................................................130