Lecture5 Web Services
-
Upload
srinivasa-helavar -
Category
Documents
-
view
214 -
download
0
Transcript of Lecture5 Web Services
-
7/31/2019 Lecture5 Web Services
1/61
Web Services Technology
COMP3150/7700 E-technology
Architectures, Tools and Applications(Semester 1, 2010/11)
-
7/31/2019 Lecture5 Web Services
2/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 2
Some software functional block
Location, platform, code are irrelevant
Loosely coupled software components that encapsulatediscrete functionality and that are accessible over standardInternet protocols.The Stencil Group
Web Services are a new breed of web application. They areself-contained, self-describing, modular applications that can bepublished, located, and invoked across the Web. IBM
Web services are a form of distributed information systemGustavo Alonso
Web services: concepts, architectures and applications
-
7/31/2019 Lecture5 Web Services
3/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 3
Outline
Client-Server to 3-Tier
Middleware Technology
Web services
-
7/31/2019 Lecture5 Web Services
4/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 4
Outline
Client-Server to 3-Tier
Middleware Technology
Web Services
-
7/31/2019 Lecture5 Web Services
5/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 5
Different Layers of an
Information System
Client
Presentation Layer
Application Logic Layer
Res. Management LayerInformation
System
-
7/31/2019 Lecture5 Web Services
6/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 6
Different Layers of an
Information System Conceptual Layers of an IS
Presentation Layer
For interacting with external entities (clients) for receivingrequests & sending responses.
Application logic Layer
For system/process integration, business rule/logicexecution,
References for business rules:
http://www.businessrulesgroup.org/
Resource Management Layer
Data sources from databases or other informationsystems, specialized computing services,
Client
Presentation Layer
Application Logic Layer
Res. Management Layer
Information
System
-
7/31/2019 Lecture5 Web Services
7/61COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 7
From 1-tier to 3-tier
UI
Presentation Layer
Application Logic Layer
Res. Management Layer
UI
Presentation Layer
Application Logic Layer
Res. Management Layer
UI
Presentation Layer
Application Logic Layer
Res. Management Layer
1-tier 2-tier 3-tier
Middleware
Client Client
Server
-
7/31/2019 Lecture5 Web Services
8/61COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 8
Application Framework
Computer and Communication Facility
System Service
Data Repository
Control Integration
Task Management
Presentation Interface
User Interface
Hardware
Enterpriseware
Middleware
Userware
APPLICATI
ON
-
7/31/2019 Lecture5 Web Services
9/61COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 9
Integration: 2-tier Approach(data-oriented)
UI
PresentationLayer 1
Application Logic Layer
Res. Management Layer
Rice A
Rice B
Rice B
Drink C
Drink C
Food D
Food D
Food E
combined catalog
e.g., html or xml
e.g., html or xml
All logics are embedded
in your web programs
(e.g., *.asp, *.php, )
http://www.answers.com/topic/wellcome-new-gifhttp://www1.parknshop.com/WebShop/Home.do;jsessionid=G0m15HQ006Do0LjY9RzVxycOM87NUzp2ODC77WiV5e1Sv41O6oLW!-666216154http://www1.parknshop.com/WebShop/Home.do;jsessionid=G0m15HQ006Do0LjY9RzVxycOM87NUzp2ODC77WiV5e1Sv41O6oLW!-666216154http://www1.parknshop.com/WebShop/Home.do;jsessionid=G0m15HQ006Do0LjY9RzVxycOM87NUzp2ODC77WiV5e1Sv41O6oLW!-666216154http://www1.parknshop.com/WebShop/Home.do;jsessionid=G0m15HQ006Do0LjY9RzVxycOM87NUzp2ODC77WiV5e1Sv41O6oLW!-666216154http://www1.parknshop.com/WebShop/Home.do;jsessionid=G0m15HQ006Do0LjY9RzVxycOM87NUzp2ODC77WiV5e1Sv41O6oLW!-666216154 -
7/31/2019 Lecture5 Web Services
10/61COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 10
Integration: 3-tier Approach(data-oriented)
Client
Presentation Layer
Rice A
Rice B
Rice B
Drink C
Drink C
. . .
Application Logic Layer
Res. Management Layer
html or xml
e.g., html or xml
Eg., integration rules &
exception handling rules
(declarative)
e.g., The rule can be:
If a source is not
responding, showservice not available
and send a notification
e-mail to Manager A
and .
e.g., ODBC/Vendor_Specific_Protocol
Eg., database
management systemOracle, DB2
http://www.answers.com/topic/wellcome-new-gifhttp://www1.parknshop.com/WebShop/Home.do;jsessionid=G0m15HQ006Do0LjY9RzVxycOM87NUzp2ODC77WiV5e1Sv41O6oLW!-666216154http://www1.parknshop.com/WebShop/Home.do;jsessionid=G0m15HQ006Do0LjY9RzVxycOM87NUzp2ODC77WiV5e1Sv41O6oLW!-666216154http://www1.parknshop.com/WebShop/Home.do;jsessionid=G0m15HQ006Do0LjY9RzVxycOM87NUzp2ODC77WiV5e1Sv41O6oLW!-666216154http://www1.parknshop.com/WebShop/Home.do;jsessionid=G0m15HQ006Do0LjY9RzVxycOM87NUzp2ODC77WiV5e1Sv41O6oLW!-666216154 -
7/31/2019 Lecture5 Web Services
11/61COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 11
Integration: 2-tier Approach(computation-oriented)
UI
PresentationLayer 1
Application Logic Layer
Res. Management Layer
e.g., student essays
(*.doc)e.g., analysis results
in html/xml
Logics for analysis are
embedded in the web
programs.
e.g., html or xml
-
7/31/2019 Lecture5 Web Services
12/61COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 12
Integration: 3-tier Approach(computation-oriented)
UI
Presentation Layer
Application Logic Layer
Res. Management Layer
Eg., integration via
message queues
Eg., database
management systemOracle, DB2
e.g., JMS/Vendor-Specific-Protocol
e.g., student essays
(*.doc)e.g., html or xml
Products that support
Java Message Service:
Apache ActiveMQ,
Oracle AQ, IBM MQ,
etc.
-
7/31/2019 Lecture5 Web Services
13/61COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 13
Outline
Client-Server to 3-Tier
Middleware Technology
Web Services
-
7/31/2019 Lecture5 Web Services
14/61COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 14
Middleware Technologies 101
RPC -> Workflow
-
7/31/2019 Lecture5 Web Services
15/61COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 15
Middleware Technologies:
RPC -> Workflow Middleware to handle the execution complexity fordistributed
applications
Remote Procedure Call (RPC) a process in a computer invokes a process in another
synchronous (wait until the response is ready)
Going beyond simple RPC Transactional
with commit and rollback handling (error handling)
Message-oriented (e.g., Oracle AQ) asynchronous, enabled by message queue
Message-brokering (e.g., Oracle Message Broker) from O(nxn) to O(n) communication
support logic-dependent routing
Workflow Management System (e.g., Oracle Workflow) process flow status control
Workflow --The automation of a business process, in whole or part,during which documents, information or tasks are passed from oneparticipant (resource or human or machine) to another for action,according to a set of procedural rules.
-
7/31/2019 Lecture5 Web Services
16/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 16
Web ProcessesWorkflows Distributed
Workflows
GlobalEnterprise Inter-Enterprise
B2B E-Services
Globalization of Processes
Processes driving the Networked Economy
EAI
http://lsdis.cs.uga.edu/lib/download/SAA99.pdfhttp://lsdis.cs.uga.edu/lib/download/SAA99.pdf -
7/31/2019 Lecture5 Web Services
17/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 17
Outline
Client-Server to 3-Tier
Middleware Technology 101
Web Services
-
7/31/2019 Lecture5 Web Services
18/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 18
Software as Services?
Examples?
S i O i t d A hit t
-
7/31/2019 Lecture5 Web Services
19/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 19
Service-Oriented Architecture
(SOA)
3 fundamental operations:
publish
find bind
-
7/31/2019 Lecture5 Web Services
20/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 20
Web Services (1) What is
Web Services
Software systems designed to support interoperablemachine-to-machine interaction over a network.(W3C)
Messages in-between are XML-based Internet based Remote Procedure Call (RPC)
Request/Response (so, synchronous essentially)
Web Service Description Language (WSDL)
A XML-based markup language for specifying interfaces
for consuming services over the network.
-
7/31/2019 Lecture5 Web Services
21/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 21
Web Services (2) What is
UDDI
Universal Description, Discovery and Integration
A platform-independent XML-based registry for
businesses worldwide to list themselves on the Internet. SOAP
Simply Object Access Protocol
A protocol forexchanging XML-based messages over
computer networks by HTTP/HTTPS.
-
7/31/2019 Lecture5 Web Services
22/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 22
How can UDDI be Used
industry published an UDDI standard forflightrate checking and reservation;
airlines register their services into an UDDIdirectory.
Travel agencies search the UDDI directory to
find the airline's reservation interface. Thetravel agency can communicate with the
service immediately because it uses a well-
defined reservation interface.
-
7/31/2019 Lecture5 Web Services
23/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 23
Who is Supporting UDDI?
UDDI is supported by all major platform and
software providers, like Dell, Fujitsu, HP,
Hitachi, IBM, Intel, Microsoft, Oracle, SAP,and Sun.
Over 220 companies are members of theUDDI community.
S i O i t d A hit t
-
7/31/2019 Lecture5 Web Services
24/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 24
Service-Oriented Architecture
(SOA)
3 fundamental operations:
publish
find bind
Implement a web service
Define its WSDL
1. Look up service broker for web services
2. Develop a client program that can
communicate with the web service (basedon the WSDL description) and then
consume the web service.
Store the meta data of web services,
including where to locate the WSDLdescriptions and support search.
1
2 3
-
7/31/2019 Lecture5 Web Services
25/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 25
Web Services Roles
Service provider Implements the services
Makes the services available on the web
Service requestor Consumes the web services
Service registry Logically centralized registry provides a central place
where allows developers to publish new services orsearch (or discover) existing ones
-
7/31/2019 Lecture5 Web Services
26/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 26
Web Services Procedures (1)
Service
Requester
Service
RegistryUDDI
Service
Provider
Register
WS Search &Discovery
SOAP Request
Retrieve WSDL Documents
SOAP Response
-
7/31/2019 Lecture5 Web Services
27/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 27
Web Services Procedures (2)
1. Web services providers register in UDDI Registry.
2. Web service consumers discoverthe desiredweb services in UDDI server.
3. Consumers retrieve the WSDL documents fromdesired web service providers.
4. Consumers sendSOAP request messages toservice providers.
5. Providers receive the requests, process themrequest, and return SOAP responses.
W b S i D i ti
-
7/31/2019 Lecture5 Web Services
28/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 28
Web Services Description
Language (WSDL)
4 critical pieces of information
: describes a web service, the operations
performed by the web service (the most important).
: defines the data elements of an
operation.
: defines the data type used by the web
service.
: defines the message format and protocol
details for each port.
WSDL S pport 4 Basic
-
7/31/2019 Lecture5 Web Services
29/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 29
WSDL Support 4 Basic
Operation Types
-
7/31/2019 Lecture5 Web Services
30/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 30
Binding to SOAP
-
7/31/2019 Lecture5 Web Services
31/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 31
Binding Element
The binding element has twoattributesname, type
Name: defines the name of the
binding (you can use any name youwant).
Type: points to the port for thebinding, in this case the"glossaryTerms" port.
-
7/31/2019 Lecture5 Web Services
32/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 32
SOAP: Binding
The soap:binding element has twoattributes - style, transport
Style: could be "rpc" or "document". Transport defines the SOAP
protocol to use. In this case we use
HTTP.
-
7/31/2019 Lecture5 Web Services
33/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 33
Operation
The operation element defines eachoperation that the port exposes.
--For each operation the corresponding
SOAP action has to be defined. Youmust also specify how the input and
output are encoded. In this case we use
"literal".
-
7/31/2019 Lecture5 Web Services
34/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 34
HelloServices.wsdl (1)
Definition
Message
Visit this following link for more detailed specification
http://www.w3.org/TR/wsdl#_wsdl
H ll S i dl (2)
-
7/31/2019 Lecture5 Web Services
35/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 35
HelloServices.wsdl (2)
PortType
Binding
previous
slides
matched operations
rpc - simple data types
document xml documents/data
encoded with data types based
on encodingStyleliteral no encoding
-
7/31/2019 Lecture5 Web Services
36/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 36
HelloServices.wsdl (3)
WSDL File for HelloService
Service
previous
slides
-
7/31/2019 Lecture5 Web Services
37/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 37
What is SOAP?
SOAP stands forSimple Object Access Protocol SOAP is XML-based SOAP is a protocol foraccessing a Web Service SOAP is for communication between applications
SOAP is a format forsending messages SOAP is via Internet (HTTP) SOAP is platform independent SOAP is language independent SOAP will be developed as a W3C standard
-
7/31/2019 Lecture5 Web Services
38/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 38
SOAP Building Blocks
A requiredEnvelope element that identifiesthe XML document as a SOAP message
An optional Header element that containsheader information
A required Body element that contains calland response information
An optional Fault element that provides
information about errors that occurred whileprocessing the message
-
7/31/2019 Lecture5 Web Services
39/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 39
Syntax Rules
A SOAP message MUST be encoded usingXML
A SOAP message MUST use the SOAPEnvelope namespace
A SOAP message MUST use the SOAPEncoding namespace
A SOAP message must NOT contain a DTDreference
A SOAP message must NOT contain XMLProcessing Instructions
-
7/31/2019 Lecture5 Web Services
40/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 40
SOAP Message
-
7/31/2019 Lecture5 Web Services
41/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 41
Skeleton SOAP Message
-
7/31/2019 Lecture5 Web Services
42/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 42
Envelope Element
The xmlns:soap namespace The encodingStyle attribute
--soap:encodingStyle="URI"
--
-
7/31/2019 Lecture5 Web Services
43/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 43
Header Element
Actor---A SOAP message may travel from a sender to a
receiver by passing different endpoints along themessage path. The SOAP actor attribute is toaddress the Header element to a particular endpoint
mustUnderstand=0/1
---It is to indicate whether a header entry is mandatoryor optional for the recipient to process.
encodingStyle
-
7/31/2019 Lecture5 Web Services
44/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 44
Header Element
234soap:actor="http://www.w3schools.com/appml/
...
...
-
7/31/2019 Lecture5 Web Services
45/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 45
Body Element
-
7/31/2019 Lecture5 Web Services
46/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 46
Fault Element
Fault element has the following sub elements:
Value of faultcode
Error Description
VersionMismatch Found an invalid namespace for the SOAP Envelope element
MustUnderstand An immediate child element of the Header element, with the
mustUnderstand attribute set to "1", was not understood
Client The message was incorrectly formed or contained incorrect
information
Server There was a problem with the server so the message could not
proceed
-
7/31/2019 Lecture5 Web Services
47/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 47
SOAP Hand-shaking
Example: weather services (refer to thelink provided on course home page)
-
7/31/2019 Lecture5 Web Services
48/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 48
SOAP Hand-shaking (Request)
10016
Envelope
Body
Envelope contains namespaces which directsto the external schema
Body contains the request getTemp
-
7/31/2019 Lecture5 Web Services
49/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 49
SOAP Hand-shaking (Response)
71.0
Envelope
Body
Envelope contains the same namespaces
Body contains the payload type(getTempResponse), corresponding to ourinitial request
-
7/31/2019 Lecture5 Web Services
50/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 50
SOAP over HTTP
SOAP Request Sent via HTTP GET or POST
HTTP POST requests specifies at least two
HTTP headers: Content-Type and Content-Length.
SOAP Response
Delivered by HTTP with corresponding statuscode
-
7/31/2019 Lecture5 Web Services
51/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 51
SOAP Request
-
7/31/2019 Lecture5 Web Services
52/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 52
SOAP Response
-
7/31/2019 Lecture5 Web Services
53/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 53
Universal Description, Discovery and
Integration (UDDI) UDDI stores the web services providers
and their web services provided in a
common XML format, acted as a
registry and database of web services Web-based applications interact with a
UDDI registry using SOAP messages
-
7/31/2019 Lecture5 Web Services
54/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 54
UDDI Registry CategoriesWhite Yellow Green
High-level businessinformation
Company name
Description Contact info
Known Identifiers
(Thomas, DUNS, tax
ID, etc.)
Classification ofbusiness andservices
Uses widely knownclassification schemes
such as NAICS,
UN/SPSC (ECMA),
SIC, and geographic
taxonomies
Technical info for
consuming the service
Called a Type Model
(tModel)Defines the services
API, binding
requirements, and so
on
Usually a pointer to aWSDL document
http://www.uddi.org/schema/uddi_v2.xsd
Wh t i th l f W b
http://images.google.com/imgres?imgurl=www2.bssc.edu.au/library/quick%2520reference/images/yellow%2520pages.gif&imgrefurl=http://www2.bssc.edu.au/library/quick%2520reference/&h=195&w=179&prev=/images%3Fq%3Dyellow%2Bpages%26svnum%3D10%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8 -
7/31/2019 Lecture5 Web Services
55/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 55
What is the role of Web
Services for middleware?
UI
Presentation Layer
Application Logic Layer
Res. Management Layer
UI
Presentation Layer
Application Logic Layer
Res. Management Layer
2-tier 3-tier
Client Client
Server
-
7/31/2019 Lecture5 Web Services
56/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 56
More on Web Services
We are only talking about Web services as RPC so far(stone age concept)!!!
Asynchronous request/response
Production and transmission of a request by a client.
Consumption of the request by service provider.
Production and transmission of a response by service provider.
Consumption of the response by the client.
* Can you see a collaboration activity?
* Can you define several web services to support that? Study whichweb services should be made known to client and which should bemade known to service provider.
-
7/31/2019 Lecture5 Web Services
57/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 57
More on Web Services
WS-Coordination (a step towards asynchronous WS) describes how services can make use of pre-defined coordination
contexts to subscribe to a particular role in a collaborative activity.
WS-Transaction (a step towards transactional WS)
provides a framework for incorporating transactional semantics into
coordinated activities.
Business Process Execution Language - BPEL (a step
towards workflow)
describe how Web services are connected to create reliable and
dependable business solutions
-
7/31/2019 Lecture5 Web Services
58/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 58
References
http://www.w3schools.com/ Darren Barefoot, Web Services Primer, Sept 2002,http://www.capescience.com/education/primer/index.shtml
New to Web Services, http://www-
106.ibm.com/developerworks/webservices/newto E Cerami, Web Services Essentials, OReilly, Feb 2002
David S. Linthisum, B2B Application Integration,Addison Wesley, 2001
-
7/31/2019 Lecture5 Web Services
59/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 59
..\code1.JPG
http://localhost/var/www/apps/conversion/current/tmp/scratch_3/code1.JPGhttp://localhost/var/www/apps/conversion/current/tmp/scratch_3/code1.JPGhttp://localhost/var/www/apps/conversion/current/tmp/scratch_3/code1.JPGhttp://localhost/var/www/apps/conversion/current/tmp/scratch_3/code1.JPG -
7/31/2019 Lecture5 Web Services
60/61
COMP3150/COMP7700 E-technology Architectures, Tools and Applications (Web Services) 60
-
7/31/2019 Lecture5 Web Services
61/61