Introduction to App. Web

36
Introduction to Web Application Introduction to Web Application Source: Source: Building Web Applicati ons with UML Second Edition By Building Web Applicati ons with UML Second Edition By Jim Jim Conallen Conallen, 2002 , 2002 Modeling Web Application Architecture with UML By:: Jim Conallen, 1999 Modeling Web Application Architecture with UML By:: Jim Conallen, 1999 IF3037 IF3037 STEI ITB STEI ITB - 2008 2008

Transcript of Introduction to App. Web

Page 1: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 1/36

Introduction to Web ApplicationIntroduction to Web Application

Source:Source:

Building Web Applications with UML Second Edition By Building Web Applications with UML Second Edition By JimJim ConallenConallen, 2002, 2002

Modeling Web Application Architecture with UML By:: Jim Conallen, 1999Modeling Web Application Architecture with UML By:: Jim Conallen, 1999

IF3037IF3037STEI ITBSTEI ITB -- 20082008

Page 2: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 2/36

September 2008 2IF3037

AgendaAgenda

Web AppWeb App Client site managementClient site management

Cookies, sessionsCookies, sessions

Enabling technology Enabling technology  CGI, compiled modules, interpreted scriptsCGI, compiled modules, interpreted scripts

Dynamic clientsDynamic clients Script, java applet, activeX/COMScript, java applet, activeX/COM

Distributed objectDistributed object Java RMI, Microsoft DCOMJava RMI, Microsoft DCOM

XMLXML Web servicesWeb services

Page 3: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 3/36

September 2008 3IF3037

Web ApplicationWeb Application

Web applications evolved from Web sites orWeb applications evolved from Web sites orWeb systemsWeb systems

Web application is a Web system that allows itsWeb application is a Web system that allows itsusers to execute business logic with a Webusers to execute business logic with a Webbrowserbrowser

Web applications use enabling technologies toWeb applications use enabling technologies to

make their content dynamic and to allow usersmake their content dynamic and to allow usersof the system to affect business logic on theof the system to affect business logic on theserver.server.

Page 4: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 4/36

September 2008 4IF3037

Basic Web SystemBasic Web System

Page 5: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 5/36

September 2008 5IF3037

Web application architecturesWeb application architectures

It contains the same principal components of aIt contains the same principal components of aWeb site:Web site:

a Web server,a Web server,

a network connection, anda network connection, and

client browsers.client browsers.

Web applications also includeWeb applications also include an applicationan application

serverserver.. The addition of the application server enables theThe addition of the application server enables the

system to manage business logic and state.system to manage business logic and state.

Page 6: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 6/36

September 2008 6IF3037

Client State ManagementClient State Management

One common challenge of Web applications isOne common challenge of Web applications ismanaging client state on the server.managing client state on the server. Owing to the connectionless nature of client and serverOwing to the connectionless nature of client and server

communications, a server doesn't have an easy way to keepcommunications, a server doesn't have an easy way to keep

track of each client request and to associate it with thetrack of each client request and to associate it with theprevious request, since each and every Web page requestprevious request, since each and every Web page requestestablishes and breaks a completely new set of connections.establishes and breaks a completely new set of connections.

Managing state is important for many applications; aManaging state is important for many applications; asingle use case scenario often involves navigating single use case scenario often involves navigating 

through a number of Web pages.through a number of Web pages. The W3C has proposed an HTTP state managementThe W3C has proposed an HTTP state management

mechanism, more commonly known as "mechanism, more commonly known as "cookiescookies""

Page 7: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 7/36

September 2008 7IF3037

CookiesCookies

A cookie is a piece of data that a Web server canA cookie is a piece of data that a Web server can

ask a Web browser to hold on to, and to returnask a Web browser to hold on to, and to return

every time the browser makes a subsequentevery time the browser makes a subsequentrequest for an HTTP resource to that server.request for an HTTP resource to that server.

