Roles in a Web Service Architecture 9 The Web Services Programming Model 18 Review 21 Module 2: Web Service Architectures... Web Service Architectures and Service-Oriented Architecture
Trang 1Roles in a Web Service Architecture 9
The Web Services Programming Model 18
Review 21
Module 2: Web Service Architectures
Trang 2Information in this document, including URL and other Internet Web site references, is subject to change without notice Unless otherwise noted, the example companies, organizations, products, domain names, e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with any real company, organization, product, domain name, e-mail address, logo, person, places or events is intended or should be inferred Complying with all applicable copyright laws is the responsibility of the user Without limiting the rights under copyright, no part of this document may be reproduced, stored in or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical, photocopying, recording, or otherwise), or for any purpose, without the express written permission of Microsoft Corporation Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property rights covering subject matter in this document Except as expressly provided in any written license agreement from Microsoft, the furnishing of this document does not give you any license to these patents, trademarks, copyrights, or other intellectual property
2001 Microsoft Corporation All rights reserved
Microsoft, MS-DOS, Windows, Windows NT, Active Directory, Authenticode, Biztalk, Intellisense, Jscript, MSDN, PowerPoint, Visual Basic, Visual C++, Visual C#, Visual Studio, Win32, and Windows Media are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A and/or other countries
The names of actual companies and products mentioned herein may be the trademarks of their respective owners
Trang 3Instructor Notes
This module broadly describes service-oriented architecture, which is a conceptual architecture Then, the module explains how Web Service architectures are a type of service-oriented architecture It also describes the various roles within the Web Service architecture
After completing this module, students will be able to:
! Identify how Web Service architectures are a type of service-oriented architecture
! Describe the elements of a Web Service architecture and explain their roles
! Describe the Web Service programming model
Materials and Preparation
This section provides the materials and preparation tasks that you need to teach this module
Required Materials
To teach this module, you need the Microsoft® PowerPoint® file 2524A_02.ppt
Preparation Tasks
To prepare for this module:
! Read all of the materials for this module
! Try out the demonstration
Presentation:
60 Minutes
Lab:
00 Minutes
Trang 4Demonstration
This section provides demonstration procedures that will not fit in the margin notes or are not appropriate for the student notes
An Electronic Funds Transfer Web Service Solution
! To demonstrate the NorthwindClient application
1 Start the application NorthwindClient.exe, which can be found in the folder
<install folder>\Labfiles\Lab09\Solution\NorthwindClient\bin\Debug
2 In the From list, click Woodgrove Online Bank
3 In the To list, click Contoso Micropayments
4 Click Transfer
5 Explain that $100 has been transferred from an account at the Woodgrove bank to an account at the micropayment service, named Contoso
6 Explain that the Northwind Traders Web Service took care of all the details
of managing the transfer, including retrieving routing numbers, etc
! To show the Service Description pages for the Northwind, Woodgrove, and Contoso Web Services
1 Open three separate browser windows
2 In the first browser window, navigate to the following URL:
! To show that money is transferred between the accounts
1 Click the GetAccount link on the Service Description page to open the Service Method Description page for the GetAccount method of the
Woodgrove Web Service
2 In the acctID box, type the account number using the value of the AccountID field for the From account in NorthwindClient.exe
3 Click Invoke
An XML document that contains the results of the method call is displayed
4 Point out the value in the balance element in the XML document
5 Click the Transfer button in the client application, NorthwindClient.exe
6 Click the Refresh button on the browser window that displays the XML
document
7 Point out that the balance has been reduced by $100
Trang 5Module Strategy
Use the following strategy to present this module:
! Service-Oriented Architecture Explain what a service-oriented architecture is This topic is intended to provide the students with a conceptual framework to be able to understand the architecture of Web Service based solutions
! Web Service Architectures and Service-Oriented Architecture Explain the relationship between the conceptual service-oriented architecture and Web Services architectures Use the demonstration of the final solution as a means to show each of the Web Service architectural elements as concrete implementations
! Roles in a Web Service Architecture This topic examines the specific roles in Web Service architecture and explains that the NET Framework can provide assistance in implementing the functionality for each of the entities that play the roles
! The Web Services Programming Model Describe the features of the Web Services programming model Emphasize how this model is different than the traditional stateful, monolithic
programming model However, defer any in-depth discussion on how the Web Services programming model affects Web Services design until
Module 8, “Designing Web Services,” in Course 2524A, Developing XML
Web Services Using Microsoft Visual C# NET Beta 2
Trang 7Overview
! Service-Oriented Architecture
! Web Service Architectures and Service-Oriented Architecture
! Roles in a Web Service Architecture
! The Web Service Programming Model
***************************** ILLEGAL FOR NON - TRAINER USE ******************************
In this module, you will begin by looking at service-oriented architecture as a conceptual architecture for distributed applications Next, you will examine how solution architectures based on Web Services are a type of service-oriented architecture Then, you will examine each of the roles in a Web Service
architecture Finally, you will look at the kind of programming model imposed
by a Web Service architecture
After completing this module, you will be able to:
! Identify how Web Service architectures are a type of service-oriented architecture
! Describe the elements of a Web Service architecture and explain their roles
! Describe the Web Service programming model
In this module, you will learn
about the architecture of a
Web Services-based
solution
Trang 8Service-Oriented Architecture
Service Broker
Service Consumer
Service Provider
Bind
Pu bli
***************************** ILLEGAL FOR NON - TRAINER USE ******************************
To build flexible, robust distributed applications, there are a number of requirements that must be met:
! When integrating software resources, the resources must be loosely coupled; that is, resources must be distinct and separate
! Inter-program communication must be compliant with Internet standards
! The service interfaces of software resources must be published for public use, and the interface definitions and documentation must be publicly accessible
Building applications that meet the preceding requirements can result in the following advantages:
! Applications can be constructed by integrating core business processes with outsourced software services and resources
! Many more granular software resources can be created
! Reusable third-party software resources can provide cost and productivity benefits
! The sale of software as service can become widespread For example, a company could sell a shared calendar service as a Web accessible service instead of selling a stand-alone calendaring application
Topic Objective
To describe service-oriented
architecture and explain
how distributed applications
can be modeled using this
architecture
Lead-in
To build flexible, robust
distributed applications,
there are a number of
requirements that must be
met
Trang 9What Is a Service-Oriented Architecture?
One of the architectures for implementing such distributed applications is the service-oriented architecture It is a conceptual architecture for implementing dynamic, loosely coupled, distributed applications
Today, most business systems and applications are made up of tightly coupled applications and subsystems This means that a change to any one subsystem can cause many dependant applications to fail The brittleness of existing systems is one of the primary reasons for the high cost of maintaining them, and the limitations in the flexibility of the applications, and the number of trading partners that can be managed
Elements of a Service-Oriented Architecture
A service-oriented architecture consists of three primary roles A diagram of this architecture is shown on the preceding slide
Service provider
A service provider is a node on the network (intranet or Internet) that provides access to the interface to a software service that performs a specific set of operations A service provider node provides access to the services of a business system, or a subsystem or component
Service consumer
A service consumer is a node on the network that binds to a service provided by
a service provider and uses the service to implement a business solution In the service-oriented architecture model, service consumers are not applications, but nodes However, for the purpose of this course, we will view service consumers
as a client application on a node
Service broker
A service broker is a node on the network that is a repository of service descriptions and acts like a yellow pages service Service consumers can interrogate a service broker in order to locate a required service provider and service Service brokers will often also act as service providers in cases where the service that is provided is service brokering
Trang 10The preceding three service-oriented architecture roles interact to perform three basic operations:
! Publish services Service providers publish their services to a service broker The information published includes the service interface definition, location of service providers, and possibly other supporting information or documentation
! Find services Service consumers find required/desired services by using a service broker
! Bind to services Service consumers bind to specific services provided by a service provider The binding process includes authentication of consumers
Both finding and binding to services can be done dynamically to allow applications to configure themselves dynamically For example, if an application finds that the response time from a service provider has become unacceptable, then it might decide to switch to another service provider at run time
Trang 11" Web Service Architectures and Service-Oriented
Architecture
! Overview of Web Service Architectures
! Web Services as a Service-Oriented Architecture Implementation
! Demonstration: An Electronic Funds Transfer Web Service Solution
***************************** ILLEGAL FOR NON - TRAINER USE ******************************
Before delving into the details of implementing and using Web Services, it is important to understand how a Web Service architecture is a type of service-oriented architecture
First, Web Service architectures will be examined Next, the mapping between elements of Web Service architecture and elements of service-oriented
architecture will be examined Finally, you will view a demonstration of a working example of a Web Service solution, specifically the components of the solution architecture
Topic Objective
To introduce the topics in
this section
Lead-in
Before delving into the
details of implementing and
using Web Services, it is
important to understand how
a Web Service architecture
is a type of service-oriented
architecture
Trang 12Overview of Web Service Architectures
Service Broker
Pu bli
sh Fin d
Service Consumer
Service
Provider
Web Service Provider Web Service Consumer
UDDI (Web Service Broker)
Bind Internet
***************************** ILLEGAL FOR NON - TRAINER USE ******************************
The basic elements in a Web Service architecture are:
! The Web Service provider, which is a network node hosting a Web Service
! The Web Service consumer, which is a network node hosting any client that can communicate using Hypertext Transfer Protocol (HTTP) The clients include browsers, console applications, and traditional graphical user interface (GUI) applications
! The Web Service broker, which is a network node hosting a global registry
of available Web Services much like the yellow pages in a telephone directory
All of these network nodes should be able to communicate with each other typically through a Transmission Control Protocol/Internet Protocol (TCP/IP) based network
The diagram on the preceding slide shows the relationship among the various elements of a Web Service architecture The rest of this module first focuses on how the elements of a Web Services architecture correspond to service-oriented architecture and then focuses on the various elements of the architecture
Course 2524A, Developing XML Web Services Using Microsoft Visual C# NET
Beta 2, focuses on implementing and using many of these elements
Let us look at the basic
elements in a Web Service
architecture
Delivery Tip
The slide is an animated
slide build Click the slide to
display the UDDI element,
when you want to mention
about UDDI
Trang 13Web Services as a Service-Oriented Architecture Implementation
UDDI
Any Client
SOAP
SO AP
.NET Web Service
SO AP
IIS
***************************** ILLEGAL FOR NON - TRAINER USE ******************************
In a solution based on Web Services, the three network nodes defined in a service-oriented architecture correspond to the elements of the solution in the following way:
! The role of a service broker is primarily fulfilled by a node that hosts a Universal Description, Discovery and Integration (UDDI) registry You will
be introduced to UDDI later in this module, For more complete coverage of programming Web Services and Web Service consumers using UDDI, see Module 6, “Publishing and Deploying Web Services,” in Course 2524A,
Developing XML Web Services Using Microsoft Visual C# NET Beta 2
! The role of a service provider is fulfilled by nodes that expose Web Services through ASP.NET pages with the extension asmx For more information about the implementation details, see Module 5, “Implementing a Simple
Web Service,” in Course 2524A, Developing XML Web Services Using
Microsoft Visual C# NET Beta 2
The entry point to Web Services implemented using ASP.NET are Web pages with the extension asmx
! The role of a service consumer is fulfilled by any node that can communicate using Simple Object Access Protocol (SOAP) or HTTP, understands the service interface being used, and can supply the necessary authentication credentials
Trang 14Demonstration: An Electronic Funds Transfer Web Service Solution
Internet
Web Service Consumer
UDDI Registry
Contoso Micropayment Web Service Firewall
Firewall
Firewall
Woodgrove Bank Web Service
Northwind Electronic Funds Transfer Web Service
***************************** ILLEGAL FOR NON - TRAINER USE ******************************
In this demonstration, you will see an actual implementation of the concepts that you learned in the previous two topics, in a sample electronic funds transfer Web Services-based solution You will build your own version of this solution
in the labs for Course 2524A, Developing XML Web Services Using Microsoft
Visual C# NET Beta 2
In this demonstration, you
will see a sample Web
Service-based financial
solution
Delivery Tip
Refer to the instructor notes
(2524A_dg02.doc) for the
steps for this demonstration
Emphasize the similarity
between the components of
the solution and the
overview diagram