Transcript Web Service

Web Service
What exactly are Web Services?
To put it quite simply, they are yet another distributed computing
technology (like CORBA, RMI, EJB, etc.). They allow us to create
client/server applications.
E.G - Given a ZIP code, will provide the weather information for that ZIP code.
“Websites for humans, Web Services for software”
Concept of web services
"Hey! Wait a moment! I can do that with RMI, CORBA, EJBs, and countless other technologies!"
So, what makes Web Services special? Well, Web Services have certain advantages over other
technologies
Advantages of Web Services
• Web Services are platform-independent and languageindependent, since they use standard XML languages.
This means that my client program can be programmed
in C++ and running under Windows, while the Web
Service is programmed in Java and running under
Linux.
• Most Web Services use HTTP for transmitting messages
(such as the service request and response). This is a
major advantage if you want to build an Internet-scale
application, since most of the Internet's proxies and
firewalls won't mess with HTTP traffic (unlike CORBA,
which usually has trouble with firewalls).
Disadvantages of Web Services
• Overhead Transmitting all your data in XML is
obviously not as efficient as using a proprietary
binary code. What you win in portability, you lose
in efficiency. Even so, this overhead is usually
acceptable for most applications, but you will
probably never find a critical real-time application
that uses Web Services.
• Lack of versatility Currently, Web Services are not
very versatile, since they only allow for some very
basic forms of service invocation.
Important characteristic
• While technologies such as CORBA and EJB are geared
towards highly coupled distributed systems, where the
client and the server are very dependent on each other
• Web Services are more adequate for loosely coupled
systems, where the client might have no prior knowledge of
the Web Service until it actually invokes it.
• Highly coupled systems are ideal for intranet applications,
but perform poorly on an Internet scale.
• Web Services, however, are better suited to meet the
demands of an Internet-wide application, such as gridoriented applications.
Web Services Addressing
• The discovery registry might have replied with
the following URI:
http://webservices.mysite.com/weather/us/WeatherService
A Typical Web Service Invocation
Web Services Architecture
Web Service Integration
• Connect (HTTP or SMTP)
• Find (UDDI)
• Define (WSDL)
• Transact (SOAP)
Server side
SOA
• Service-Oriented Architecture (SOA) is a set of principles and
methodologies for designing and developing software in the
form of interoperable services.
• services are well-defined business functionalities that are built
as software components (discrete pieces of code and/or data
structures) that can be reused for different purposes.
• SOA defines how to integrate widely disparate applications for a
Web-based environment and uses multiple implementation
platforms. Rather than defining an API, SOA defines the
interface in terms of protocols and functionality
• Service orientation requires loose coupling of
services with operating systems, and other
technologies that underlie applications.
• SOA is concept from Distributed Computing
• Now SaaS, Cloud Computing uses SOA
• Web services are in use to implement SOA
What is SOAP?
Simple Object Access Protocol
•
A lightweight mechanism to exchange structured and typed information.
•
A wire protocol similar to the IIOP,ORPC,JRMP.
•
A simple mechanism to express application semantics.
•
The above mentioned features allow SOAP to be used in a large variety of systems
ranging from messaging systems to remote procedure calls (RPC)
• SOAP has three major characteristics:
– Extensibility (security and WS-routing are among
the extensions under development),
– Neutrality (SOAP can be used over any transport
protocol such as HTTP, SMTP or even TCP), and
– Independence (SOAP allows for any programming
model).
• This XML based protocol consists of three
parts:
– an envelope, which defines what is in the message
and how to process it,
– a set of encoding rules for expressing instances of
application-defined datatypes, and
– a convention for representing procedure calls and
responses.
Sample SOAP XML
<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
<soap:Header>
...
...
</soap:Header>
<soap:Body>
...
...
<soap:Fault>
...
...
</soap:Fault>
</soap:Body>
</soap:Envelope>
Sample SOAP XML
REQUEST
<soap:Body>
<m:GetPrice xmlns:m="http://www.bse.co.in/prices">
<m:Symbol>TCS</m:Symbol>
</m:GetPrice>
</soap:Body>
RESPONSE
<soap:Body>
<m:GetPriceResponse xmlns:m="http://www.bse.co.in/prices">
<m:Price>1280.40</m:Price>
</m:GetPriceResponse>
</soap:Body>
Only the Body part of the SOAP XML is shown here
Web Service Description Language (WSDL)
•
WSDL is an XML grammar for describing a web service as a collection of access end
points capable of exchanging messages in a procedure or document-oriented
fashion.
•
WSDL describes what a service does, how to invoke its operations and where to
find it.
•
A WSDL document is a recipe used to automate the details involved in applicationto-application communication.
Universal Description Discovery and Integration
(UDDI)
• UDDI provides a standardized method for publishing and discovering
information about web services. The UDDI project is an industry initiative
that attempts to create a platform-independent, open framework for
describing services, discovering businesses and integrating business
services.
• UDDI is a centrally accessible registry of services.
UDDI Registry
UDDI Registry steps :
2. Searches business
description and services
White Pages
Yellow Pages
Service Requestor
3. Discovery of service’s
functional and technical
details
Green Pages
Service Broker
1. Register the Web
Service
4. Integrate the Service into
User Application
dynamically
Service Provider
UDDI
Conceptually, a business can register three types of information into a UDDI registry. The
specification does not call out these types specifically but they provide a good summary of
what UDDI can store for a business.
•
White pages
Basic contact information and identifiers about a company, including business name, address ,
contact information and unique identifiers such as tax Ids. This information allows others to
discover your web service based upon your business identification.
•
Yellow pages
Information that describes a web service using different categorizations. This information
allows others to discover your web service based upon its categorization.
•
Green pages
Technical information that describes the behaviors and supported functions of a web service
hosted by your business. This information includes pointers to the grouping information of
web services and where the web services are located.
SaaS
• Software as a Service
• Cloud Computing – utility computing