Typically, the size of the data is small, betweenTypically, the size of the data is small, between

100 and 1K bytes; however, the official limit is100 and 1K bytes; however, the official limit is

around 4K.around 4K.

Page 8: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 8/36

September 2008 8IF3037

SessionsSessions

A session represents a single cohesive use of the system.A session represents a single cohesive use of the system.

A session usually involves many executable Web pages and a lotA session usually involves many executable Web pages and a lotof interaction with the business logic on the application server.of interaction with the business logic on the application server.

The most common example of keeping client state on the serverThe most common example of keeping client state on the servercan be found on the Internet at any ecan be found on the Internet at any e--commerce site.commerce site. The use of virtual shopping carts is a nice feature of an online store.The use of virtual shopping carts is a nice feature of an online store.

A shopping cart contains all the items an online customer has selectedA shopping cart contains all the items an online customer has selectedfrom the store's catalog.from the store's catalog.

The shopper can check the contents of the cart at any time during theThe shopper can check the contents of the cart at any time during the

session.session. This feature requires that the server be capable of maintaining some stateThis feature requires that the server be capable of maintaining some state

about the client across a series of Web page requests.about the client across a series of Web page requests.

Page 9: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 9/36

September 2008 9IF3037

Enabling TechnologiesEnabling Technologies

Enabling technologies are the mechanism by whichEnabling technologies are the mechanism by whichWeb pages become dynamic and respond to user input.Web pages become dynamic and respond to user input.

The earliest involved the execution of a separateThe earliest involved the execution of a separate

module by a Web server.module by a Web server.

Instead of requesting an HTMLInstead of requesting an HTML--formatted page from the fileformatted page from the filesystem, the browsers would request the module, which thesystem, the browsers would request the module, which theWeb server interpreted as a request to load and to run theWeb server interpreted as a request to load and to run the

module.module. The module's output is usually a properly formatted HTMLThe module's output is usually a properly formatted HTML

page but could be image, audio, video, or other data.page but could be image, audio, video, or other data.

Page 10: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 10/36

September 2008 10IF3037

Enabling Technologies (2)Enabling Technologies (2)

The original mechanism for processing user input in a Web system is theThe original mechanism for processing user input in a Web system is theCommon Gateway Interface (CGI),Common Gateway Interface (CGI), a standard way to allow Web users to execute applications on the server.a standard way to allow Web users to execute applications on the server. can be written in any language and can even be scripted.can be written in any language and can even be scripted.

the most common language for smallthe most common language for small--scale CGI modules is Perl (practicalscale CGI modules is Perl (practical

extraction and reporting language), which is interpreted each time it is executed.extraction and reporting language), which is interpreted each time it is executed. The two biggest problems with CGI:The two biggest problems with CGI:

it doesn't automatically provide session management servicesit doesn't automatically provide session management services every execution of the CGI module requires a new and separate process on theevery execution of the CGI module requires a new and separate process on the

application/Web serverapplication/Web server

The available solutions:The available solutions:

by adding plug by adding plug--ins to the Web server.ins to the Web server. the plug the plug--ins allow the Web server to concentrate on servicing standard HTTPins allow the Web server to concentrate on servicing standard HTTP

requests and deferring executable pages to another running processrequests and deferring executable pages to another running process

Page 11: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 11/36

September 2008 11IF3037

Enabling Technologies (3)Enabling Technologies (3)

Two major approaches to Web applicationTwo major approaches to Web application² ²enabling enabling technologies are used today:technologies are used today: compiled modulescompiled modules

interpreted scriptsinterpreted scripts

CompiledCompiled--module solutionsmodule solutions are CGIare CGI--like modules that arelike modules that arecompiled loadable binaries executed by the Web server.compiled loadable binaries executed by the Web server. These modules have access to APIs that provide the informationThese modules have access to APIs that provide the information

submitted by the request, including the values and names of all the fieldssubmitted by the request, including the values and names of all the fieldsin the form and the parameters on the URL.in the form and the parameters on the URL.

These modules produce HTML output that is sent to the requesting These modules produce HTML output that is sent to the requesting browser.browser.

Some popular implementations of this approach are Microsoft's InternetSome popular implementations of this approach are Microsoft's InternetServer API (ISAPI), Netscape Server API (NSAPI), and Java servlets.Server API (ISAPI), Netscape Server API (NSAPI), and Java servlets.

Page 12: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 12/36

September 2008 12IF3037

Enabling Technologies (4)Enabling Technologies (4)

The scriptedThe scripted--page solutionpage solution looks like anlooks like anHTML page that happens to process businessHTML page that happens to process businesslogic ( logic ( whereas the compiledwhereas the compiled--module solution looks like amodule solution looks like a

business logic program that output HTMLbusiness logic program that output HTML)) a file in the Web server's file system, contains scriptsa file in the Web server's file system, contains scripts

to be interpreted by the server;to be interpreted by the server;

the scripts interact with objects on the server andthe scripts interact with objects on the server andultimately produce HTML output.ultimately produce HTML output.

some popular vendor are Java Server Pages,some popular vendor are Java Server Pages,Microsoft's Active Server Pages, and PHP.Microsoft's Active Server Pages, and PHP.

Page 13: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 13/36

September 2008 13IF3037

Web Server Enabling TechnologyWeb Server Enabling Technology

Page 14: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 14/36

September 2008 14IF3037

Dynamic ClientDynamic Client

Client computers that sharing in the execution of theClient computers that sharing in the execution of thebusiness logicbusiness logic

The simplest examples: field and form validationsThe simplest examples: field and form validations

A number of technologies and mechanisms share someA number of technologies and mechanisms share somefeatures:features:

associated with the Web page and can access and modify itsassociated with the Web page and can access and modify itscontent.content.

automatically deployed, or downloaded, to the clientautomatically deployed, or downloaded, to the clientcomputer as needed.computer as needed.

address specific security concerns.address specific security concerns.

Page 15: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 15/36

September 2008 15IF3037

Dynamic Client Technology: ScriptingDynamic Client Technology: Scripting

JavaScript is the most common scripting technology in browsersJavaScript is the most common scripting technology in browserstoday today  one part of the Java technology revolution; an implementation of aone part of the Java technology revolution; an implementation of a

scripting language that has its roots in the Java programming languagescripting language that has its roots in the Java programming language

easier to learn and to use than Javaeasier to learn and to use than Java JavaScript comes embedded in HTML pages, so it needs toJavaScript comes embedded in HTML pages, so it needs to

coexist in the documentcoexist in the document The <script> and </script> tags, used to define regions of JavaScript.The <script> and </script> tags, used to define regions of JavaScript.

Examples:Examples:<SCRIPT LANGUAGE="JavaScript"> alert('Hello World.') </SCRIPT><SCRIPT LANGUAGE="JavaScript"> alert('Hello World.') </SCRIPT>

Not all browsers are JavaScript capableNot all browsers are JavaScript capable even though a browser is built to be robust and fault tolerant, the earliesteven though a browser is built to be robust and fault tolerant, the earliest

browsers do not gracefully handle JavaScriptbrowsers do not gracefully handle JavaScript

Page 16: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 16/36

September 2008 16IF3037

Dynamic Client Technology: Java AppletDynamic Client Technology: Java Applet

The use of Java on the client is usually in the form of an appletThe use of Java on the client is usually in the form of an applet An applet are:An applet are:

more or less a user interface control that is placed in a Web pagemore or less a user interface control that is placed in a Web page made up of both system and custom classesmade up of both system and custom classes

A custom applet extends, or inherits, from the Java applet class.A custom applet extends, or inherits, from the Java applet class. Applets are referenced by a Web pageApplets are referenced by a Web page

need to be identified by a tag: <object> to identify:need to be identified by a tag: <object> to identify: the type of object (Java),the type of object (Java),

the name of the class file to load and run, and,the name of the class file to load and run, and,

optionally, the location, or URL, where the file or files can be found on the network.optionally, the location, or URL, where the file or files can be found on the network.

Examples:Examples:

<OBJECT codetype="application/java" classid="java:Bubbles.class"<OBJECT codetype="application/java" classid="java:Bubbles.class"codebase="http://www.waecodebase="http://www.wae--uml.org/javaclasses/"> Java applet that drawsuml.org/javaclasses/"> Java applet that drawsanimated bubbles. </OBJECT>animated bubbles. </OBJECT>

Page 17: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 17/36

September 2008 17IF3037

Dynamic Client Technology: ActiveX/COMDynamic Client Technology: ActiveX/COM

ActiveX is used to extend clientActiveX is used to extend client--side functionality in much the same way asside functionality in much the same way asJava applets doJava applets do

ActiveX is built on Microsoft's Component Object Model (COM)ActiveX is built on Microsoft's Component Object Model (COM) COM is an infrastructure in which developers can build components, each in theCOM is an infrastructure in which developers can build components, each in the

language of its choice, and share these objects to build bigger, more complexlanguage of its choice, and share these objects to build bigger, more complexsystemssystems

ActiveX is simply the brand name associated with a subset of COM technologiesActiveX is simply the brand name associated with a subset of COM technologies ActiveX and COM can be used interchangeably ActiveX and COM can be used interchangeably 

ActiveX object must be installed on the computer that it is to run onActiveX object must be installed on the computer that it is to run on Installing an ActiveX object typically means copying the DLL (dynamic link Installing an ActiveX object typically means copying the DLL (dynamic link 

library), EXE, or OCX file to the local hard drive and adding a few entries to thelibrary), EXE, or OCX file to the local hard drive and adding a few entries to theregistry registry 

Because ActiveX objects often have dependencies on other ActiveX objects orBecause ActiveX objects often have dependencies on other ActiveX objects orDLLs, these too need to be installed on the computerDLLs, these too need to be installed on the computer

ActiveX controls are placed in an HTML page with the <object> tag.ActiveX controls are placed in an HTML page with the <object> tag.

Page 18: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 18/36

September 2008 18IF3037

DistributedObjectDistributedObject Using distributed objects in a Web application can solve a lot of functionality Using distributed objects in a Web application can solve a lot of functionality 

and performance issues in Web application developmentand performance issues in Web application development The key is to incorporate the distributed object system without losing theThe key is to incorporate the distributed object system without losing the

main benefits of a Web architecturemain benefits of a Web architecture The most notable benefit of the Web is its ease of deployment.The most notable benefit of the Web is its ease of deployment.

To make effective use of distributed objects, there must be a way toTo make effective use of distributed objects, there must be a way to

automatically send to the client the objects and interfaces necessary for it toautomatically send to the client the objects and interfaces necessary for it toparticipate in the system without having the user stop the application andparticipate in the system without having the user stop the application andinstall special software.install special software.

Two principal distributed object infrastructures: Java's RMI and Microsoft'sTwo principal distributed object infrastructures: Java's RMI and Microsoft'sDCOM.DCOM. The goal of both is to hide the details of distributed communications and makeThe goal of both is to hide the details of distributed communications and make

themthem the responsibility of the infrastructure, not of the class designer or thethe responsibility of the infrastructure, not of the class designer or theimplementerimplementer

They work on theThey work on the principle of location transparency principle of location transparency , which states that the object, which states that the objectdesigner/implementer should never need to know the location of a given objectdesigner/implementer should never need to know the location of a given objectinstanceinstance

Page 19: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 19/36

September 2008 19IF3037

R MI/IIOPR MI/IIOP

The Java standard for distributed objectsThe Java standard for distributed objects Allows Java classes to communicate with other Java classes,Allows Java classes to communicate with other Java classes,

which might be located on different machineswhich might be located on different machines Java RMI is a set of APIs and a model for distributed objectsJava RMI is a set of APIs and a model for distributed objects

that allows developers to build distributed systems easily that allows developers to build distributed systems easily  The initial release of the RMI API usedThe initial release of the RMI API used Java serializationJava serialization and theand the

Java Remote Method ProtocolJava Remote Method Protocol (JRMP) to make method(JRMP) to make methodinvocations across a network look like local invocationsinvocations across a network look like local invocations

Today, the use of Today, the use of Internet InterInternet Inter--Orb ProtocolOrb Protocol (IIOP) as the(IIOP) as the

transport protocol is preferred, making it easier to integrate withtransport protocol is preferred, making it easier to integrate withnonnon--Java objectsJava objects a product of the CORBA initiativesa product of the CORBA initiatives builtbuilt--in support for this protocol is included in the latest releases of thein support for this protocol is included in the latest releases of the

Java Development Kit (JDK)Java Development Kit (JDK)

Page 20: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 20/36

September 2008 20IF3037

R MI Layer ArchitectureR MI Layer Architecture

Page 21: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 21/36

September 2008 21IF3037

R MI Layer Architecture (2)R MI Layer Architecture (2)

Introduces two new types of object: stub and skeleton.Introduces two new types of object: stub and skeleton.

The stub is a clientThe stub is a client--side object thatside object that represents the remote objectrepresents the remote objectand executes on the client machineand executes on the client machine

The skeleton is responsible for managing all the details of being The skeleton is responsible for managing all the details of being remoteremote³ ³ responding to communications from objects onresponding to communications from objects onanother machineanother machine³ ³and exists on the server machineand exists on the server machine

You don't have to write the code for them yourself You don't have to write the code for them yourself  Automatically generated from a special compiler:Automatically generated from a special compiler: rmicrmic

This compiler creates the stub and skeleton classes from business objectsThis compiler creates the stub and skeleton classes from business objectsthat implement certain interfacesthat implement certain interfaces

For example, the rmic command would take the Java classFor example, the rmic command would take the Java class MyObjectMyObject asasan argument and produce class files of the forman argument and produce class files of the form MyObject_Skel.classMyObject_Skel.class andandMyObject_Stub.classMyObject_Stub.class

Page 22: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 22/36

September 2008 22IF3037

R MI in Web AppR MI in Web App

RMI is typically used as a communication mechanismRMI is typically used as a communication mechanismbetweenbetween an appletan applet andand an application serveran application server

The applet is part of a Web pageThe applet is part of a Web page require a Javarequire a Java--enabled Web browserenabled Web browser

all the classes necessary to invoke and to use remote objectsall the classes necessary to invoke and to use remote objectswill be downloaded to the client as necessary will be downloaded to the client as necessary 

Once the client applet is run, it can contact the remoteOnce the client applet is run, it can contact the remoteserver, request a remote object instance reference, andserver, request a remote object instance reference, and

begin to invoke methods on it as if it were a local objectbegin to invoke methods on it as if it were a local objectinstance.instance. All marshalling of protocols is handled by the stub andAll marshalling of protocols is handled by the stub and

skeleton classes and the RMI infrastructureskeleton classes and the RMI infrastructure

Page 23: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 23/36

September 2008 23IF3037

Applets using R MIApplets using R MI

Page 24: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 24/36

September 2008 24IF3037

DCOM (Distributed COM)DCOM (Distributed COM) Microsoft's solution to the distributedMicrosoft's solution to the distributed--object problemobject problem

an extension to the popular Component Object Model (COM)an extension to the popular Component Object Model (COM)

Isolates the object developer from the details of distributing an objectIsolates the object developer from the details of distributing an object Gives the object developer independence from the distributedGives the object developer independence from the distributed--objectobject

infrastructureinfrastructure COM object implementations areCOM object implementations are assigned special class identifiersassigned special class identifiers (CLSID)(CLSID)

Clients who want instances of a particular COM object, request them with theClients who want instances of a particular COM object, request them with theCLSID from the operating systemCLSID from the operating system

When the client machine has the DCOMWhen the client machine has the DCOM--supporting facilities installed, it issupporting facilities installed, it ispossible for these objects to be located on a remote serverpossible for these objects to be located on a remote server

When a client creates an object instance, the following happens:When a client creates an object instance, the following happens: The client calls CoCreateInstance() on a CLSID supported by a local serverThe client calls CoCreateInstance() on a CLSID supported by a local server

The DCOM runtime, working with the SCM (service control manager), determinesThe DCOM runtime, working with the SCM (service control manager), determineswhether the requested local server is running and can be connected towhether the requested local server is running and can be connected to

The client is provided with a reference to an interface proxy to the object.The client is provided with a reference to an interface proxy to the object.

If an existing instance of the object is available, it will be used; otherwise, a new If an existing instance of the object is available, it will be used; otherwise, a new instance is createdinstance is created

Page 25: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 25/36

September 2008 25IF3037

Overview of DCOM ArchitectureOverview of DCOM Architecture

Page 26: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 26/36

September 2008 26IF3037

DCOM Architecture (2)DCOM Architecture (2)

Uses a scheme similar to RMI and CORBAUses a scheme similar to RMI and CORBA

creating proxy and stub objects to act as interfacescreating proxy and stub objects to act as interfacesbetween the client program, or server objectbetween the client program, or server objectimplementation, and the COM infrastructureimplementation, and the COM infrastructure

The existence of these objects, invisible to theThe existence of these objects, invisible to the

implementer, is provided by DCOMimplementer, is provided by DCOM

Page 27: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 27/36

September 2008 27IF3037

DCOM in Web AppDCOM in Web App

Web pages contain ActiveX controlsWeb pages contain ActiveX controls

downloaded to the client and executeddownloaded to the client and executed

Along with these controls, proxy objects can beAlong with these controls, proxy objects can bedownloaded and registered to point todownloaded and registered to point toimplementation objects on the appropriateimplementation objects on the appropriate

application serverapplication server

Page 28: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 28/36

September 2008 28IF3037

Use of distributed objects in a Web AppUse of distributed objects in a Web App

Page 29: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 29/36

September 2008 29IF3037

XMLXML

An XMLAn XML--formatted document is a text document that defines a hierarchicalformatted document is a text document that defines a hierarchicalcollection of elements.collection of elements. An element is one part of a document and usually contains a textual valueAn element is one part of a document and usually contains a textual value An element can have child elements and thus form a hierarchy An element can have child elements and thus form a hierarchy 

Every XML document begins with one root elementEvery XML document begins with one root element

Elements can be enhanced with attributes, which are just key/value pairsElements can be enhanced with attributes, which are just key/value pairs Elements have bodies that can contain freeElements have bodies that can contain free--form text, with some restrictionsform text, with some restrictions

XML offers the basic rules for formatting generic documentsXML offers the basic rules for formatting generic documents simple parsers can read and validate their contentssimple parsers can read and validate their contents

with the availability of free parsers, development teams are more likely to adoptwith the availability of free parsers, development teams are more likely to adoptXML document structures as a standardXML document structures as a standard

Most content of an XML document is textualMost content of an XML document is textual elements of the document can point to, but not directly contain, nontextualelements of the document can point to, but not directly contain, nontextual

resources, such as images or applicationsresources, such as images or applications

By describing documents with XML, generic XML parsers can be used toBy describing documents with XML, generic XML parsers can be used toextract the document's structureextract the document's structure

Page 30: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 30/36

September 2008 30IF3037

XMLXML -- exampleexample

<address><address>

<street>123 Pine Rd.</street><street>123 Pine Rd.</street>

<city>Lexington</city><city>Lexington</city><state>SC</state><state>SC</state>

<zip>19072</zip><zip>19072</zip>

</address></address>

Page 31: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 31/36

September 2008 31IF3037

Web ServicesWeb Services

A collection of functions packaged and published on aA collection of functions packaged and published on anetwork for use by other client programs.network for use by other client programs. From the highest levels of abstraction, a Web service isFrom the highest levels of abstraction, a Web service is

simply another type of remote procedure call (RPC).simply another type of remote procedure call (RPC).

The difference is Web services make RPC practical by The difference is Web services make RPC practical by providing a set of standardsproviding a set of standards for discovering and invoking thefor discovering and invoking theservicesservices

The standards:The standards: SOAPSOAP UDDIUDDI

WSDLWSDL

Page 32: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 32/36

September 2008 32IF3037

SOA PSOA P

Simple Object Access ProtocolSimple Object Access Protocol Built on top of XMLBuilt on top of XML

a SOAP message is simply an XMLa SOAP message is simply an XML--formatted document that validatesformatted document that validatesagainst a certain DTD or schema.against a certain DTD or schema.

When used with HTTP, SOAP messagesWhen used with HTTP, SOAP messages³ ³documentsdocuments³ ³can becan besent to Web servers, which invoke the specified function definedsent to Web servers, which invoke the specified function definedby the Web service.by the Web service.

The full specification for SOAP 1.1 can be found atThe full specification for SOAP 1.1 can be found athttp://www.w3.org/TR/SOAPhttp://www.w3.org/TR/SOAP..

A SOAP message consists of:A SOAP message consists of: a mandatory SOAP envelope; is the top element of the XML documenta mandatory SOAP envelope; is the top element of the XML document an optional SOAP header; is a way messages can be extended in thean optional SOAP header; is a way messages can be extended in the

future with prior knowledgefuture with prior knowledge a mandatory SOAP body a mandatory SOAP body 

Page 33: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 33/36

September 2008 33IF3037

UDDIUDDI

Universal Description, Discovery, and IntegrationUniversal Description, Discovery, and Integration

A mechanism for publishing and describing WebA mechanism for publishing and describing Webservices to potential clientsservices to potential clients

Is a set of replicated registries of information aboutIs a set of replicated registries of information aboutWeb services on the network.Web services on the network.

Registration of a service involves four core data structureRegistration of a service involves four core data structuretypes: business information, service information, binding types: business information, service information, binding 

information, and specification informationinformation, and specification information

Page 34: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 34/36

September 2008 34IF3037

WSDLWSDL

Web Services Description LanguageWeb Services Description Language A more detailed specification of the SOAP interfaceA more detailed specification of the SOAP interface

A WSDL specification describes in detail how to invoke a WebA WSDL specification describes in detail how to invoke a Webservice and what to expect when it respondsservice and what to expect when it responds

A WSDL description defines a Web service as a collection of A WSDL description defines a Web service as a collection of network end points, or portsnetwork end points, or ports Each port defines a collection of operations that can be invoked.Each port defines a collection of operations that can be invoked.

Each operation includes a set of input and output messages: theEach operation includes a set of input and output messages: theparameters.parameters.

A binding maps a port type to a specific protocol, HTTP, and dataA binding maps a port type to a specific protocol, HTTP, and dataformat, SOAP.format, SOAP.

A port instantiates a port type and binding at a specific network address.A port instantiates a port type and binding at a specific network address.

Page 35: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 35/36

September 2008 35IF3037

WS in the development and runWS in the development and run--time environmenttime environment

Page 36: Introduction to App. Web

8/7/2019 Introduction to App. Web

http://slidepdf.com/reader/full/introduction-to-app-web 36/36

September 2008 36IF3037

Development of Web ServicesDevelopment of Web Services