COMSCPBTech75941A2rWebrPr - Chapter 3 - Web Services

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 28

CSE 311 – Web Services

Chapter 3: Web Services

Department of Computer Science and Engineering


School of Engineering, Presidency University
Contents
1. Contemporary SOA
2. Web Service definition
3. Key features of Web Service
4. SOA and Web Services Overview
5. Web Service Trinity
6. Publish/ Find/ Bind Model
7. Web Services Scenarios
8. SOAP Overview
9. UDDI Overview
10. WSDL Overview

Dept. of CSE, SOE, Presidency University 2


New Age of Distributed
Computing
 Convergence of two technologies
 The Web:
 Universal communication
 HTTP, XML
 Service-oriented computing:
 Exposing data and business logic through a
programmable interface

Dept. of CSE, SOE, Presidency University 3


Contemporary
SOA
 Contemporary Service-Oriented Architectures
(SOA) represents an architecture that
promotes service-orientation through the use
of Web services.
 All functions, or services, are defined using a
description language and have invokable
interface that are called to perform business
processes.

Dept. of CSE, SOE, Presidency University 4


What is a Web Service

 The World Wide Web is more and more used


for application to application communication.
The programmatic interfaces made available
are referred to as Web services”

 A Web service is a software system designed


to support interoperable machine-to-machine
interaction over a network. (W3C definition)

Dept. of CSE, SOE, Presidency University 5


What is a Web Service

 It has an interface described in a machine-


process format (specifically WSDL).

 Other systems interact with the Web service in


a manner prescribed by its description using
SOAP messages, typically conveyed using
HTTP with an XML serialization in conjunction
with other Web-related standards.

Dept. of CSE, SOE, Presidency University 6


SOAP- Simple Object
Access Protocol
 HTTP + SOAP +XML=LOCATE PARTICULAR
WEB SERVICE THAT IS RUNNING ON
SERVER.

Dept. of CSE, SOE, Presidency University 7


Key Features of Web Service

1. A modular, well-defined, encapsulated function


2. Used for loosely coupled integration between
applications or systems
3. Based on XML, transported in two forms:
1. Synchronous (RPC)
2. Asynchronous (messaging)
3. Both over Simple Object Access Protocol (SOAP)
4. Specified in Web Services Description Language
(WSDL)
5. Sometimes advertised and discovered in a service
registry – Universal Description, Discovery and
Integration (UDDI)
6. Over Intranet and Internet

Dept. of CSE, SOE, Presidency University 8


SOA and Web Services Overview

Points to description
UDDI WSDL
Registry
Po
ints
t os
erv Describes
Finds ice
Service
Service

Service Web
SOAP
Consumer Service
Communicates with
Dept. of CSE, SOE, Presidency University
XML Messages 9
Web Service Trinity

1. A Contract Definition Language


 Web Service Description Language (WSDL).
 De Facto standard.
2. Standardized Look-up
 Universal Description Discovery and Integration
(UDDI)
3. Interoperability standards
 Simple Object Access Protocol (SOAP).

Publish/Find/Bind - Web Services are published


and located via the UDDI, they are described
using WSDL and are invoked using SOAP
over HTTP
Dept. of CSE, SOE, Presidency University 10
Publish/ Find / Bind
Model

Dept. of CSE, SOE, Presidency University 11


Typical Web Service Scenario

Logistic Bank
Company

Web Service
Shipping Order
J2EE
Web Service
Credit Card Check

SOAP
Internet SOAP

SOAP
Shop
Application
Web Service
Order Fulfillment
Web Service
E-Retailer
Supplier

Dept. of CSE, SOE, Presidency University 12


Publish/ Find / Bind
Model
1. The service provider publishes its service(s) to a
service registry such as UDDI in the form of a WSDL
document.

2. The service requestor finds services for consumption


via service registries and this process is also called
“service discovery.”

3. Once the service requestor has acquired the service


information, it can attempt to bind to the service and
use it.

Dept. of CSE, SOE, Presidency University 13


SOAP – Simple Object Access Protocol

SOAP (Simple Object Access Protocol) is a


message protocol that allows distributed elements of an
application to communicate. 

SOAP can be carried over a variety of lower-level protocols,


including the web-related Hypertext Transfer Protocol (HTTP).

Dept. of CSE, SOE, Presidency University 14


SOAP – Simple Object Access Protocol

• SOAP is a communication protocol designed to


communicate via Internet.
• SOAP can extend HTTP for XML messaging.
• SOAP provides data transport for Web services.
• SOAP can exchange complete documents or call a
remote procedure.
• SOAP can be used for broadcasting a message.
• SOAP is platform- and language-independent.
• SOAP is the XML way of defining what information
is sent and how.
• SOAP enables client applications to easily connect to
remote services and invoke remote methods.

Dept. of CSE, SOE, Presidency University 15


SOAP Message

