Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 12 Extending Web Applications. ASP.NET 2.0, Third Edition2.

Similar presentations


Presentation on theme: "Chapter 12 Extending Web Applications. ASP.NET 2.0, Third Edition2."— Presentation transcript:

1 Chapter 12 Extending Web Applications

2 ASP.NET 2.0, Third Edition2

3  Web applications consist of a client, which is the browser application, and a web server  Previous versions of ASP.NET would include a Remote Procedure Call (RCP) to call another application on the web server  The.NET Framework introduces Web services as an integral part of the architecture, making it easy to create and consume these services with minimal amounts of code written ASP.NET 2.0, Third Edition3

4  Goal: use objects residing on other platforms  Mechanism  Stub  Transport  Implementation  Identifying an object  Unique ID with Host server  Directory services ASP.NET 2.0, Third Edition4

5  The Web service client application does not communicate directly with the Web service application; rather, it creates a WSDL proxy  WSDL stands for Web Service Description Language (WSDL)  The WSDL proxy is a class that is used to invoke the Web service  The WSDL proxy will communicate with the Web service application through a WSDL stub ASP.NET 2.0, Third Edition5

6  The WSDL stub is the code that communicates between the proxy class and the Web service application  The purpose of the WSDL stub is to make the communication with the Web service application simpler and transparent  The developer does not have to know about the inner workings of the Web service application in order to invoke the Web service  Rather, the WSDL stub knows what can be sent into and out of the Web service application ASP.NET 2.0, Third Edition6

7 7

8  A controversial technique that has been used to retrieve product information across web sites is scraping  Scraping is labor intensive and the programmer needs permission in order to prevent violating copyright laws  Stream data is a Web service that provides data, and the client application connects to the Web service to retrieve it  Web services can also be used to deliver educational materials to schools, to build public service web sites, to retrieve statistical data, etc. ASP.NET 2.0, Third Edition8

9 9

10  Setting up a web service  p. 586 ASP.NET 2.0, Third Edition10

11 ASP.NET 2.0, Third Edition11

12 ASP.NET 2.0, Third Edition12

13 ASP.NET 2.0, Third Edition13

14  The directory mechanism is the means to locate a Web service through a Web service Discovery Directory  Microsoft and IBM have teamed up to create the Universal Description, Discovery, and Integration (UDDI) specification, which can be used to create a third-party Web service Discovery Directory  Use UDDI directories to locate Web services and the WSDL document  The UDDI service is now available in the Windows Server 2003 software ASP.NET 2.0, Third Edition14

15 ASP.NET 2.0, Third Edition15

16  If the data will not change frequently, use caching techniques to increase performance; turn on page caching by setting the page caching properties  Caching is not enabled by default for data source controls, but you can enable it by setting the control’s EnableCaching property to true and setting the number of seconds to wait before refreshing the page using the CacheDuration property  If your URL that requested the page contains a query string, you can explicitly enable the page to cache each parameter by using the @ OutputCache page directive and adding the VaryByParam attribute ASP.NET 2.0, Third Edition16

17  Using a web service  P. 590 ASP.NET 2.0, Third Edition17

18 ASP.NET 2.0, Third Edition18

19 ASP.NET 2.0, Third Edition19

20 ASP.NET 2.0, Third Edition20

21  HTTP protocol was selected as the primary delivery protocol of Web services because it can be used to deliver documents through proxy servers and fire walls  Three methods used to route the message over the HTTP are:  HTTPGet  HTTPPost  SOAP ASP.NET 2.0, Third Edition21

22  When either Visual Studio.NET or Visual Web Developer Express are used to create a Web service, the application generates the WSDL document, the DISCO document, and the test web page  Use the breakpoints within the debugger tool and the tracing features to debug the Web service  To access an object, property, or function within the Web service, the local Web application treats the Web service as a local object ASP.NET 2.0, Third Edition22

23  Simple Object Access Protocol (SOAP) is an XML-based protocol used for messaging delivery  The SOAP contract uses the XML language to describe the location and interfaces that a particular service supports  To use the WSDL command-line utility to look at the contract and generate the proxy class:  wsdl /language:VB http://localhost/Service1.asmx?wsdl  The DISCO document is an XML document that examines the SOAP contract to describe the method and data formats within the Web service  The DISCO document describes how the proxy class should make calls to the Web service ASP.NET 2.0, Third Edition23

