HAPPY BOOKSGIVING
Use code BOOKSGIVING during checkout to save 40%-55% on books and eBooks. Shop now.
Register your product to gain access to bonus material or receive a coupon.
"You are holding in your hands my favorite book on Web services and .NET. What else can I say? Buy this book now, and be prepared for a new way of coding!"
—Keith Ballinger, Program Manager for XML Web Services, Microsoft
"If you've been searching for a book that goes beyond the Web services hype, and distills the benefits of the actual platform, look no further, you've found the right one."
—Aaron Skonnard, Instructor and Author, DevelopMentor
Real World XML Web Services is the Visual Basic programmer's definitive guide to designing and building Web services. It provides developers with a comprehensive understanding of Web services, covering everything from basic concepts and solutions to interoperability problems. This book begins with a concise and practical introduction to Web services and the foundation on which they are built, including Web Services Description Language (WSDL) and Simple Object Access Protocol (SOAP). Readers learn, by example, how to use each tool for developing Web services, starting with the SOAP Toolkit and the .NET framework.
Visual Basic programmers discover how to:
The book closes by walking the reader through the creation of a Web service with .NET and Visual Basic 6 clients. Real World XML Web Services empowers Visual Basic programmers to design and build the next generation of applications using Web services.
.NET Web Services: Interface-Based Web Service Development
Click below for Sample Chapter(s) related to this title:
Sample Chapter
8
Foreword by Keith Ballinger.
Foreword by Aaron Skonnard
Preface.
Acknowledgments.
1 Introduction to Web Services.
Distributed Applications and the Browser.
Interoperability.
What Are Web Services.
The New Platform.
XML and XSD.
SOAP.
WSDL.
Typical Web Service Architecture.
Remote Procedure Calls versus Messaging.
Creating Web Services.
Using the SOAP Toolkit.
Using.NET.
When to Use Web Services.
Communicating through a Firewall.
Application Integration.
Business to Business Integration.
Software Reuse.
When Not to Use Web Services.
Single Machine Applications.
Homogenous Applications on a LAN.
Summary.
Why A Type System.
What Is XSD.
The XSD Type System.
Authoring XSD Schemas.
Declaring Elements.
Defining Simple Types.
Defining Complex Types.
Declaring Attributes.
Simple Content.
Mixed Content.
Empty Elements.
Anonymous Types.
XSD and XML Namespaces
A Quick Introduction to XML Namespaces.
Namespaces in Instance Documents.
XSD Types and Namespaces.
Validating with XSD.
Programmatic Validation.
Type Substitution.
Nil Values.
Uniqueness and Keys.
Object Serialization.
How Serialization Works.
Schemas and XML Serialization.
Overriding Serialization Attributes.
Inheritance, Interfaces and Serialization.
XML Serialization and Remoting.
Summary.
Resources.
Specifications.
What Is SOAP.
SOAP Architecture.
The SOAP Message.
SOAP Message Formats.
Messaging with SOAP.
SOAP over HTTP.
Capturing SOAP Messages.
The Web Service.
The Client.
RPC with SOAP.
Section 5 Encoding.
When Things Go Wrong.
<faultCode>.
<faultString>.
<detail>.
Communicating Error Information.
Extending SOAP.
Handling Binary Data.
Base64 Encoding.
SOAP with Attachments.
A Simple Solution.
Summary.
Resources.
Specifications.
Why Describe Web Services.
WSDL overview.
A WSDL Example.
WSDL SOAP Binding.
Document/Literal.
RPC/Encoded.
SOAP Header.
SOAP Fault.
Using WSDL Documents.
Product Checker.
The Weather Service.
Quote of the Day.
Other WSDL Features.
Documenting Your WSDL.
WSDL Imports.
Extending WSDL.
WSDL Operations.
HTTP Binding.
MIME Binding.
Summary.
Resources.
Toolkit API Architecture.
Exposing Web Services.
Using the High-Level API.
Exposing Web Services.
Invoking Web Services.
Error Handling.
Troubleshooting with the Trace Utility.
Using High-Level API From Classic ASP.
Serialization in the High-Level API.
Generic Type Mapper.
User-Defined Data Type Mapper.
Custom Type Mappers.
Complex Types as IXMLDOMNodeList.
Implementing Header Handlers.
Exposing Services with Headers.
Invoking Services with Headers.
Using the Low Level API.
Exposing Services with Low-Level API.
Invoking Services with the Low Level API.
The ISAPI Listener.
Tweaking the ISAPI Listener.
Summary.
Resources.
Creating Web Services with VS.NET.
Creating A Web Service.
Invoking Web Services with Visual Studio.NET.
Using an HTTP Proxy.
Leveraging the ASP.NET Framework.
Using ASP.NET Sessions.
Enabling Output Caching.
Using Data Caching.
Distributed transactions.
Customizing the Service's WSDL.
Disabling Protocols.
Names and Namespaces.
Controlling SOAP Message Style.
Parameter Encoding.
One-Way Operations.
Ignoring/Specifying SOAP Action.
Understanding Web Service Clients.
Summary.
Resources.
Defining SOAP Headers.
Using Headers on the Service.
Using Headers on the Client.
Mystery Headers.
You Must Understand This.
Communicating Errors.
Summary.
Resources.
Defining Interfaces.
Implementing an Interface.
Implementing Multiple Interfaces.
Interfaces In Different Namespaces.
Programming against Interfaces.
Choosing Implementations At Runtime.
Summary.
Resources.
Serialization and Web Services.
Starting with a Relational Database.
Typed DataSets.
Nested Elements.
Round-Triping DataSets.
Starting with A Schema.
DataSets from Schemas.
Typed DataSets from Schemas.
Handling XML Documents.
Handling Object Arrays.
Summary.
Resources.
Web Service Request Processing.
Extending Web Service Request Processing.
SOAP Extension Processing.
Per-Instance Initialization.
Applying SOAP Extensions.
Applying SOAP Extensions with CLR Attributes.
Per-Service Initialization.
Per-Method Initialization.
Modifying Message Streams.
SOAP Extension Lifetime Summary.
Client-Side SOAP Extensions.
Authorization SOAP Extension.
Database Schema.
Overall Architecture.
LogOn/LogOff and Permissions Checking.
Using SOAP Headers.
The Authorization SOAP Extension.
Using The SOAP Extension.
Usage Accounting.
Using The Thread Pool.
An Example Client.
A Compression SOAP Extension.
Summary.
Resources.
What Is UDDI.
What UDDI Is Made Of.
UDDI Specifications.
UDDI Operators.
UDDI Registrars.
Private Implementations.
UDDI Usage Scenarios.
Finding Closest Business.
The Invocation Pattern.
Finding Trading Partners' Services.
Registering Services.
Publish/Subscribe Pattern.
Main Data Structures.
businessEntity.
businessService.
bindingTemplate.
tModel.
tModels as Service Types.
tModel as Meta data.
tModelInstanceInfo.
publisherAssertion.
A Real-World Example.
How Categorization Works.
How Identifiers Work.
WSDL and UDDI.
WSDL in UDDI Best Practices View.
Visual Studio .NET and UDDI.
Add Web Reference Dialog.
Getting Services to Appear in the Add Web Reference Dialog.
Searching UDDI from the Start Page.
Programming UDDI.
UDDI Message Types.
A UDDI API Learning Aid.
Querying UDDI.
Finding a Business by Name.
Finding Businesses by Categories.
Finding Service Interfaces.
Finding Businesses by Service Interface.
Finding Services by Name.
Getting Service Details.
Publishing Your Web Services with UDDI.
UDDI Security.
Publishing a Service Interface.
Publishing a Business.
Publishing a Service.
Specifying Business Relations.
An Inquiry Example.
Choosing Services That Implement a Specific Interface.
Using the UDDI SDK.
Private UDDI Implementations.
Windows.NET Server.
Summary.
Resources.
Defining INTEROP.
INTEROP Problems.
HTTP.
WSDL.
SOAP.
INTEROP Efforts.
PocketSOAP Clients.
RPC/Encoded Messages with PocketSOAP.
Document/Literal Messages with PocketSOAP.
JAVA Clients.
IBM's Web Services Toolkit.
RPC/Encoded Messages.
Document/Literal Messages.
The Web Service Behavior.
Setting Up the Behavior.
Invoking Web Services.
Handling Complex Types.
VB 6 Clients.
.NET Clients.
Bad WSDL, No Problem.
Deeper Issues.
Summary.
Resources.
Introduction and Requirements.
Designing Web Service Messages.
Implementing the Service.
Generating Classes from Complex Types.
Writing the Service Code.
Getting Weather Information.
LogOn and LogOff.
The RequestElement-Bare Dilemma.
Authentication and Authorization.
Usage Accounting.
Customizing the Documentation Page.
A VB 6 Client.
Leveraging UDDI.
Implementing the Invocation Pattern.
Summary.
Resources.
Use Document/Literal SOAP Messages For Data Exchange.
Design Messages Not Methods.
Use an HTTP Proxy Tool For Troubleshooting.
Use Output and Data Caching.
Don't Use HTTP Cookies.
Use SOAP Headers for Session Management.
Use RequestElement Routing.
Use One-Way Operations.
Don't Implement Properties On Web Services.
Use Distributed Transactions Only If You Need Them.
Don't Re-Invent the Wheel.
There's no doubt that the Web was a catalyst for a revolution that changed the lives of software developers and end users alike. Web services provide the foundation for another profound revolution in the way we build and use applications. It is up to developers like you and I to take this foundation and make the revolution happen. With this book, I aim to give you the information and insight you need to design and build next generation distributed interoperable applications with Web services.
My treatment of Web services in this book is divided in two sections: The first four chapters explain the architectural foundation on which Web services are built. The remaining eight chapters explain the tools you use to build Web services including the SOAP toolkit and the .NET framework.
Intended AudienceThis book is intended for experienced developers who have little or now experience with Web services. The book assumes you have programmed with VB 6, classic ASP, and VB .NET. It assumes you understand the fundamentals of Web application development and have a basic understanding of XML documents and the XML Document Object Model (XML DOM). This book is not for developers who have no .NET knowledge or experience.
A Live BookThe world of Web services is changing rapidly. There are new standards being defined every month and new implementations of those standards are being released on a hectic schedule. It is impossible for a traditional printed book to keep up with this rapid pace of change. When I set out to write this book, I decided to combine the print version with an online version that will be maintained and kept up-to-date with the standards.
As an owner of a print copy of this book, you have access to the online version of this book including all the new content being added as standards emerge and tools change. Please make sure you take a look at what's new online at http://www.LearnXmlws.com/book.
To start things off I explain what Web services are and the scenarios where they prove useful. I also show you how to create Web services with .NET and with the SOAP Toolkit. The idea is to give you a head start on creating and invoking Web services before digging into the details.
This is the first of three chapters that cover the fundamentals of Web services. This chapter explains the syntax and usage of XML Schemas and shows examples of validating schemas using VB .NET and VB 6. the chapter also covers XML Serialization and shows examples of shaping the XML generated by the .NET XML Serializer.
Having understood schemas, this chapter explains SOAP, the Web services protocol. It explains how you can use SOAP for messaging as well as Remote Procedure Calls (RPC). It also shows you how to communicate error information to SOAP clients and the built-in mechanism for extending SOAP.
This chapter completes the fundamentals by explaining the Web Services Description Languages, WSDL. The chapter begins with an overview then goes into the details of WSDL documents. It shows you practical examples of writing and reading WSDL documents. While it's unlikely that you'll need to create WSDL documents form scratch, it is likely that you'll need to read them and possibly modify them.
Chapter 5 is the first of a series of chapters that cover the tools you use to build Web services. This entire chapter is dedicated to building Web services with the SOAP Toolkit. It shows you how to expose an existing COM component as a Web service using both the high-level and low-level APIs. It also explains how to handle SOAP headers and SOAP faults.
After learning the SOAP Toolkit, this chapter explains creating and invoking Web services using the .NET framework. Beyond the basics, this chapter shows you the various features provided by the .NET framework such as output caching, data caching, and SOAP message shaping. The last section of this chapter dives into the details of Web service clients explaining how Web service proxies work and how you can customize them.
This chapter builds on what you learned in chapters 3 and 6 and shows you how to implement SOAP headers with the .NET framework. It shows you how to create SOAP headers that must be understood by the Web service and how to process headers on the service. It also shows you how to use SOAP Fault to communicate rich error information between service and client.
This chapter explains the process of interface-based Web services development which is necessary for large-scale projects and useful even for smaller projects. The chapter goes through the steps of defining and implementing an interface then covers implementing multiple interfaces on one Web service.
When building real-world Web services, most of the problems you'll encounter will center on data. Whether you are sending or receiving data, you'll almost always need to decide the optimum format for this data and how to get it into this format. This chapter focuses on the mechanics of handling data in .NET Web services. The chapter is divided in sections covering ADO.NET DataSets, XML documents, custom objects and object arrays.
.NET provides an architecture for performing custom request/response processing at the SOAP message level via SOAP extensions. This chapter explains how SOAP extensions work and shows you three example SOAP extensions including one for compressing/decompressing SOAP messages.
This chapter explains the Universal Description, Discovery and Integration standards and demonstrates scenarions where UDDI is useful. The objective of this chapter is to open your mind to design patterns and usage scenarios that leverage Web services registries. Such registries will become commonplace within the intranet with future versions of Windows server.
Throughout the process of building and maintaining Web services you're likely to run into interoperability issues with other SOAP implementations. This chapter explains some of the more common SOAP toolkits including Apache SOAP and PocketSoap and shows you how they interoperate with .NET Web services.
To wrap things up, chapter 13 walks through the steps of building a .NET Web service with .NET and VB 6 clients. The chapter also covers registering the service with UDDI.
Yasser has written the first Web services book to break this trend. His book focuses on the Web services platform from the ground up. The book starts by introducing the fundamental Web services architecture and its core technology underpinnings, including XML 1.0, XML Schema, SOAP, WSDL, and UDDI. Yasser does a great job explaining not only how these technologies work, but also why they matter to a Web services developer grappling to understand the platform. Each chapter spotlights a core Web services technology centered on clear explanations, compelling examples, and most importantly, code.
Yasser's approach clarifies some common misconceptions about Web services design and helps to promote best practices that will prepare you for long-term success. As an example, he emphasizes that the Web services "interface" is the XML message on the wire, not the class definition one may work with to process the message in VB. Understanding this key distinction is crucial to understanding the rest of the Web services platform.
Not only is the book conceptually solid, it is also practical. The book is chock-full of examples illustrating how Microsoft's Web services implementations work in both the VB 6 (Microsoft SOAP Toolkit) and .NET environments. As you read through the prose and parse through the accompanying sample code, you're bound to experience the breakthrough epiphanies that make reading a technical book worthwhile.
If you've been searching for a book that goes beyond the Web services hype and distills the benefits of the actual platform; look no further, you've found the right one.
Aaron Skonnard
Instructor and Author, DevelopMentor
http://skonnard.com
Foreword by Keith Ballinger
You are holding in your hands my favorite book on Web services and .NET. Yasser
has done an outstanding job of pulling together an intelligent and well-thought-out
book that provides you with tons of practical information about Web services.
One of the things that always used to frustrate me when I read a Web services
book that cost more than five dollars was the apparent inexperience of the author,
which became clear after a month of trying to implement his suggestions. You
know what I'm talking about: wrong information about APIs, bone-headed architectural
recommendations that would never perform well, and sample code that is a security
hole. All that's the hard stuff.
With Yasser's book, I don't think you'll spend much time being frustrated; Yasser's covering the hard stuff and is also setting you up for success with this book. He's thought hard, written hard, and listened hard. Listened to whom? Well, to you. He's an active member of the developer community. He's also listened hard to me and the other members of Microsoft's development team.
What else can I say? Read his book, and be prepared for a new way of coding!
Keith Ballinger
Program Manager, XML Messaging
Microsoft
http://keithba.com
Click below to download the Index file related to this title:
Index