A SOAP message is an ordinary XML document containing the


following element:
Envelope - Defines the start and the end of the message. It is a
mandatory element.
Header - Contains any optional attributes of the message used
in processing the message, either at an intermediary point
or at the ultimate end-point. It is an optional element.
Body - Contains the XML data comprising the message being
sent. It is a mandatory element.
Fault - An optional Fault element that provides information
about errors that occur while processing the message.
All these elements are declared in the default namespace for the
SOAP envelope − http://www.w3.org/2001/12/soap-
envelope
Dept. of CSE, SOE, Presidency University 16
SOAP Message Structure

Dept. of CSE, SOE, Presidency University 17


SOAP Message Structure
<?xml version = "1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV = "http://www.w3.org/2001/12/soap-envelope"
SOAP-ENV:encodingStyle = "http://www.w3.org/2001/12/soap-encoding">
<SOAP-ENV:Header>
... ...
</SOAP-ENV:Header>
<SOAP-ENV:Body>
...
<SOAP-ENV:Fault>
...
</SOAP-ENV:Fault>
...
</SOAP-ENV:Body>
</SOAP_ENV:Envelope>

Dept. of CSE, SOE, Presidency University 18


WSDL – Web Service Definition Language

WSDL is the standard format for describing a web service. WSDL was developed jointly by Microsoft and IBM.

It is an as a set of endpoints operating on messages containingXML format for describing network services either
document-oriented or procedure-oriented information. The operations and messages are described abstractly, and then
bound to a concrete network protocol and message format to define an endpoint

Dept. of CSE, SOE, Presidency University 19


WSDL Usage

WSDL is often used in combination with SOAP and XML Schema to provide web services over the Internet. A
client program connecting to a web service can read the WSDL to determine what functions are available on
the server. Any special datatypes used are embedded in the WSDL file in the form of XML Schema. The
client can then use SOAP to actually call one of the functions listed in the WSDL by creating a Service Proxy.

Dept. of CSE, SOE, Presidency University 20


Elements of the WSDL document
 Types – a container for data type definitions using some type system (such as XSD).
 Message – an abstract, type definition of the data being communicated.
 Operation – an abstract description of an action supported by the service.
 Port Type – an abstract set of operations supported by one or more endpoints.
 Binding – a concrete protocol and data format specification for a particular port type.
 Port – a single endpoint defined as a combination of a binding and a network address.
 Service – a collection of related endpoints.

Dept. of CSE, SOE, Presidency University 21


Sample WSDL Document

Dept. of CSE, SOE, Presidency University 22


Structure of the WSDL Document

Dept. of CSE, SOE, Presidency University 23


UDDI – Universal Description, Discovery &
Integration
 Universal Description, Discovery and Integration
 Registry for Web services
 Has a Web Services API for publishing and discovering the existence of Web services
 A registry where you find a Web service and its description (WSDL)
 Search by business
 Search by service type
 A coalition of organizations working together to manage UDDI registries and to further develop the Web Services API for accessing those registries.
 Joint Initiative –uddi.org
 By Ariba Inc., IBM Corp. and Microsoft Corp.
 An open uddi community to support the development of uddi
 UDDI Business Registries: Microsoft, IBM, SAP, NTT-Com
 Test UBR nodes: Microsoft, IBM, SAP

Dept. of CSE, SOE, Presidency University 24


How UDDI
Works
4.
1. SW companies, standards
bodies, and programmers
populate the registry with
descriptions of different types
of services
Marketplaces, search
engines, and business
apps query the registry to
2. discover services at other
companies
UDDI Business Registry

Business
5.
Businesses Registrations
populate
the registry with
Assigns a unique identifier to each business
descriptions of 3. registration Business uses this
the services data to facilitate
they support easier integration
with each other over
Dept. of CSE, SOE, Presidency University
the Web 25
Advantages of
UDDI
 Making it possible to discover the right business from the millions currently online
 Defining how to enable commerce once the preferred business is discovered
 Reaching new customers and increasing access to current customers
 Expanding offerings and extending market reach
 Solving customer-driven need to remove barriers to allow for rapid participation in the global Internet
economy
 Describing services and business processes programmatically in a single, open, and secure environment

Dept. of CSE, SOE, Presidency University 26


Traditional RPC vs Web Services
Traditional RPC Web Services
 Within enterprise  Between enterprises
 Tied to a set of  Program language
programming languagesindependent
 Procedural  Message-driven
 Usually bound to a  Easily bound to different
particular transport transports
 Tightly-coupled  Loosely-coupled
 Firewall-unfriendly  Firewall-friendly
 Efficient processing  Relatively not efficient
processing
Web App vs Web Services
Web Application Web Services
 User-to-program  Program-to-program
interaction interaction
 Static integration of  Dynamic integration of
components components
 Monolithic service  Service aggregation
 Ad hoc or proprietary  Interoperability
protocol

You might also like