Web Service What exactly are Web Services? To put it quite simply, they are yet another distributed...
-
Upload
rosamund-simon -
Category
Documents
-
view
219 -
download
0
Transcript of Web Service What exactly are Web Services? To put it quite simply, they are yet another distributed...
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 language-
independent, 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 grid-oriented 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 IntegrationWeb Service Integration
• Connect (HTTP or SMTP)Connect (HTTP or SMTP)• Find Find (UDDI) (UDDI)• Define (WSDL)Define (WSDL)• Transact (SOAP)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?What is SOAP?Simple Object Access ProtocolSimple Object Access Protocol
• A lightweight mechanism to exchange structured and typed information.A lightweight mechanism to exchange structured and typed information.
• A wire protocol similar to the IIOP,ORPC,JRMP.A wire protocol similar to the IIOP,ORPC,JRMP.
• A simple mechanism to express application semantics.A simple mechanism to express application semantics.
• The above mentioned features allow SOAP to be used in a large variety of systems The above mentioned features allow SOAP to be used in a large variety of systems ranging from messaging systems to remote procedure calls (RPC)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 XMLSample SOAP XML
<?xml version="1.0"?><?xml version="1.0"?><<soapsoap::EnvelopeEnvelope
xmlns:xmlns:soapsoap="http://www.w3.org/2001/12/soap-envelope"="http://www.w3.org/2001/12/soap-envelope"soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding"soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">>
<<soapsoap::Header>Header> ...... ......</</soapsoap::Header>Header><<soapsoap::Body>Body> ...... ......
<<soapsoap::Fault>Fault> ...... ......</</soapsoap::Fault>Fault>
</</soapsoap::Body>Body></</soapsoap::Envelope>Envelope>
Sample SOAP XMLSample SOAP XML
REQUESTREQUEST
<soap:Body><soap:Body> <m:<m:GetPriceGetPrice xmlns:m="http://www.bse.co.in/prices"> xmlns:m="http://www.bse.co.in/prices"> <m:Symbol>TCS</m:Symbol><m:Symbol>TCS</m:Symbol> </m:</m:GetPriceGetPrice>></soap:Body></soap:Body>
RESPONSERESPONSE
<soap:Body><soap:Body> <m:<m:GetPriceResponseGetPriceResponse xmlns:m="http://www.bse.co.in/prices"> xmlns:m="http://www.bse.co.in/prices"> <m:Price>1280.40</m:Price><m:Price>1280.40</m:Price> </m:</m:GetPriceResponseGetPriceResponse>></soap:Body></soap:Body>
Only the Body part of the SOAP XML is shown hereOnly the Body part of the SOAP XML is shown here
Web Service Description Language (WSDL)Web Service Description Language (WSDL)
• WSDL is an XML grammar for describing a web service as a collection of access end 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 points capable of exchanging messages in a procedure or document-oriented fashion.fashion.
• WSDL describes WSDL describes whatwhat a service does, a service does, howhow to invoke its operations and to invoke its operations and wherewhere to to find it.find it.
• A WSDL document is a recipe used to automate the details involved in application-A WSDL document is a recipe used to automate the details involved in application-to-application communication.to-application communication.
Universal Description Discovery and Integration Universal Description Discovery and Integration (UDDI)(UDDI)
• UDDI provides a standardized method for publishing and discovering UDDI provides a standardized method for publishing and discovering
information about web services. The UDDI project is an industry initiative information about web services. The UDDI project is an industry initiative
that attempts to create a platform-independent, open framework for that attempts to create a platform-independent, open framework for
describing services, discovering businesses and integrating business describing services, discovering businesses and integrating business
services.services.
• UDDIUDDI is a centrally accessible registry of services.
UDDI RegistryUDDI Registry
UDDI Registry steps :UDDI Registry steps :
Service Broker
Green PagesYellow Pages
White Pages
Service Requestor
Service Provider
1. Register the Web Service
2. Searches business description and services
3. Discovery of service’s functional and technical details
4. Integrate the Service into User Application dynamically
UDDIUDDI
Conceptually, a business can register three types of information into a UDDI registry. The 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 specification does not call out these types specifically but they provide a good summary of what UDDI can store for a business.what UDDI can store for a business.
• White pagesWhite pagesBasic contact information and identifiers about a company, including business name, address , 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 contact information and unique identifiers such as tax Ids. This information allows others to discover your web service based upon your business identification.discover your web service based upon your business identification.
• Yellow pagesYellow pagesInformation that describes a web service using different categorizations. This information Information that describes a web service using different categorizations. This information allows others to discover your web service based upon its categorization.allows others to discover your web service based upon its categorization.
• Green pagesGreen pagesTechnical information that describes the behaviors and supported functions of a web service 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 hosted by your business. This information includes pointers to the grouping information of web services and where the web services are located.web services and where the web services are located.
SaaS
• Software as a Service
• Cloud Computing – utility computing