2 What are Web Services?Today, we normally use Web browsers to talk to Web sitesBrowser names document via URL (lots of fun and games can happen here)Request and reply encoded in HTML, using HTTP to issue request to the siteWeb Services generalize this model so that computers can talk to computers using much of the same protocols used to communicate between browsers and web servers + a lot more.
3 What are Web Services?The concept of Web Service (WS) was introduced in 1999 by Hewlett-Packard. Microsoft coined the actual term “Web Services” in June 2000 as part of the .NET initiative.Web services are often advertised as a new wave in business process automationIs suppose to allow a seamless integration of systems and applications that communicate over the network and share data. This technology is in its infancy.Work in progressUnprovenLots of hype?
4 What are Web Services? Idea of treating software as a service. Nothing newEvolution of many different technologiesRemote Procedure Calls (RPC)CORBADCOMJava RMIWhat is novel?Overwhelming industry supportUtilization of XML
5 Why Web Services SUN RPC, DEC, CORBA, DCOM, Java RMI A web service Not considered Internet-friendlyInteroperability issues: standards are not always clear.Cannot be implemented in any language on any platformSoftware components that comprise the application are often not useful except for that applicationA web serviceCan be implemented in any language on any platformBlack boxesComponent-like, reusableBased on Web standardsHTTP, XML, SOAP, WSDL, UDDI
6 Examples of Simple Web Services Return the distance in miles between 2 locationsLocate entertainment, restaurants and lodging in a given areaReturn the name and the postal address associated with a given phone number.Find ATM location for a given postal code.Return stock quotes.
7 Examples of Web Services A travel agent needs to book a flight, hotel and car in a warm place. The client wants the best prices. Travel agent contacts each airline for flight information, hotel chain for hotel information and car rental agencies.The airlines, hotel chains and car rental agencies can be thought of as web services from the travel agent’s perspective.The travel agent’s user may think of the travel agent as a web service.
8 Examples of Web Services You should note the potential reusability of each of the services described on the last two slides.Web services provide interoperability between various software applications running on various platforms.Web services leverage open standards and protocols.
9 Web Services Architecture (2) Discover ServicesServiceDirectoryServiceRequestor(1) PublishServiceProvider(3) Invoke Services
10 Web Services Architecture Service ProviderImplements the Web Service and makes it available on the InternetService RequestorConsumer of the Web ServiceService DirectoryLogically centralized directory of servicesPlace to publish a new web service or find existing one.
11 XML XML – Extensible Markup Language Open standard for data exchange; for describing data which allows an infinite range of elements (tags) to be defined:Tags define contentSeparation of content from presentation
12 SOAP SOAP – Simple Object Access Protocol Created by Microsoft and submitted to W3C in 1999Multivendor support including IBM, Sun, Oracle, HP, etc;SOAP operates as RPC mechanism with HTTP used as transport protocol.Encodes requests and responses as XML documents.SOAP is suppose to be simple, easy to extend and interoperable.
13 SOAP Elements Header (optional) Body (mandatory) Envelope (mandatory) Top element of the XML document representing the messageHeader (optional)Determines how a recipient of a SOAP message should process the messageAdds features to the SOAP message such as authentication, transaction management, payment, message routes, logging, auditing, etc…Body (mandatory)Exchanges information intended for the recipient of the message.Typical use is for RPC calls and error reporting.
14 Identifies XML has SOAP message Soap RequestSOAP-ENV:Envelopexmlns:SOAP-ENV="SOAP-ENV:encodingStyle="<SOAP-ENV:Body><m:GetLastTradePriceRequest xmlns:m="Some-URI"><symbol>HP</symbol></m:GetLastTradePriceRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>Identifies XML has SOAP message
15 Soap Request Get price for HP stock SOAP-ENV:Envelope xmlns:SOAP-ENV="SOAP-ENV:encodingStyle="<SOAP-ENV:Body><m:GetLastTradePriceRequest xmlns:m="Some-URI"><symbol>HP</symbol></m:GetLastTradePriceRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>Get price for HP stock
17 WSDL WSDL – Web Services Description Language Type of XML used to describe abilities of Web Service to its potential user.WSLD provides the standard method of describing web services and their specific capabilities to other applications.
18 Elements in WSDL Definitions TypesBased on XML Schema type systemMessage formatsParts represent method parametersPort TypesSet of operationsParameter orderInput and output messagesBindingsMap a Port Type to a specific protocol, using a specific data encoding styleServicesSet of ports that implement port typesAccess point for each port
19 WSDL – An Example Definition of data types Definition of messages <definitions><types> <!-- XML Schema --> </types><message name=“getQuoteRequest” /><message name=“getQuoteResponse” /><portType name=“StockQuoteServiceInterface”><operation name=“getQuote”><input message=“getQuoteRequest” /><output message=“getQuoteResponse” /></operation></portType><binding name=“StockQuoteServiceBinding” type=“StockQuoteServiceInterface”><soap:binding transport=“ />…</binding><service name=“StockQuoteService”><port name=“StockQuoteServicePort” binding=“StockQuoteServiceBinding”><soap:address location=“ /></port></service></definitions>Definition of data typesDefinition of messagesDefinition of port typeDefinition of the bindingsDefinition of the service
20 UDDI UDDI – Universal Description, Discovery, and Integration Enables the creation of searchable web service directory that allows for the registration of a service and in response to a user provide the location of a service.Search by business or service typeHas a Web Services API for publishing and discovering the existence of Web servicesA coalition of organizations working together to manage UDDI registries and to further develop the Web Services API for accessing those registries.
21 Business Registrations How UDDI WorksMarketplaces, search engines, and business apps query the registry to discover services at other companies4.SW companies, standards bodies, and programmers populate the registry withdescriptions of different types of services1.2.Businesses populate the registry withdescriptions of the services they supportUDDI Business RegistryBusiness uses this data to facilitate easier integration with each other over the Web5.Business Registrations3.Assigns a unique identifier to each business registration
22 Web Service Example(from SUN) Suppose that the owner of a chain of coffee houses, called Coffee Break, wants to expand by selling coffee online.The owner instructs the business manger to find some new coffee supplier, get their wholesale prices, and then arrange for orders to be placed as the need arises.Coffee Break can analyze prices and decide which new coffees it wants to carry and which companies it wants to buy them from.
23 Web Services Example (from SUN) Locate coffee supplier through a UDDI service directory.The Coffee Break will issue a query to the UDDI service directory. When the search is completed, the registry will send back information on how to contact the wholesale coffee distributors that meet the criteria set out in the query.
24 Web Services ExampleNow Coffee Break can request price lists from each of the coffee distributors returned by the UDDI Service Directory.The Coffee Break has obtained a WSDL description for each distributor which describes the procedure to call to get prices and the URL where the request is to be sent.Upon receiving the responses for the request for prices, Coffee Break processes the price lists. This is used to send orders.
25 Traditional RPC vs Web Services Within enterpriseTied to a set of programming languagesProceduralUsually bound to a particular transportTightly-coupledFirewall-unfriendlyEfficient processingWeb ServicesBetween enterprisesProgram language independentMessage-drivenEasily bound to different transportsLoosely-coupledFirewall-friendlyRelatively not efficient processing
26 ChallengesStandards are new and require further development as to make sure that there is true interoperability.Lack of SecurityControversy over royalty fees (intellectual property rights to SOAP, WSDL, UDDI are held by Microsoft and IBM).Management, monitoring, auditingPerformance: WS may be too slow for high performance applications since parsing XML takes time.Quality of Service: Lack of standards describing quality of various web services.