Dr. Amor Lazzez: Web Services
Dr. Amor Lazzez: Web Services
Dr. Amor Lazzez: Web Services
Web Services
502510-3/Systems-Integration
Week 10
Source: This slides is largely prepared based on Chapter 3 from textbook “Service-Oriented Architecture: A Field Guide to
Integrating XML and Web Services” by Thomas Erl
Supporting Interactions
1
27/05/2015
Source: Coyle, F.P., XML, Web Services, and the Data Revolution, 2002, ISBN: 0-201-84456-7
2
27/05/2015
https://affiliate-program.amazon.com/gp/advertising/api/detail/main.html
3
27/05/2015
Amazon
Amazon
Web Service
SOAP response
list of charlie
chaplin movies
4
27/05/2015
Web Services
• Web service supports application-to-application
communication
• Supports “loosely coupled” integration
• Minimizes the amount of effort required to build
integrated applications.
• With Web services,
• the applications or programmers can find cooperative
programs to accomplish a specific task,
• allowing programmers to rapidly assemble applications
by merely tying together application modules.
• Web services are designed to enable application modules
(objects) to communicate with other application modules.
• Once connected, service applications provide transactional or
computational services.
5
27/05/2015
Service-Oriented Architecture
• Consider a scenario of finding a plumber
to fix a plumbing problem.
– Find a plumber in Yellow Pages
(Discovery)
– Plumber should have advertised in the
Yellow Pages (Publishing)
– You call plumber to schedule
appointment (Binding)
Service-Oriented Architecture
1. Service Provider
– Develops an application and converts into a service
– Creates a WSDL document describing the capabilities of the service and how to access
the service
– Publishes the WSDL document in a service registry (UDDI)
2. Service Requestor
– Needs a service for specific task/purpose
– Searches for services in the service registry
meeting needs
– Selects a service that is satisfactory
3. Service Requestor’s
application invokes the
provider’s service 2 1
• Upon acceptance,
application and service
can exchange data 3
using SOAP
6
27/05/2015
7
27/05/2015
1
1. Use UDDI to search for
services
2
– Use SOAP to access UDDI 3
– Search using key words
2. Download WSDL
document from UDDI for
selected service 4
3. Use URI information from
WSDL document to
invoke the service using
SOAP
4. After the services accepts
your request, then your
application and the
service can exchange
data using SOAP
8
27/05/2015
Peer-to-Peer Architecture
9
27/05/2015
Application Integration
10
27/05/2015
11
27/05/2015
12
27/05/2015
• Provide additional
information about the
service
• Types element – provide
data type support for Web
service definitions
– XSD Schema information is
provided
• Documentation element
allows supplementary
annotations to be added
13
27/05/2015
• SOAP facilitates
synchronous
(request and
response) as well
as asynchronous
(process-driven)
data exchange
models
14
27/05/2015
15
27/05/2015
16
27/05/2015
17
27/05/2015
18
27/05/2015
HTTP/1.1 200 OK
Content-Type: text/xml; charset=“utf-8”
Content-Length: nnnn
<soapenv:Envelope
xmlns:soapenv=“http://schemas.xmlsoap.org/soap/envelope/”>
<soapenv:Body>
<m:Divide_divNum_Response>
<xsd:response>5</xsd:response>
</m:Divide_divNum_Response>
</soapenv:Body>
</soapenv:Envelope>
19