Tải bản đầy đủ (.pdf) (28 trang)

Tài liệu Module 2: Web Service Architectures docx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (660.98 KB, 28 trang )








Contents
Overview 1
Service-Oriented Architecture 2
Web Service Architectures and Service-
Oriented Architecture 5
Roles in a Web Service Architecture 9
The Web Services Programming Model 18
Review 21

Module 2: Web Service
Architectures



Information 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.

Module 2: Web Service Architectures iii


Instructor 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
iv Module 2: Web Service Architectures


Demonstration
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:
http://localhost/Northwind/Traders.asmx
3. In the second browser window, navigate to the following URL:
http://localhost/Woodgrove/Bank.asmx
4. In the third browser window, navigate to the following URL:
http://localhost/Contoso/Micropayment.asmx
5. Describe the relationship between the methods that are listed on each of the
Service Description pages. Emphasize that the Northwind Web Service is a
client of the other two Web Services.

!
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.

Module 2: Web Service Architectures v


Module 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.


Module 2: Web Service Architectures 1


Overview
!
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.

Topic Objective
To provide an overview of
the module topics and
objectives.
Lead-in
In this module, you will learn
about the architecture of a
Web Services-based
solution.
2 Module 2: Web Service Architectures


Service-Oriented Architecture
Service

Broker
Service
Consumer
Service
Provider
Bind
P
u
b
l
i
s
h
F
i
n
d

*****************************
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.
Module 2: Web Service Architectures 3


What 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.
4 Module 2: Web Service Architectures


The 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.
Module 2: Web Service Architectures 5



"
""
"

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.

×