| Introduction | xiii |
| 1 Why Web Services? | 1 |
| Web Services Building Blocks | 4 |
| Web Services Design Decisions | 5 |
| Choosing Transport Protocols | 5 |
| Choosing an Encoding Scheme | 6 |
| Choosing a Formatting Convention | 7 |
| Choosing Description Mechanisms | 8 |
| Choosing Discovery Mechanisms | 9 |
| What's Missing from Web Services? | 9 |
| Summary | 10 |
| 2 Creating a Basic Web Service | 11 |
| A Simple Commerce Application | 12 |
| Creating a Web Form | 12 |
| Creating a Payment Web Service | 15 |
| Updating the Order Web Form | 17 |
| The Web File Share Application | 19 |
| Creating the WebFileShare Web Service | 19 |
| Creating the WebFileUtil Program | 21 |
| Summary | 26 |
| 3 SOAP | 29 |
| Anatomy of a SOAP Message | 31 |
| SOAP Actors | 32 |
| The Header Element | 32 |
| The Body Element | 36 |
| Using SOAP RPC Messages | 38 |
| SOAP Encoding | 41 |
| Simple Types | 41 |
| Compound Types | 41 |
| Passing Parameters by Reference | 49 |
| Protocol Binding | 54 |
| Summary | 56 |
| 4 XML Schema | 59 |
| Describing XML Documents | 60 |
| Built-In Datatypes | 62 |
| Integers | 63 |
| Strings | 63 |
| Binary Data | 65 |
| Namespaces | 67 |
| targetNamespace Attribute | 67 |
| xmlns Attribute | 68 |
| schemaLocation Attribute | 70 |
| noNamespaceSchemaLocation Attribute | 71 |
| XML Schema and XML Schema Instance Namespaces | 72 |
| Element Definitions | 72 |
| Custom Datatypes | 73 |
| Simple Types | 73 |
| Complex Types | 78 |
| Element and Attribute Groups | 86 |
| Namespace Scoping | 86 |
| Polymorphism | 89 |
| Restricting Inheritance | 92 |
| Summary | 95 |
| 5 Using WSDL to Document Web Services | 97 |
| WSDL Document Syntax | 98 |
| definitions Element | 99 |
| types Element | 100 |
| message Element | 102 |
| portType Element | 104 |
| binding Element | 106 |
| service Element | 108 |
| Extensibility Elements | 109 |
| SOAP Extensions | 109 |
| HTTP GET/POST Extensions | 113 |
| import Element | 120 |
| Documentation | 120 |
| The Calculator Web Service WSDL Document | 121 |
| Summary | 125 |
| 6 ASP.NET | 127 |
| Creating an ASP.NET Web Service | 128 |
| Transport Protocols and Bindings | 134 |
| Web Service Documentation | 136 |
| Raising Errors | 140 |
| SOAP Encoding Styles | 143 |
| Encoding References | 146 |
| Interface Inheritance | 150 |
| Managing State | 155 |
| Session State | 155 |
| Application State | 160 |
| Defining and Processing SOAP Headers | 165 |
| Processing Unknown Headers | 172 |
| Using SOAP Extensions | 173 |
| SOAP Extension Attributes | 174 |
| SOAP Extension Class | 176 |
| Using the WSDL Utility to Generate Proxy Code | 190 |
| Proxy Class | 192 |
| Cookies | 201 |
| Summary | 202 |
| 7 XML Serialization | 205 |
| Controlling XML Serialization | 206 |
| Defining the Root PurchaseOrder Datatype | 207 |
| Defining the Items Array | 214 |
| Creating Derived Datatypes | 220 |
| Creating an Open PurchaseOrder Schema | 221 |
| Defining the AcceptPO Web Method | 223 |
| Server-Side Validation | 224 |
| Implementing Custom Serialization | 225 |
| Summary | 226 |
| 8 Using Remoting to Build and Consume Web Services | 227 |
| Remoting vs. ASP.NET | 227 |
| The Grabber.NET Application | 229 |
| Remoting Architecture | 230 |
| Creating an IIS-Hosted Web Service | 232 |
| Creating a WinForm-Hosted Web Service | 236 |
| Accessing Web Services | 241 |
| Adding SOAP Headers | 247 |
| Generating WSDL | 250 |
| Suds WSDL Extension Elements | 251 |
| Summary | 252 |
| 9 Discovery Mechanisms for Web Services | 255 |
| UDDI | 256 |
| UDDI Architecture | 256 |
| UDDI API | 257 |
| UDDI SDK | 260 |
| UDDI Enterprise Server | 261 |
| Registering the Purchaser | 262 |
| Registering the Supplier | 277 |
| Visual Studio .NET Integration | 282 |
| DISCO | 284 |
| Visual Studio .NET and DISCO | 285 |
| Summary | 287 |
| 10 Building Secure Web Services | 289 |
| An Introduction to Threat Modeling | 289 |
| Brainstorming Threats | 290 |
| Choosing Techniques to Mitigate the Threats | 292 |
| Web Service Security Technologies | 295 |
| Web Services Authentication | 296 |
| Web Services Authorization | 301 |
| Web Services Privacy and Integrity | 302 |
| Security Technologies in the .NET Framework | 304 |
| Future Web Service Security Technologies | 306 |
| Common Security Mistakes | 306 |
| Mistake #1: Storing Secret Data Insecurely | 307 |
| Mistake #2: Connecting to SQL Server Incorrectly | 308 |
| Mistake #3: Building Insecure SQL Strings | 309 |
| An In-Depth Example | 309 |
| The Insecure Version (Do Not Try This at Home!) | 309 |
| A Secure Solution | 311 |
| Summary | 313 |
| 11 Debugging Web Services | 315 |
| Interactive Debugging | 315 |
| The Basics of Debugging | 316 |
| Remote Debugging | 317 |
| Web Services-Friendly Call Stack | 318 |
| Information the Debugger Needs | 320 |
| Assembly Metadata | 320 |
| Program Database | 321 |
| Tracking Information | 322 |
| Debugging Dynamically Compiled Source Code | 325 |
| Instrumenting Web Services | 326 |
| Tracing | 326 |
| Event Log | 336 |
| Performance Counters | 338 |
| Tips and Tricks for Debugging | 343 |
| Summary | 344 |
| 12 Scalability and Availability | 347 |
| Scaling Your Web Service | 348 |
| Scaling Up | 348 |
| Scaling Out | 349 |
| Overcoming Scalability Bottlenecks | 353 |
| Maintaining High Availability | 354 |
| Highly Available Scale-Up Resources | 355 |
| Highly Available Scale-Out Resources | 357 |
| Programming Against a Highly Available Resource | 358 |
| Third-Party Web Services and Availability | 359 |
| Failing Over to an Alternative Web Service | 360 |
| Creating an Offline Mode of Operation | 363 |
| Optimizing Performance | 364 |
| Caching | 365 |
| Summary | 372 |
| 13 The Future of Web Services | 373 |
| Introducing .NET My Services | 374 |
| Securing .NET My Services | 377 |
| Working with .NET My Services | 378 |
| The Global XML Web Services Architecture (GXA) | 382 |
| WS-Inspection | 384 |
| WS-Security and WS-License | 387 |
| WS-Routing | 393 |
| WS-Referral | 396 |
| WS-Referral Registration Message Exchange | 398 |
| Dynamic Application Topologies | 399 |
| Orchestrating Web Services | 400 |
| Summary | 405 |
| APPENDIX XML Schema Built-In Types | 407 |
| INDEX | 411 |