24  Import the WebService namespace at the top of the file  Insert the WebServiceAttribute, which means that the WebService keyword is inserted before the class declaration  Namespace property identifies a unique URL that can distinguish your Web service from other Web services on the Internet  Description property can be used to provide information about your Web service; the Description attribute will appear on the Web service home page ASP.NET 2.0, Third Edition24

25 ASP.NET 2.0, Third Edition25

26 ASP.NET 2.0, Third Edition26

27 ASP.NET 2.0, Third Edition27

28 ASP.NET 2.0, Third Edition28

29 ASP.NET 2.0, Third Edition29

30 ASP.NET 2.0, Third Edition30

31 ASP.NET 2.0, Third Edition31

32 ASP.NET 2.0, Third Edition32

33  Although the HTTPGet and HTTPPost methods are limited to sending only primitive data types such as integers and strings, they can also send arrays of these primitive data types  The SOAP protocol allows you to send any structure, class, or enumerator over the Internet  Serialization is the process of changing an object into a form that can be readily transported over the network  Deserialization is the process of changing the string back into the original structure ASP.NET 2.0, Third Edition33

34 ASP.NET 2.0, Third Edition34

35 ASP.NET 2.0, Third Edition35

36 ASP.NET 2.0, Third Edition36

37 ASP.NET 2.0, Third Edition37

38  You can secure a Web service by using traditional methods such as IIS Web security, Windows authentication and Windows NTFS file permissions, and Passport authentication  The Web services Enhancements (WSE) simplifies the development and deployment of secure Web services and allows developers and administrators to apply security policies more easily  You can require a specific authentication method such as anonymous access, or a specific Windows user account  You can require the client to use a secure communications channel such as SSL ASP.NET 2.0, Third Edition38

39  Because there is a wide range of hardware and software for alternative platforms, not all of them have the same screen size, resolution, color, graphics, and multimedia capabilities  Many of the new devices have the.NET Compact Framework installed  You can use.NET development editors to create.NET applications for the Pocket PC devices  Some developers may choose to use eMbedded Visual Tools to create their mobile applications ASP.NET 2.0, Third Edition39

40  The standard used to program on a mobile device is the Wireless Application Protocol (WAP)  Within the WAP is the Wireless S Protocol (WSP), which is a transport protocol that performs the same functions as HTTP for mobile devices  To work with web content, the WAP standards use an application standard known as Wireless Markup Language (WML)  Most mobile devices supply a simulator for developers  Each device has its own skin, which can be viewed on the device emulator ASP.NET 2.0, Third Edition40

41 ASP.NET 2.0, Third Edition41

42 ASP.NET 2.0, Third Edition42

43 ASP.NET 2.0, Third Edition43

44 ASP.NET 2.0, Third Edition44

45 ASP.NET 2.0, Third Edition45

46  Web services are used to expose part or all of an application. A Web service must end in the.asmx extension. The keyword, WebMethod, is used to identify the methods that are to be exposed.  Web Service Description Language (WSDL) schema is used to create a WSDL document that describes the functionality of the Web service.  Microsoft and IBM have teamed up to create the Universal Description, Discovery, and Integration (UDDI) specification, which is used to locate Web services.  Call Web services by HTTPGet and HTTPPost methods, or SOAP.  WSDL document creates a proxy class. The web application calls the proxy class to invoke the Web service. The proxy class reads the WSDL document and verifies the delivery method.  SOAP contract is an XML-formatted document called the WSDL.  Secure a Web service by using the traditional methods such as IIS Web security, HTTPS with SSL, Windows authentication, and Passport authentication. ASP.NET 2.0, Third Edition46

47  The Wireless Application Protocol (WAP) is an open standard used to create programs on a mobile device. Wireless Markup Language (WML) is the programming language used to create the code for the mobile applications.  WML is compliant with the XML protocols. The WML files use cards to organize and divide the structure of the WML document. You can use additional HTML tags within the WML language, such as the anchor tag.  Device emulators, such as the OpenWave Simulator, allow you to simulate phones from a variety of vendors.  A web page that contains Mobile controls is called a Mobile Form. Mobile controls inherit a code behind the page named System.Web.UI.MobileControls.MobilePage. ASP.NET 2.0, Third Edition47


Download ppt "Chapter 12 Extending Web Applications. ASP.NET 2.0, Third Edition2."

Similar presentations


Ads by Google