Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Web Services and SOA

Similar presentations


Presentation on theme: "Introduction to Web Services and SOA"— Presentation transcript:

1 Introduction to Web Services and SOA

2 History of Web Applications
Web Browser Internet (TCP/IP) Web Server (Static Pages) Web Browser Internet (TCP/IP) Web Server (dynamic) DB ↑ 2-tier web applications Web Browser Internet (TCP/IP) Web Server DB App Server (middleware) ↑ N-tier web applications

3 Web services A web service is an instance of a more general notion of a service: “an act or performance offered by one party to another. Although the process may be tied to a physical product, the performance is essentially intangible and does not normally result in ownership of any of the factors of production”. The essence of a service, therefore, is that the provision (delivery) of the service is independent of the application using the service. Service providers can develop specialized services and offer these to a range of service users from different organizations.

4 Service Oriented Architectures (SOA)
A means of developing distributed systems where the components are stand-alone services Services may execute on different computers from different service providers Standard protocols have been developed to support service communication and information exchange Benefits of SOA Services can be provided locally or outsourced to external providers Services are language-independent Investment in legacy systems can be preserved Inter-organisational computing is facilitated through simplified information exchange

5 What is a service? A service is a self-contained unit of software that performs a specific task. It has three components: an interface, a contract, and implementation Interface: defines how a service provider will perform/process requests presented by the consumer of the service Contract: defines how the service provider and the service consumer should interact Implementation: is the actual service code itself A service provider can execute a request without the service consumer knowing how it does so

6 Web Services - Definition from W3C
The World Wide Web Consortium (W3C) is an international community where Member organizations, a full-time staff, and the public work together to develop Web standards. Definition: “A Web service is a software system identified by a URI, whose public interfaces and bindings are defined and described using XML. Its definition can be discovered by other software systems. These systems may then interact with the Web service in a manner prescribed by its definition, using XML based messages conveyed by internet protocols.” Our definition of the term "Web services" does not presuppose the use of SOAP as a packaging format or a processing model. Nor does it presuppose the use of WSDL as a service description language. There are, and will be in the future, plenty of Web services that use raw HTTP as a data transfer protocol and some mutually agreed-upon XML format as the message content. The Web Services *reference architecture* does, however, assume that the higher levels of the Web services protocol stack are built on the foundation of SOAP and WSDL.

7 Services Scenarios An in-car information system provides drivers with information on: Weather (a service) road traffic conditions (a service) local information (service) etc. This is linked to car radio so that information is delivered as a signal on a specific radio channel The car is equipped with GPS receiver to discover its position and, based on that position, the system accesses a range of information services. Information may be delivered in the driver’s specified language.

8 Web Service An application that requires interaction with another application Service provider: the application that provides the service (server) Service consumer: the application that consumes the service (client) Any program can be published as a web service if it does something!

9 Consuming a web service
Service Consumer Request Message Service Provider Internet (TCP/IP) Client Web Service Response Message The web service resides on a web server

10 Web Service Web Services Clients
A web service is any service that is available over the Internet or private (intranet) networks Uses a standardized XML messaging system A web service is not tied to any one operating system or programming language self-describing via a common XML grammar discoverable via a simple find mechanism Web Services Clients XML Internet

11 Web Service in Detail A Web service:
Is a software system identified by a URI Its public interfaces and bindings are defined and described using XML Its definition can be discovered by other software systems These systems may then interact with the Web service in a manner prescribed by its definition, using XML based messages conveyed by Internet protocols A set of programming interfaces (not a set of web pages) Must involve a web-based protocol

12 Why Web Services? Using web applications through web browsers requires human interaction to activate the programs at the server side When the idea of Business to Business (B2B) integration emerged, there was a need for an architecture that provides interoperability between the systems of different organizations Web Services are introduced to overcome the issue of interoperability

13 Web Services A web service is a server that provides service to other online systems, using WS protocols: WSDL: Web Services Description Language UDDI : Universal Description, Discovery, and Integration SOAP : Simple Object Access Protocol Services are loosely coupled so that they can be easily: composed, interchanged, and replaced

14 Web Services There are three steps in the web service lifecycle
A web service registers with a service broker (agent) / directory A service user inquires in the directory and finds a needed service The service user binds the web service and the service is provided

15 Web Service Architecture
Consumer gets the service WSDL from UDDI (if client knows it, then no need for this step) Discovery Agency (UDDI) Provider will publish the service with its description WSDL Publish (SOAP) 1. Find Service 2. Receive WSDL Web Service Consumer Service Provider Service WSDL 3. SOAP Request 4. SOAP Response

16 Web Services: Example The Stock Brokerage application uses three web services to support its own end-user service The three web services can be replaced if needed, with no interruption of the Stock Brokerage function

17 Web Services

18 Web Services Protocols
Web Services Definition Language (WSDL): Allows a web service to create a standard description of its service Universal Description Discovery and Integration (UDDI): Allows services to publish its description, and allows users to find it Simple Object Access Protocol (SOAP): Allows a web service and service user/consumer to execute a service transaction

19 Web Services Protocol Stack

20 Components of Web Services
Web services use HTTP for communication They use XML for exchanging messages (XML is a format for data exchange and description, improving or eliminating marshalling and un-marshalling. It provides interoperability between different platforms) All the standard web services work using the following components: SOAP (Simple Object Access Protocol) UDDI (Universal Description, Discovery and Integration) WSDL (Web Services Description Language)

21 Web Service Components
UDDI Stands for Universal Description, Discovery and Integration Framework for describing, discovering and integrating web services directory of web service interfaces with information about web services WSDL Stands for Web Services Description Language (pronounced as “wiz-dull”) An xml document containing information about web services such as method name, method parameter and how to access it Part of UDDI. It acts as a interface between web service applications Types of Web Services SOAP web services RESTful web services

22 SOAP Web Services SOAP Pros Cons
Stands for Simple Object Access Protocol An XML-based protocol for accessing web services Recommended by the W3C for communication between applications XML makes it platform independent and language independent. In other words, it can be used with Java, .Net or PHP language on any platform Pros Security: SOAP defines its own security known as WS Security Language and Platform independent: SOAP web services can be written in any programming language and executed in any platform Cons Slow: XML format must be parsed to be read/understood. Many standards must be followed while developing the SOAP applications. So, it consumes more bandwidth and resource WSDL dependent: uses WSDL and doesn't have any other mechanism to discover the service

23 RESTful Web Services RESTful Pros
REST stands for REpresentational State Transfer. It is an architectural style not a protocol Pros Fast: RESTful Web Services are fast because there is no strict specification like SOAP. It consumes less bandwidth and resource Language and Platform independent: RESTful web services can be written in any programming language and executed in any platform Can use SOAP: RESTful web services can use SOAP web services as the implementation Permits different data format: RESTful web service permits different data format such as Plain Text, HTML, XML and JSON

24 SOAP REST SOAP is a protocol
REST is an architectural style, concept and can use any protocol like HTTP, SOAP SOAP: Simple Object Access Protocol REST: REpresentational State Transfer SOAP uses services interfaces to expose the business logic REST uses URI to expose business logic JAX-WS is the java API for SOAP web services JAX-RS is the java API for RESTful web services SOAP defines standards to be strictly followed REST does not define too much like SOAP SOAP requires more bandwidth than REST REST requires less bandwidth than SOAP SOAP defines its own security RESTful web services inherits security from the underlying transport SOAP permits XML data format only REST permits different data format: i.e. Plain text, HTML, XML, JSON, etc. SOAP is less preferred than REST REST more preferred than SOAP

25 Java Web Services API There are two main API's defined by Java for developing web service applications since JavaEE 6. JAX-WS: for SOAP web services. The are two ways to write JAX-WS application code: RPC style Document style JAX-RS: for RESTful web services. There are mainly 2 implementation currently in use for creating JAX- RS application: Jersey RESTeasy.


Download ppt "Introduction to Web Services and SOA"

Similar presentations


Ads by Google