Get on the fast track of what is becoming a required skill for software developers--the ability to create Web Services and clients that consume them. Web Services leverage standards such as XML, XSD, SOAP, and WSDL to enable interoperability across programming languages and platforms. They work well to integrate applications on an intranet and on the Internet. Visual Basic .NET, coupled with the .NET Framework, is an attractive environment for Web Services architecture because it provides for rapid development and easy maintenance.
This book explains each of the standard protocols needed for Web Service interaction on the client or server. These protocols include SOAP, Web Services Description Language (WSDL), and Universal Description Discovery and Integration (UDDI).
Creating and Consuming Web Services in Visual Basic® also includes
(NOTE: Each chapter concludes with Summary.)
Applications of Web Services.
What You Will Need.
Who Is This Book For?
I. THE BASICS.1. Creating Your First Web Service.
The “Hello World” Operation.
Other Files in the Project.
Passing Complex Types.
Returning Arrays of Simple Types.
Returning Arrays of Structures.2. Consuming Your Web Service.
Attaching a Web Reference.
Command-Line Interface Applications.
Graphical User Interface (GUI) Applications.
Web Services Calling Other Web Services.3. SOAP, WSDL, and UDDI Explained
Supported Message Patterns.
SOAP Extensibility Elements.
Registering with UDDI.
Query Patterns.4. Shaping the WSDL, XML, and SOAP Message.
Shaping the WSDL File.
message, portType, and binding.
Using SOAP Headers.
Changing the Location of WSDL Elements.
Creating a Custom SOAP Extension.
Custom SOAP Extension Basics.
An Example SOAP Extension.
Creating a Server Based on a WSDL File.
Using Visual Studio to Register Your SOAP Endpoint in UDDI.5. Troubleshooting Web Services/Consumers.
Viewing SOAP Message Exchanges.
Debugging a Web Service at the Server.
Debugging a Web Service Remotely.
Debugging Web Services Under Load.
Items to Include in Your Test Plan.
A Simple Example.
II. GOING DEEPER.6. Security Issues with Web Services.
Application Level Authorization.
HTTP Basic and Digest Authentication.
X509 Client Certificates.
Tracking User Activity.7. Looking at the “Abilities”.
Multiple Deployment Locations.
Stateless Web Service and Using a Web Farm.
Long-Lived Web Method Calls.8. Asynchronous Web Services.
Synchronous Versus Asynchronous Calls.
Design Pattern for Asynchronous Method Calls.
Calling a Web Service Asynchronously.
Using the Callback Function.
Using the WaitHandle Methods.
Handling Web Pages That Make Asynchronous Calls to WebMethods.
Server to Server Asynchronous Communications.
Server Web Service.
Client Web Service.
WinForm Application.9. Stateful Services.
Benefits of Maintaining State: Performance and Scalability.
Facilitating Web Farms.
Maintaining State with the Session Object.
ASP.NET Session State.
In-Process Session State.
Out-of-Process Session State.
Maintaining State with the Application Object.
Maintaining State with the Cache Object.
Custom State Management.
Managing State as a Web Service.10. Microsoft SOAP SDK.
Using the SOAP Toolkit on the Server.
Generating the WSDL and WSML files.
Common Edits to the WSDL and WSML Files.
Deploying Your SOAP Web Service.
Using the SOAP Toolkit on the Client.
Using the High-Level Interface.
Using the Low-Level Interface.11. Converting Legacy Applications to Web Services.
Adding Web Service Support to COM+ Applications.
Reusing an Existing COM Object Within a Web Service.
Migrating from Visual Basic 6 to Visual Basic .NET.
III. SOLVING REAL-WORLD PROBLEMS.12. Business to Business XML Web Services.
Choosing the Right Technology.
Read-Only Access to Data.
Write-Only Access to Data.
Read/Write Access to Data.
Designing the Web Service.
Building the JLD Database.
Creating the Database Class.
Creating the SecurityToken Class.
Building the Web Service.
Building Elise's Emporium.
Creating the Database.
Building the Product List Page.
Determining Product Availability.13. Business to Customer XML Web Services.
Designing the Database.
Designing the Application.
Referencing the External Web Service.
Creating the List Window.
Adding the List Window Code.
Designing the Stock Editing Window.14. Platform Integration.
Assembling the Tools.
Building the Web Services.
Adding the Database Class.
Creating the Products Service.
Creating the Customers Service.
Creating the Orders Service.
Building the Mobile Application.
Creating the Main Menu.
Creating the Customer Viewer.
Creating the Order Viewer.
Creating the Product Catalog.15. Portals.
Designing the Database.
Configuring the Application.
Adding the Business Objects.
Creating the Web User Controls.
Building the Web Pages.
Creating the Login Page.
Creating the Profile Editor.
Writing the Portal Page.
Building the Log Out Page.16. Profiting From Your Web Services.
Creating Services that Fill a Need.
Decreasing Business Costs.
Volume-Based Access Fee.
Creative Use of the Advertising Model.
A Middleman Model.
Marketing the Web Service.
APPENDIXES.Appendix A. Additional Resources.
General .NET Information.
General Web Service Information.
Sample Web Service.Appendix B. Installing Visual InterDev.
Installing the Client Components.
Installing the Microsoft Visual InterDev Client.
Installing the Image Composer.
Installing the Music Producer.Appendix C. Visual InterDev Architecture Components Overview.
Deployment Architecture.Index. 0672321564T06072002
One of the more confusing items about Web Services regards defining exactly what and why they are. Let's begin with why they exist.
Web Services exist to make it easier to integrate applications. Existing technologies include Java RMI, CORBA, and DCOM. All of these technologies work over networked environments and allow for application integration. This application integration is possible if all the components are reachable over a LAN. However, when going out to the public Internet, these networked applications start to break down. Another problem is that none of these technologies work well for cross platform, cross language integration. Often, working with one of these technologies ties you to a particular language, operating system, or toolkit that must be uniform across the solution. In today's world, the odds of having all systems being written in the same language or using the same operating system and interconnection libraries is fairly small. Add to this a desire to connect these applications across large distances using the Internet and you will find that almost all of these technologies come up short. The necessity of addressing these shortcomings gave birth to Web Services. So, what are they?
A Web Service is a programmatic interface that is accessible via the Internet. As such, it must rely on standardized protocols. You may be aware of the various technologies surrounding Web Services. SOAP (an abbreviation that does not really mean anything anymore), Web Services Description Language (WSDL), and Universal Description Discovery and Integration (UDDI) are just a few of the technologies that are a part of Web Services. To make Internet accessibility a reality, SOAP v1.1 and v1.2 rely on existing, widely deployed technologies. The de facto minimum requirements for Web Service interaction state that the platform, whether client or server, must understand the following standards:
Due to the wide adoption of the Internet and XML, it is extremely difficult to find an operating system or programming language that does not have some support for these standards. Because the interest in Web Services is building to a fever pitch, vendors and individuals are rallying to make additional Web Service-specific tools available. While not a silver bullet for interoperability woes, talking to other languages and platforms just got a lot easier to do.
For many people, the promise of interoperability drew them into learning more about Web Services. As a Visual Basic developer, this promise may have caused you to buy this book. One question probably remains: How real is this promise of interoperability? For any two implementations to work together, they typically have to agree on two items: what the WSDL for a particular interface looks like and how to represent the SOAP message for any given operation in XML. To this end, the many serious development teams and individuals are working together to make sure they all agree.
At XMethods, http://www.xmethods.com/ilab, you can see a list of all the participants. This page also describes what it means to pass or fail the set of tests, as well as the tests themselves. If an implementation is not a part of this effort, you should steer clear of it. Yes, the Microsoft implementations are active in this process.
Before going too far into this book, you should understand some of the reasons for using a Web Service:
When creating a Web Service, make sure that the various APIs are stateless. If you must maintain a pseudo-state, that state information should be obtainable from data passed in the SOAP messages. For example, a Web Service may require that users be validated. To do so, they log in and receive an authentication token. Other Web Service calls will require that the token appear somewhere within the SOAP message. With this, you have state (the user is "logged in") and this state is maintained over transient connections. Maintaining state this way helps with scalability and will be covered in Chapter 6, "Security Issues with Web Services."
While you could run most of these examples using the free Microsoft .NET Framework SDK, you will get the greatest benefit and productivity by using Visual Studio .NET. This book assumes that the reader has Visual Studio .NET installed. This book will still be valuable to users with only the SDK, but many things will be harder to do.
You should also have a copy of the Microsoft SOAP Toolkit v2 installed on your machine. Yes, install this even if all you do is program .NET applications. The toolkit comes with an application called MSSOAPT.EXE. This application allows you to review the SOAP messages going between the SOAP endpoints.
The machine that you are developing on must have Internet Information Server (IIS) installed. Without it, you will not be able to run the examples in the book or develop Web Services on your local machine. This is only available on Windows NT 4.0, Windows 2000, and Windows XP. The good news is that all versions of these operating systems can host IIS. On the Professional versions of XP and 2000, you need to explicitly install IIS. You can do this through the Add/Remove Programs Control Panel applet. Refer to your Windows documentation for instructions. NT 4.0 Workstation can host IIS 4.0. This is available through the Windows NT 4.0 Option Pack.
Finally, it would help to have a good book on Visual Basic .NET handy. Learn Visual Basic .NET in 21 Days by Kent Sharkey and Duncan MacKenzie is one text that would work nicely. Their book serves as an overview of the language.
Because Web Service development with Visual Basic will attract Internet-savvy developers, Visual Basic application developers, and hobbyists, a wide range of people will be picking up this text and reading it. You do not necessarily need a lot of experience with the latest version of Visual Basic. That said, you should know that the language has changed a bit and has become more flexible. If you have not made yourself familiar with the changes, you should plan on updating your knowledge on Visual Basic .NET specifics along with this book.
You probably bought this book for one of two reasons:
With these goals in mind, this book is organized into the following parts:
Now, let's jump right in and learn how to write Web Services!
Click below to download the Index file related to this title: