Chapter 15 PowerPoint Slides - Computer Information Systems

Report
eCommerce and Database Systems
Transparencies
Chapter 15 - Objectives
 What eCommerce is.
 About general architecture of eCommerce
systems and where database systems fit in.
 About data management issues encountered
in interorganizational systems.
 About a general architecture for Web-database
integration.
 About some technologies for integrating Web
and databases .
 About XML.
©Pearson Education 2009
2
eCommerce
Distribution, buying, selling, and marketing of
physical and information goods and services
accomplished using computer networks such as
the Internet.
 Database systems play crucial role in eCommerce
systems by supporting functions such as catalog
search and browsing, order management,
payment systems, inventory management
systems, online marketing, CRM.
©Pearson Education 2009
3
eCommerce
 Business
activities
typically
categorized
according to individuals or organizations
participating in the transaction.
 ‘Business to Consumer’ or ‘B2C’.
 ‘Business to Business’ or‘B2B’.
 ‘Consumer to Consumer’ or ‘C2C’ or ‘P2P’ (eg.
eBay),
 Governments have also entered this chain
lending a ‘G’ component to these combinations.
©Pearson Education 2009
4
eCommerce - Size
 According to (Burns 2006), online consumer
spending (B2C travel and all other B2C online
retail) grew from US$117.2 billion in 2004 to
US$143.2 billion in 2005 worldwide.
 Forrester Research and eMarketer indicate this
market segment will grow to US$316 billion by
2010.
 Forrester also reports B2B (including EDI) grew
from US$2.8 trillion in 2004 to US$4.1 trillion in
2005 and could grow to US$6.8 trillion by 2007.
©Pearson Education 2009
5
eCommerce Systems
 Also considered a type of interorganizational
I.S., as they link IT resources between
organizations, typically using network services
on the Internet.
 Student buying a textbook online is using IT
resources of the online book retailer by connecting
to retailer’s Web site from their desktop PC (B2C).
 Automobile manufacturer may send orders for parts
from their purchase order management DBMS to a
supplier’s customer order DBMS by way of EDI over
the Internet (B2B).
©Pearson Education 2009
6
eCommerce – B2C Site
©Pearson Education 2009
7
eCommerce – B2B Site
©Pearson Education 2009
8
eCommerce – G2C Site
©Pearson Education 2009
9
eCommerce – C2C Site
©Pearson Education 2009
10
General Architecture for eCommerce Systems
©Pearson Education 2009
11
General Architecture for eCommerce Systems
 Large




organization (colored box) maintains
systems such as
accounting, inventory
management,
order
management,
human
resources, payroll.
Each system contains applications and a
DBMS/database, and potentially each system may
be provided by a different vendor.
Systems may be tightly integrated where a suite of
applications shares the same database schema.
Or systems may be loosely coupled perhaps
installed at different points in time. In this case
data may be copied from one system to another.
Systems are used directly by users internal to the
organization.
©Pearson Education 2009
12
General Architecture for eCommerce Systems
 Next logical step is to allow customers to browse
products & services and to place orders via a Web
site.
 Requires business to establish a Web server
system, an eCommerce system, and an online
payment system, such that:
 Web server interacts with Web browsers of the
external users.
 eCommerce system includes features to support
customer user registration, catalog searching and
browsing, product comparison, shopping cart, email list sign-up, and other typical eCommerce
functionality.
 Online payment system acts as a gateway that sends
out credit verification requests.
©Pearson Education 2009
13
General Architecture for eCommerce Systems
 In B2C, products or services being sold may have a
small unit value (such as songs, images, articles, or
cell phone ringtones).
 Given that processing a credit card transaction costs
about $0.25, purchasing a $0.50 article would not be
commercially sensible.
 In P2P cases, a participant’s low volume of
transactions would preclude setting up a credit card
processing system altogether (eg., consider a seller
who wants to auction off an antique on eBay).
 Micropayment systems such as PayPal and
Peppercoin have been developed to address these
situations.
©Pearson Education 2009
14
General Architecture for eCommerce Systems
 Further step business could take would be to
partially integrate their internal systems with
those of other businesses such as key suppliers to
form a supply chain.
 A B2B gateway would be used to link supplier’s
order management system, accounts receivables,
and shipping systems with the businesses’
purchasing, accounts payable, and receiving
systems.
 Such supply chain management systems can then
be used to more accurately schedule orders and
deliveries of raw materials and components
required for production of the final product.
©Pearson Education 2009
15
mCommerce
Accessing eCommerce products and services
using mobile devices.
 Include services enabled and/or delivered to
mobile devices such as a cell phone, PDA,
smartphone, or digital music player.
 Take advantage of faster and more robust wireless
data networks to deliver services directly to the
mobile device.
 Now have cell phones that can play movies, PDAs
that can access maps & directions and, in some
countries, cell phones that can be used to pay for
items such as soft drinks, food, and magazines.
©Pearson Education 2009
16
mCommerce
 According to Jupiter Research the revenues for
downloadable ringtones market reached US$450
million in 2005 and expected to grow to US$700
million by 2009.
 ‘Location aware’ services (“show me the closest
Indian food restaurant”) are a fast growing
segment of mCommerce.
 These services use location of customer as an
input to tailor search results, products,
advertising, and services delivered to their mobile
device.
©Pearson Education 2009
17
Critical Success Factors in eCommerce
 As ‘Dot-com bust’ of 2000/2001 proved, not all
eCommerce ventures survived.
 Of many lessons learned, developing robust
business models appears to be one of the main
success factors in any eCommerce venture.
 Needs to address market needs and competitive
risks, while remaining flexible and open to change
as technology and competition evolves in the
marketplace.
 Also, with competitors ‘just a click away’, having
robust and secure systems is a critical success
factor.
©Pearson Education 2009
18
Critical Success Factors in eCommerce
 eCommerce businesses that can harness Business
Intelligence and CRM systems and use them to
their advantage stand a much better chance of
attracting and retaining customers.
 While CRM systems support Customer side of B2C,
supply chain management systems support the
business side of B2B.
 Again, leveraging IT to effectively manage and
streamline the flow of materials can give
businesses a competitive advantage.
©Pearson Education 2009
19
Web-Database Integration
 Major task common to all eCommerce systems
centers on integration of organization’s Web site
with its internal database system(s).
 Consider different languages ‘spoken’ by the
respective components of such an integrated system
according to three-tier architecture.
 Web browser (such as IE or Firefox) makes its
requests to a Web server (such as Apache or IIS)
using HTTP.
 For example, if a user clicks on a link to display an
item from a catalog, HTTP request might look like:
GET /home/catalog/LOR3.html
©Pearson Education 2009
20
Web-Database Integration
 When Web server receives this request, it will look in





folder /home/catalog for file LOR3.html and send it
back to Web browser.
File would contain text marked up in HTML.
Small online stores may provide pre-written HTML
pages for each of their products (“static Web pages”).
For more than a few dozen items, managing HTML
pages will become difficult.
Integrating Web site with DBMS that stores products,
descriptions, pricing, and inventory status allows much
larger collection of products and services by turning
requests for Web pages into database queries.
Such pages are called dynamic Web pages, because the
content of the page is dynamically created upon
request.
©Pearson Education 2009
21
Web-Database Integration
 If underlying DBMS is relational, Web server must express
query using SQL. In response, DBMS will either return a
set of records, an acknowledgement that the query was
successful, or an error message.
 Based on this response, Web server will generate an
appropriate Web page and send it back to the Web
browser.
 For example, suppose a user clicks on a link to display a
list of all DVDs in a particular genre. HTTP request might
appear as:
GET /home/dvd_list.asp?genre=Action
©Pearson Education 2009
22
Web-Database Integration
 In this case, Web server will invoke a small
program, called a script, written in ASP and pass
along the parameter “genre=Action”.
 At Web server, this request will need to be
unpacked, formed into a SQL query, and
submitted to DBMS on database server.
 In response, DBMS will return a set of records to
Web server, which then must apply appropriate
HTML tags to the records so that they display
properly in Web browser.
©Pearson Education 2009
23
Web-Database Integration – More Detail
1.
2.
3.
4.
5.
6.
7.
Web browser packages up request and sends it via HTTP to
Web server.
Web server receives HTTP request and invokes appropriate
script (dvd_list.asp) on Web server passing along contents of
HTTP request using CGI standard.
Script on Web Server unpacks HTTP request, parses out
various parameters/values (genre=Action), and builds
appropriate SQL.
Script on Web server connects to DBMS on database server
and submits SQL.
DBMS executes SQL, packages up resulting records or
acknowledgement codes, and returns this to Web server.
Script on Web server receives results from database server and
formats results using HTML.
Finally, Web server sends HTML back to Web browser for
interpretation and display.
©Pearson Education 2009
24
Web-Database Integration Technologies
©Pearson Education 2009
25
Web-Database Integration Technologies
 Early approaches based on compiled languages such as C/C++,




plus scripting languages such as Perl, using steps described
earlier.
Provided freedom to customize interaction, but also required
most programming effort.
Over time, specialized scripting languages such as ASP, JSP,
ColdFusion, and PHP emerged.
Deploying such applications on an enterprise scale requires
another layer of refinement as legacy systems integration,
transaction processing, session management, security, and ability
to serve applications to a variety of mobile devices became
common requirements for Internet applications.
Development platforms such as IBM WebSphere, WebLogic from
BEA Systems, and Microsoft .NET Framework provide pre-built
components that can be assembled into larger Internet
applications.
©Pearson Education 2009
26
Examples of Web-Database Integration
Technologies - HTML
©Pearson Education 2009
27
dvd_list.asp Script
<!-- dvd_list.asp -->
<HTML><BODY><H3>The results of your query are</H3>
<TABLE BORDER>
<TR><TH>CatalogNo <TH> Title <TH> Genre <TH> Rating </TR>
<%
‘ Create a SQL Query using the q_genre field from the query form
strSQL = "SELECT catalogNo, title, genre, rating FROM dvd WHERE genre =
‘” & Request.Form("q_genre") & “'"
‘ Create a connection object and open the connection to a Microsoft
Access database
Set cnn = Server.CreateObject("ADODB.Connection")
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\mydatabase\stayhome.mdb"
‘ Create a query result set object to hold the query results
Set rstQuery = Server.CreateObject("ADODB.Recordset")
©Pearson Education 2009
28
‘ Create a query result set object to hold the query results
Set rstQuery = Server.CreateObject("ADODB.Recordset")
‘ Execute the query in the database and store the results
rstQuery.Open strSQL, cnn
‘ Loop through the query results and for each record print out the
record data
Do Until rstQuery.EOF
Response.Write "<TR><TD>" & rstQuery("catalogNo")
Response.Write "<TD>" & rstQuery("title")
Response.Write "<TD>" & rstQuery("genre")
Response.Write "<TD>" & rstQuery("rating")
rstQuery.MoveNext
Loop
%>
</TABLE>
</BODY>
</HTML>
©Pearson Education 2009
29
Examples of Web-Database Integration
Technologies - PHP
 PHP Hypertext Processor is an open source
scripting language that was developed in the mid
1990’s.
 Intended to be embedded within HTML pages.
When a PHP page is served, the HTML portions
are sent directly back to the Web browser,
however any code contained within special PHP
tags <?php and ?> are executed by the PHP parser
and the results of the execution are returned to
the Web browser.
©Pearson Education 2009
30
Examples of Web-Database Integration
Technologies - ASP
 Active Server Pages (ASP) is a scripting language




developed by Microsoft that works within Microsoft’s IIS
Web server.
Latest version, ASP.NET, is incorporated into Microsoft’s
.NET framework.
As with other server-side scripting languages such as JSP
and PHP, an ASP page consists of HTML tags with
scripting code placed inside the special HTML tags <% and
%>.
When a request arrives for an ASP page, HTML portions
are returned to the Web browser directly while the ASP
code is executed on the server and the results returned to
the Web browser.
ASP code can be written in a number of different
languages including Microsoft’s VBScript and JScript.
©Pearson Education 2009
31
Examples of Web-Database Integration
Technologies - Coldfusion
 ColdFusion is an extension to HTML originally developed
by Allaire Software, later purchased by Macromedia and
who has recently been acquired by Adobe.
 ColdFusion Markup Language (CFML) consists of a
collection of special HTML tags (all start with <CF) that
are mixed within standard HTML to interact with the
ColdFusion Server to access databases and other server
resources.
 When Web server receives a request for a CFML page with
a ‘.cfm’ extension, ColdFusion Server handles request,
interprets the CFML tags within the document and
returns resulting HTML to the Web server for delivery to
the Web browser.
©Pearson Education 2009
32
Examples of Web-Database Integration
Technologies – Ruby on Rails
 Ruby is an OO programming language developed in




Japan in the early 1990’s.
Rails (often referred to as ‘Ruby on Rails’) is a
framework for creating database-driven Web and
interactive Web applications using the Ruby
language.
In the Rails framework, objects are created
automatically for each database table along with a
collection of default methods for retrieving,
displaying, editing, and deleting database records.
These existing methods can be extended relatively
easily to perform custom operations on the data.
When establishing a new Rail application, the
database connection is specified once in a
configuration file named ‘database.yml’ so that all
parts of the application can work using the same
connection.
33
©Pearson Education 2009
XML
A meta-language (a language for describing other
languages) that enables designers to create their
own customized tags to provide functionality not
available with HTML.
 Most documents on Web currently stored and
transmitted in HTML.
 One strength of HTML is its simplicity.
Simplicity may also be one of its weaknesses,
with users wanting tags to simplify some tasks
and make HTML documents more attractive and
dynamic.
©Pearson Education 2009
34
XML
 To satisfy this demand, vendors introduced some
browser-specific HTML tags, making it difficult
to develop sophisticated, widely viewable Web
documents.
 W3C has produced XML, which could preserve
general application independence that makes
HTML portable and powerful.
©Pearson Education 2009
35
XML
 XML is a restricted version of SGML, designed
especially for Web documents.
 SGML allows document to be logically separated into
two: one that defines the structure of the document
(DTD), other containing the text itself.
 By giving documents a separately defined structure,
and by giving authors ability to define custom
structures, SGML provides extremely powerful
document management system.
 However, SGML has not been widely adopted due to
its inherent complexity.
©Pearson Education 2009
36
XML
 XML attempts to provide a similar function to
SGML, but is less complex and, at same time,
network-aware.
 XML retains key SGML advantages of
extensibility, structure, and validation.
 Since XML is a restricted form of SGML, any fully
compliant SGML system will be able to read XML
documents (although the opposite is not true).
 XML is not intended as a replacement for SGML
or HTML.
©Pearson Education 2009
37
Advantages of XML
 Simplicity
 Open standard and platform/vendor-independent
 Extensibility
 Reuse
 Separation of content and presentation
 Improved load balancing
 Support for the integration of data from multiple vendors
 Ability to describe data from a wide variety of applications
 More advanced search engines
 New opportunities.
©Pearson Education 2009
38
Potential Weaknesses of XML
 Requires new software tools and training
 Size and complexity of syntax
 Limited data types in native XML
 Storing
XML documents
OODBMS can be difficult.
©Pearson Education 2009
in
RDBMS
and
39
XML - Example
©Pearson Education 2009
40
XML - Elements
 Elements, or tags, are most common form of
markup.
 First element must be a root element, which can
contain other (sub)elements.
 XML document must have one root element
