Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 40 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
40
Dung lượng
0,92 MB
Nội dung
Contents Overview 1 What is a Web Service? 2 Calling a Web Service from a Browser 11 Calling a Web Service Using a Proxy 14 Creating a Simple Web Service Using Visual Basic 19 Creating and Calling a Web Service Using Visual Studio.NET 23 Lab 6:UsingWebServices 32 Review 33 Module6:UsingWebServices BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY Information in this document is subject to change without notice. The names of companies, products, people, characters, and/or data mentioned herein are fictitious and are in no way intended to represent any real individual, company, product, or event, unless otherwise noted. Complying with all applicable copyright laws is the responsibility of the user. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, for any purpose, without the express written permission of Microsoft Corporation. If, however, your only means of access is electronic, permission to print one copy is hereby granted. 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. 2000 Microsoft Corporation. All rights reserved. Microsoft, BackOffice, MS-DOS, Windows, Windows NT, <plus other appropriate product names or titles. The publications specialist replaces this example list with the list of trademarks provided by the copy editor. Microsoft is listed first, followed by all other Microsoft trademarks in alphabetical order. > are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A. and/or other countries. <The publications specialist inserts mention of specific, contractually obligated to, third-party trademarks, provided by the copy editor> Other product and company names mentioned herein may be the trademarks of their respective owners. Module6:UsingWebServices iii BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY Instructor Notes This module introduces the concept of Web services. Students will learn about Web services, how to call and use a Web service in their application, and finally create a Web service. In the lab, students will call a Web service from an ASP.NET page, and create a Web service using Microsoft Visual Basic. After completing this module, students will be able to: ! Explain the goal of Webservices and how they fit in the Web architecture. ! Describe the Webservices execution model. ! Call a Web service from a browser. ! Call a Web service using a proxy. ! Use the data returned by a Web service ! Create a simple Web service using Visual Basic. 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 following materials: ! Microsoft ® PowerPoint ® file 2063A_06.ppt ! Module 6, “Using Web Services” (2063A_06.doc) ! Lab, “Using Web Services” (2063A_L06.doc) ! Animation, "title" (2063A_06A001 ) ! Animation script Preparation Tasks To prepare for this module, you should: ! Read all of the materials for this module. ! Complete all the demonstrations. ! Complete the lab. ! Read the animation script. ! Read up about Webservices from the .NET SDK documentation. Presentation: 100 Minutes Lab: 60 Minutes iv Module6:UsingWebServices BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY Multimedia Presentation This section provides multimedia presentation procedures that do not fit in the margin notes or are not appropriate for the student notes. UsingWebServices ! To present the animation: Action Say this Before, you start the animation, say this: There are two ways of calling a Web service, directly from the browser or using a proxy client. This animation demonstrates these two ways of calling a Web service. Click Direct Client To access a Web service directly from a browser, the client simply specifies the URL to the Web service(.asmx file). The protocol used here is HTTP. After processing the request, the Server returns a description page to the client that lists all the available methods of the Web service requested by the client. After the client discovers the methods of the Web service, it invokes a particular Web service method. The Server processes the request and returns the data to the client in the XML format. Click Proxy Client Another method is to use a proxy client. In this method, the client issues a request to the server for a Web service. The request is in the form of an .aspx page. Upon receiving the request from the client, the server parses and compiles the .aspx page. The Server then invokes the proxy (which is instantiated in the .aspx page) to call the Web service. The protocol used here is XMLP. (Earlier known as SOAP) The response is then sent back to the client in a format that the client .aspx page can use. The proxy carries out the data translation. Module6:UsingWebServices v BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY Module Strategy Use the following strategy to present this module: ! What is a Web Service? Start the section by providing students with an overview and the need for Web services. Next, run the animation on Web services, and explain the whole architecture and process of usingWeb services. When giving students examples of Web services, tell them that as of now there aren't very many Webservices that are available as of now. The section ends with a demonstration of how to call the terra server Web service. It might be good idea to visit the Web site at http://terraserver.microsoft.net/terraservice.htm for more information on the purpose of this Web service. ! Calling a Web Service from a Browser Start this section with a discussion of the two ways in which you can call a Web service. (Calling from a browser and using a proxy). Reiterate the advantage of calling a Web service using a proxy over calling a Web service from a browser. ! Calling a Web Service Using a Proxy This section is the most useful section in this module. So spend more time teaching this section and explain the concept with small demonstrations. (You would have already done all these steps when you call the Terraserver Web service) ! Creating a Simple Web Service Using Visual Basic This section describes how to write a Web service. Use the demonstration to explain this further. Module6:UsingWebServices 1 BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY Overview ! What Is a Web Service? ! Calling a Web Service from a Browser ! Calling a Web Service Using a Proxy ! Creating a Simple Web Service Using Visual Basic ! Creating and Calling a Web Service Using Visual Studio.NET By providing fast access to information the Web has helped facilitate better communication within and between companies. For many organizations, however, browsing data-driven pages has not fulfilled their business needs sufficiently. Programmable Web sites that directly link organizations, applications, services, and devices with one another would better meet these needs. Webservices provide a simple, flexible, standards-based model for binding applications together over the Internet that takes advantage of existing infrastructure and applications. Web applications can easily be assembled using locally developed services and existing services, regardless of which platforms, development languages, or object models have been used to implement the constituent services or applications. After completing this module, you will be able to: ! Explain the goal of Webservices and how they fit into the Web architecture. ! Describe the Webservices execution model. ! Call a Web service from a browser. ! Call a Web service by using a proxy. ! Use the data returned by a Web service ! Create a simple Web service by using Microsoft ® Visual Basic ® . Topic Objective To provide an overview of the module topics and objectives. Lead-in In this module, you will learn about Webservices that are supported by ASP.NET, a unified Web development platform that has grown from Active Server Pages (ASP) technology. 2 Module6:UsingWebServices BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY # ## # What is a Web Service? ! The Need for WebServices ! WebServices Execution Model ! Finding Existing WebServices ! Examples of Existing WebServices ! Demonstration: Calling the TerraService Web Service Webservices provide a simple, flexible, standards-based model for binding applications together over the Internet that takes advantage of existing infrastructure and applications. In this section, you will learn about the need for Webservices and also learn about their architecture. You will also learn about existing Webservices and how to find them. Topic Objective To introduce the topics in the section. Lead-in In this section, you will see an overview of Web services. Module6:UsingWebServices 3 BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY The Need for WebServices ! Allow applications to communicate across the Internet ! Language independent ! Protocol independent ! Platform independent ! Stateless architecture One of today's most pressing challenges for developers is application integration. Application integration is the process of taking a group of applications and turning them into easy-to-use Web applications, even if they run on different operating systems, were created with different programming languages, and were built with different object models. Like components, Webservices represent black-box functionality that can be reused without worrying about how the service is implemented. Webservices provide well-defined interfaces (called contracts) that describe the services they represent. Developers can assemble applications by using a combination of remote services, local services, and custom code. For example, a company might assemble an online store that uses the Microsoft ® Passport service to authenticate users, a third-party personalization service to adapt Web pages to each user's preferences, a credit-card processing service, a sales tax service, package-tracking services from each shipping company, an in-house catalog service that connects to the company's internal inventory management applications, and custom code to individualize the interface and make it unique. Unlike current component technologies, however, Webservices do not use protocols that are specific to certain object models, such as Distributed Component Object Model (DCOM), which requires specific, homogeneous infrastructures on the computers that run the client and the server. Webservices communicate by using standard Web protocols and data formats, such as Hypertext Transfer Protocol (HTTP), Extensible Markup Language (XML), and Extensible Markup Language Protocol (XMLP). Any system that supports these Web standards will be able to support Web services. A Web service can be used internally by a single application, or it can be used externally by many applications that access it through the Internet. Because it is accessible through a standard interface, a Web service allows disparate systems to work together. The Webservices model is independent of languages, platforms, and object models. Topic Objective To explain the need for Web services. Lead-in Before learning to implement Web services, you should understand how they fill some business needs. Delivery Tip If students are unfamiliar with the XMLP protocol, describe it briefly. 4 Module6:UsingWebServices BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY The Web service model is supported by ASP.NET, which is a unified Web development platform that has grown from Active Server Pages (ASP) technology. The ASP.NET Webservices model assumes a stateless service architecture. Stateless architectures are generally more scalable than stateful architectures. Each time a service request is received, a new object is created. The request into a method call, and the object is destroyed once the method call returns. Services can use the ASP.NET State Management services if they need to maintain a state between requests . [...]... TRAINER PREPARATION PURPOSES ONLY 26 Module6:UsingWebServices 4 Compile the Web service by using the Build option Visual Studio.NET compiles the Web service code and deploys it as a DLL to the \bin directory of the Web server BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY Module6:UsingWebServices 27 Demonstration: Creating a Web Service Using Visual Studio.NET Topic Objective... which Webservices are exposed by a particular business For more information about UDDI, go to the UDI Web site at http://www.uddi.org/ BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY Module6: Using Web Services 9 Examples of Existing WebServices Topic Objective To list some real examples of Webservices ! Census.NET Web service ! There are a number of existing Web services. .. learn how to create and call Webservices by using Visual Studio.NET BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY 24 Module6: Using Web Services Creating a Web Service Using Visual Studio.NET Topic Objective To show how to create a Web service using Visual Studio.NET Lead-in You can use Visual Studio.NET to create a Web service ! Creating a Web service: 1 Open a new project... PREPARATION PURPOSES ONLY Module6: Using Web Services 19 # Creating a Simple Web Service Using Visual Basic Topic Objective To introduce the topics included in this section Lead-in So far, you have learned about Webservices in general, and how to use existing Webservices In this section, you will learn how to create your own Web service ! Writing a Web Service ! Demonstration: Creating a Web Service The biggest.. .Module 6: Using Web Services 5 WebServices Execution Model Topic Objective To describe the Webservices execution model Lead-in The Webservices model has two main parts: a service provider that creates the service, and a client that consumes the service (creates the aspx page) The Webservices execution model mainly involves two entities, the... this section ! Creating a Web Service Using Visual Studio.NET Lead-in ! Demonstration: Creating a Web Service Using Visual Studio.NET ! Calling a Web Service Using Visual Studio.NET ! Demonstration: Calling a Web Service Using Visual Studio.NET Visual Studio.NET makes it easy to create and call Webservices Microsoft® Visual Studio.NET makes it easy to create and call Webservices In Visual Studio.NET,... PREPARATION PURPOSES ONLY Module6: Using Web Services 7 Finding Existing WebServices Topic Objective To describe how to find existing Webservicesusing the Universal Description, Discovery, and Integration (UDDI) specification ! $ Lead-in Webservices are the next step in the evolution of the World Wide Web (WWW); they allow you to place programmable elements on Web sites where others can access distributed... project for the Web service To learn how to create a Web service by using Visual Studio.NET, consider a simple Web service called Stocks BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY Module6:UsingWebServices 25 ! To create the Stock Web service in Visual Basic: 1 Open a new project in Visual Studio.NET 2 Select the Web Service option, and specify the name of the Web service... of Webservices is that they can be created easily In this section, you will learn how to create a Web service and expose methods BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY 20 Module6:UsingWebServices Writing a Web Service Topic Objective To explain how to write a Web service Lead-in Creating a Web service involves writing an asmx file ! Adding a page directive . 19 Creating and Calling a Web Service Using Visual Studio.NET 23 Lab 6: Using Web Services 32 Review 33 Module 6: Using Web Services BETA MATERIALS FOR. overview of Web services. Module 6: Using Web Services 3 BETA MATERIALS FOR MICROSOFT CERTIFIED TRAINER PREPARATION PURPOSES ONLY The Need for Web Services