Leeds Beckett University
Cloud Computing
Development
Dr Anatoliy Gorbenko
E-mail: [email protected]
Office: CAE118
Kiran Voderhobli
E-mail: [email protected]
Office: CAE228
Cloud Computing
Development
Lecture:
Service Oriented Architecture and Web Services
Anatoliy Gorbenko
Kiran Voderhobli
Lecture Agenda • SOA model
• Web Services definition
SOA and Web Services • WS technologies
– WSDL
– UDDI
Service Oriented
Contract-based
L o o s e c o u p l i n g
Architecture Abstraction Reusability
AUTONOMY
Definitions Discoverability
S TAT E L E S S N E S S
composability
encapsulation
Distributed Applications
• Most modern applications are distributed
– Several components interact with each other
• Distributed application models
– "Client-Server" model – persistent socket / WebSocket connection
– "Distributed Objects" model – client and server objects
• DCOM, CORBA, Java RMI, .NET Remoting, …
• Outdated, not used in modern apps
– "Web Services" / "RESTful Web Services" model
• RESTful (HTTP, REST, JSON) and heavy services
(SOAP, WSDL, XML)
Services: Real World and SW
• In the real world a "service" is:
– A piece of work performed by a service provider
– Takes some input and produces some desired results
– E.g. a supermarket: pay some money and get some food
– Has quality characteristics (price, execution time, constraints, etc.)
• In the software world a "service"
– Takes some input, performs some work, produces some output
– Request-response model:
• client requests,
• server responses
Service-Oriented Architecture (SOA)
• SOA (Service-Oriented Architecture) is an architectural concept
for development of software systems
– Using reusable building blocks (components) called "services"
– SOA == decouple the monolithic software to reusable services
• Services in SOA are:
– Autonomous, stateless business functions
– Accept requests and return responses
– Use well-defined, standard interface
(standard protocols)
Service-Oriented Architecture (SOA)
SOA
Application Service
Service Service bus
frontend repository
Implementati
Contract Interface
on
Business
Data
logic
SOA conceptual model
SOA Services
• Autonomous
– Each service operates autonomously
– Without any awareness that other services exist
• Stateless
– Do not remember a durable state between requests
• Can store state in a database and reference it by ID
– Easy to scale just add more nodes
• Request-response model
– Client asks, server returns an answer
– Server never sends requests
to the client
Web Services
Contract-based
L o o s e c o u p l i n g
Abstraction Reusability
AUTONOMY
Definitions, technologies Discoverability
and workflow
S TAT E L E S S N E S S
Web Services Definition
• "A service is a discoverable resource that
executes a repeatable task, and is described by
an externalized service specification."
• “A Web Service is a URL-addressable software
resource that performs functions.”
© IBM SOA foundation
Web Services Definition
"A Web Service is a software application
(1) identified by a URI,
(2) whose interfaces and binding are capable of being
defined, described and discovered by XML artifacts and
(3) supports direct interactions with other software
applications using XML based messages
(4) via internet-based protocols“
© Sun Microsystems
Web Services Definition
"Web services are a new breed of Web application.
They are self-contained, self-describing, modular applications
that can be published, located, and invoked across the Web.
Web services perform functions, which can be anything from simple
requests to complicated business processes. … Once a Web
service is deployed, other applications (and other Web services) can
discover and invoke the deployed service.”
© IBM web service tutorial
Web Services and Clients
• A "web service" is:
– Software service that communicates over standard Web protocols
– Platform independent
• Independent of OS, platforms,
languages, frameworks, …
– Discoverable
• Service registries and brokers
• A "client" (consumer) uses the services
– Requests something to be performed
– Gets the desired result or gets an error
Basic WS Technologies
WSDL • Web Service Description Language
UDDI • Universal Description, Discovery & Integration
SOAP
• Simple Object Access Protocol
Web Services Protocols
• Communication through standard protocols
– HTTP, FTP, SMTP, RPC, MSMQ, ...
– JSON, XML, SOAP, RSS, WS-*, ...
• Classical (heavyweight) services
use SOAP, WSDL, XML, WS-*
• Lightweight (RESTful) services
use HTTP, REST and JSON
• Can be composed into complex
workflows (WS-BPEL, BPMN, etc.)
Web Services Implementation
Web Service Provider
(endpoint)
Requestor
(SOAP client) HTTP SOAP application
server server server
SOAP
messages
(http transport)
Application Server (web service-enabled)
– provides implementation of services and exposes it through WSDL/SOAP
– implementation in Java, as EJB, as .NET (C#) etc.
SOAP server
– implements the SOAP protocol
HTTP server
– standard Web server
SOAP client
– implements the SOAP protocol on the client site
Web Services workflow
Find Web
Service UDDI
CLIENT List of Web
Services Registry
Get Web Service Info
Registered
WSDL URL
Services
Get Service Description
WSDL Contract Web Service
SOAP Message
SOAP Response
Web Services
Contract-based
L o o s e c o u p l i n g
Abstraction Reusability
AUTONOMY
Web Services Description: Discoverability
WSDL S TAT E L E S S N E S S
WSDL Service Description
• WSDL (Web Services Description Language)
– Describes what a Web service can do
– Names of the available methods (messages)
– Input and output parameters, returned value
– Data types used for parameters or result
– Endpoints: ports and bindings
• WSDL is an XML based, open standard
from W3C
WSDL Specification
1. Define in XML Schema the message types used when WSDL specification
invoking the service: MT1, MT2 etc.
2. Define (named) messages by using these types, e.g. abstract part
• message m1 has type MT1 types
• message m2 has type MT2 etc.
3. Define Services that consist of one or more operations; each messages
operation is implemented by the exchange of messages operations
• service S offers operation O1; for executing O1 first send a
request message m1, then a response message m2 is returned port types
4. Define a Binding B to a specific protocol, e.g. SOAP
• service S is implemented in SOAP; the SOAP messages are concrete part
constructed from the abstract messages m1 and m2 by, e.g.
bindings
inlining the message as body of SOAP messages
5. Service S is provided with binding B at the following URI's services and
(called ports) ports
WSDL Example
<wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap"xmlns:impl="http://
localhost:8080/axis/StockQuoteService.jws" > WSDL specification
<wsdl:message name="getQuoteResponse">
<wsdl:part name="getQuoteReturn" type="xsd:float"/>
</wsdl:message>
<wsdl:message name="getQuoteRequest">
abstract part
<wsdl:part name="symbol" type="xsd:string"/>
</wsdl:message>
<wsdl:portType name="StockQuoteService">
types
<wsdl:operation name="getQuote" parameterOrder="symbol">
<wsdl:input message="impl:getQuoteRequest" name="getQuoteRequest"/>
<wsdl:output message="impl:getQuoteResponse" name="getQuoteResponse"/>
</wsdl:operation>
messages
</wsdl:portType>
<wsdl:binding name="StockQuoteServiceSoapBinding" type="impl:StockQuoteService">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
operations
<wsdl:operation name="getQuote">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getQuoteRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://
port types
DefaultNamespace"use="encoded"/>
</wsdl:input>
<wsdl:output name="getQuoteResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"namespace="http://
localhost:8080/axis/StockQuoteService.jws" use="encoded"/>
concrete part
</wsdl:output>
</wsdl:operation>
</wsdl:binding> bindings
<wsdl:service name="StockQuoteServiceService">
<wsdl:port binding="impl:StockQuoteServiceSoapBinding" name="StockQuoteService">
<wsdlsoap:address location="http://localhost:8080/axis/StockQuoteService.jws"/> services and
</wsdl:port>
</wsdl:service> ports
</wsdl:definitions>
Web Services
Contract-based
L o o s e c o u p l i n g
Abstraction Reusability
AUTONOMY
Universal Description Discoverability
Discovery and Integration :
S TAT E L E S S N E S S
UDDI
UDDI
• Standard for describing, publishing and finding web services
– Still evolving
– Use XML-based description files for services
• Main components
– White pages: basic contact information about an organization
– Yellow pages: classification of organization based on industrial
categorization
– Green pages: technical description of services offered by registered
organizations
• Access to UDDI Registry
– Standard UDDI API (accessible via SOAP)
– Web browser
UDDI Registries
• A number of companies (Microsoft, IBM, HP, etc.) run global
UDDI Registries, which are a database of Web services.
• A number of companies run corporate UDDI Business
Registries
• Supported ops:
– Register a Web Service (WSDL)
– Find a Web Service
• These registries can be accessed using API or via
a Web site interface. For example, see:
http://uddi.microsoft.com/ or
https://uddi.ibm.com/ubr/registry.html