(<STAFFLIST>. Element begins with start-tag
(<STAFF>) and ends with end-tag (</STAFF>).
 XML elements are case sensitive
 An element can be empty, in which case it can be
abbreviated to <EMPTYELEMENT/>.
 Elements must be properly nested.
©Pearson Education 2009
41
XML - Attributes
 Attributes are name-value pairs that contain
descriptive information about an element.
 Attribute is placed inside start-tag after
corresponding element name with the attribute
value enclosed in quotes.
<STAFF branchNo = “S1500”>
 Could
also have represented branch as
subelement of STAFF.
 A given attribute may only occur once within a
tag, while subelements with same tag may be
repeated.
©Pearson Education 2009
42
XML – Other Sections
 XML declaration: optional at start of XML
document.
 Entity references: serve various purposes, such as
shortcuts to often repeated text or to distinguish
reserved characters from content.
 Comments: enclosed in <!– and --> tags.
 CDATA sections: instructs XML processor to
ignore markup characters and pass enclosed text
directly to application.
 Processing instructions: can also be used to
provide information to application.
©Pearson Education 2009
43
Document Type Definitions (DTDs)
Defines the valid syntax of an XML document.
 Lists element names that can occur in document,
which elements can appear in combination with
which other ones, how elements can be nested,
what attributes are available for each element
type, and so on.
 Term vocabulary sometimes used to refer to the
elements used in a particular application.
 Note: Grammar not specified using XML.
 Although optional, DTD is recommended for
document conformity.
©Pearson Education 2009
44
Document Type Definitions (DTDs)
©Pearson Education 2009
45
Document Type Definitions (DTDs)
 Identify the rules for elements that can occur in
the XML document. Options for repetition are:
 * indicates zero or more occurrences for an element;
 + indicates one or more occurrences for an element;
 ? indicates either zero occurrences or exactly one
occurrence for an element.
 Name with no qualifying punctuation must occur
exactly once.
 Commas between element names indicate they
must occur in succession; if commas omitted,
elements can occur in any order.
©Pearson Education 2009
46
Document Type Definitions (DTDs)
 Identify which elements may have attributes,
what attributes they may have, what values
attributes may hold, plus optional defaults.
Some types:
 CDATA: character data, containing any text.
 ID: used to identify individual elements in
document (ID is an element name).
©Pearson Education 2009
47
Document Type Definitions (DTDs)
 Two levels of document processing: well-formed
and valid.
 Non-validating processor ensures an XML
document is well-formed before passing
information on to application.
 XML document that conforms to structural and
notational rules of XML is considered wellformed; e.g.:
 document must start with <?xml version “1.1”>;
 all elements must be within one root element;
 elements must be nested in a tree structure without any
overlap;
 Validating processor will not only check that an XML
document is well-formed but that it also conforms to
a DTD, in which case XML document is considered
valid.
©Pearson Education 2009
48
XML Schema
 DTDs have number of limitations:
 it is written in a different (non-XML) syntax;
 it has no support for namespaces;
 it only offers extremely limited data typing.
 XML Schema is more comprehensive method of
defining content model of an XML document.
 Additional expressiveness will allow Web
applications to exchange XML data more
robustly without relying on ad hoc validation
tools.
©Pearson Education 2009
49
XML Schema – Major Features
 complexType: named element that can contain other elements







or other complexTypes.
sequence: named element that contains an ordered set of
subelements.
simpleType: named element with a simple data type (such as
boolean, string, date, or decimal).
Cardinality: element can be specified with minOccurs and
maxOccurs indicating minimum and maximum occurrences
allowed.
References: such as <xs:element ref = “STAFFNO”/>, can be used
to refer to other elements defined elsewhere in same XML
document.
Defining new data types.
Defining groups of elements and attributes.
Constraints on elements and attributes including uniqueness of
values among a set of elements or attributes, as well as key
constraints that require a non-null, as well as unique value.
©Pearson Education 2009
50
XML Schema - Example
©Pearson Education 2009
51
XSL (eXtensible Stylesheet Language)
 In HTML, default styling is built into browsers as
tag set for HTML is predefined and fixed.
 Cascading
Stylesheet
Specification
(CSS)
provides alternative rendering for tags. Can also
be used to render XML in a browser but cannot
make structural alterations to a document.
 XSL created to define how XML data is rendered
and to define how one XML document can be
transformed into another document.
©Pearson Education 2009
52
XSLT (XSL Transformations)
 Subset of XSL, XSLT is a language in both markup
and programming sense, providing a mechanism
to transform XML structure into either another
XML structure, HTML, or any number of other
text-based formats (such as SQL).
 XSLT’s main ability is to change the underlying
structures rather than simply the media
representations of those structures, as with CSS.
©Pearson Education 2009
53
XSLT (XSL Transformations)
 XSLT
is important because it provides a
mechanism for dynamically changing the view of
a document and for filtering data.
 Also robust enough to encode business rules and
it can generate graphics (not just documents)
from data.
 Can even handle communicating with servers
(scripting modules can be integrated into XSLT)
and can generate the appropriate messages
within body of XSLT itself.
©Pearson Education 2009
54
XHTML
 Reformulation of HTML 4.01 in XML 1.0 and is
intended to be next generation of HTML.
 Basically a stricter and cleaner version of HTML;
e.g.:
 tags and attributes must be in lowercase;
 all XHTML elements must be have an end-tag;
 attribute values must be quoted and minimization
is not allowed;
 ID attribute replaces the name attribute;
 documents must conform to XML rules.
©Pearson Education 2009
55
XQuery
 XQuery derived from XML query language called
Quilt, which has borrowed features from XPath,
XML-QL, SQL, OQL, Lorel, XQL, and YATL.
 Like OQL, XQuery is a functional language in
which a query is represented as an expression.
 XQuery supports several kinds of expression,
which can be nested (supporting notion of a
subquery).
©Pearson Education 2009
56
XQuery Path Expressions
 Uses syntax of XPath.
 In XQuery, result of a path expression is ordered
list of nodes representing data.
 Result of path expression may contain duplicate
values.
 Can begin with the function document(string),
which refers to a named XML document.
©Pearson Education 2009
57
XQuery Path Expressions - Examples
Find staff number of first member of staff in our
XML document.
doc(“staff_list.xml”)/STAFF[1]//STAFFNO
 Three steps:
 first opens staff_list.xml and returns its document
node;
 second locates first STAFF element that is child of
root element;
 Third
finds STAFFNO elements occurring
anywhere within this STAFF element.
©Pearson Education 2009
58
XQuery Path Expressions - Examples
Find staff numbers of first two members of staff.
doc(“staff_list.xml”)/STAFF[1 TO 2]/STAFFNO
©Pearson Education 2009
59
XQuery Path Expressions - Examples
Find names of staff at distribution center D001.
doc(“staff_list.xml”)/STAFF[DCENTERNO =“D001”]/NAME
 Four steps:
 first two as before;
 third consists of predicate that restricts STAFF
elements to those with DCENTERNO attribute =
D001;
 Fourth selects NAME element(s) occurring
anywhere within these elements.
©Pearson Education 2009
60
XQuery – FLWR Expressions
 FLWR (“flower”) expression is constructed from FOR,





LET, WHERE, RETURN clauses.
FLWR expression starts with one or more FOR or LET
clauses in any order, followed by optional WHERE
clause, and required RETURN clause.
FOR clause is used to loop over collection of
elements so each element can be inspected
LET clause is used to reference a collection of
elements for purposes of summarizing the set of
data.
WHERE clause filters elements in the XML document
according to some condition.
RETURN clause is similar to the SELECT clause of
SQL.
©Pearson Education 2009
61
XQuery – FLWR Expressions
List staff at center D001 with salary > $15,000.
FOR $S IN document("staff_list.xml")//STAFF
WHERE $S/SALARY > 15000 AND $S[DCENTERNO = D001]
RETURN $S/STAFFNO
 Note, predicate seems to compare an element
(SALARY) with a value (15000). In fact, ‘=’ operator
extracts typed value of element resulting in a
decimal value in this case, which is then compared
with 15000.
©Pearson Education 2009
62
XQuery – FLWR Expressions
List each center and average salary at the center.
FOR $D IN
distinct-values(doc(“staff_list.xml”)//DCENTERNO))
LET $avgSalary := avg(doc(“staff_list.xml”)//
STAFF[DCENTERNO = $D]/SALARY)
RETURN
<DCENTER>
< DCENTERNO>{ $D/text() }</ DCENTERNO>,
<AVGSALARY>$avgSalary</AVGSALARY>
</ DCENTER>
©Pearson Education 2009
63
XQuery – FLWR Expressions
List centers that have more than 20 staff.
<LARGECENTERS>
FOR $D IN
distinct-values(doc(“staff_list.xml”)//DCENTERNO)
LET $S := doc(“staff_list.xml”)/STAFF/[DCENTERNO = $D]
WHERE count($S) > 20
RETURN
<BRANCHNO>{ $B/text() }</BRANCHNO>
</LARGECENTERS>
©Pearson Education 2009
64
SQL/XML
 SQL:2003 has extensions to enable publication of
XML (commonly referred to as SQL/XML):
 new native XML data type, XML, which allows XML
documents to be treated as relational values in
columns of tables, attributes in user-defined
types, variables, and parameters to functions;
 set of operators for the type;
 implicit set of mappings from relational data to
XML.
 Standard does not define any rules for the inverse
process; i.e., shredding XML data into an SQL form,
with some minor exceptions.
©Pearson Education 2009
65
SQL/XML Functions
 XMLELEMENT(), creates an XML element from a




named column name. Works on one column at a
time.
XMLATTRIBUTES(), creates an XML attribute from a
column value using the column name as the name of
the attribute. Works on one column at a time.
XMLFOREST(), creates a list of XML elements from a
set of column names.
XMLCONCAT(), concatenates two or more XML
values into one XML element.
XMLAGG(), aggregates a collection of values into one
XML element.
©Pearson Education 2009
66
Web Services
Software
system
designed
to
support
interoperable machine-to-machine interaction
over a network.
 Have recently been established as important paradigm in
building applications and processes for integration of
heterogeneous applications in the future.
 Based on open standards and focus on communication
and collaboration among people and applications.
 Unlike other Web-based applications, Web services have
no user interface and are not targeted for browsers.
Instead, they consist of reusable software components
designed to be consumed by other applications, such as
traditional client applications, Web-based applications, or
other Web services.
©Pearson Education 2009
67
Web Services
 Common example is a stock quote facility, which
receives request for current of a specified stock
and responds with the requested price.
 Second example, Microsoft has produced a
MapPoint Web service that allows high quality
maps, driving directions, and other location
information to be integrated into a user
application, business process, or Web site.
©Pearson Education 2009
68
Web Services
 Based on use of widely accepted technologies and
standards; eg:
 XML.
 SOAP (Simple Object Access Protocol) protocol,
based on XML, is used for communication over the
Internet.
 WSDL
(Web Services Description Language)
protocol, again based on XML, is used to describe the
Web service. WSDL adds a layer of abstraction
between the interface and the implementation,
providing a loosely-coupled service for future
flexibility.
 UDDI (Universal Discovery, Description, and
Integration) protocol is used to register the Web
service for prospective users.
©Pearson Education 2009
69
Web Services
©Pearson Education 2009
70
SOAP
 An XML-based messaging protocol that defines a
set of rules for structuring messages.
 Protocol can be used for simple one-way
messaging but also useful for performing RPCstyle request-response dialogues.
 Not tied to any particular operating system or
programming language nor any particular
transport protocol, although HTTP is popular.
 Important advantage of SOAP is that most
firewalls allow HTTP to pass right through,
facilitating point-to-point SOAP data exchanges.
©Pearson Education 2009
71
SOAP
 SOAP message is an XML document containing:
 A required Envelope element that identifies the
XML document as a SOAP message.
 An optional Header element that contains
application specific information such as
authentication or payment information.
 A required Body Header element that contains call
and response information.
 An optional Fault element that provides
information about errors that occurred while
processing message.
©Pearson Education 2009
72
SOAP
©Pearson Education 2009
73
WSDL
 XML-based protocol for defining a Web service.
 Specifies location of a service, operations service
exposes, SOAP messages involved, and comms
protocol used to talk to service.
 Notation that a WSDL file uses to describe
message formats is typically based on XML
Schema.
 Published WSDL descriptions can be used to
obtain information about available Web services.
©Pearson Education 2009
74
Web Services - Examples
 Google Applications Programming interface, which
allows other programmers to access Google search
results by submitting Web services requests.
 Amazon Web Service (AWS) provides access to
Amazon.com’s products catalog as well as a variety of
other services. For example, any retailer can publish
their products and make them available within
Amazon’s catalog for search, product comparison
and so on.
 OpenSearch, supported by a9.com an aggregate
search engine developed by Amazon.com, provides a
set of formats and Web services used for sharing
search results.
©Pearson Education 2009
75

similar documents