1 / 44

Web services

Web services. B. Pernici (alcuni lucidi sono tratti dalla presentazione di Leymann al VLDB 2001). Sommario. Web service Service oriented architecture SOAP UDDI WSDL Bibliografia: Conallen, cap. 4. Virtual Enterprise: Scenario. Consequences. You can...

jereni
Télécharger la présentation

Web services

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Web services B. Pernici (alcuni lucidi sono tratti dalla presentazione di Leymann al VLDB 2001)

  2. Sommario • Web service • Service oriented architecture • SOAP • UDDI • WSDL • Bibliografia: Conallen, cap. 4

  3. Virtual Enterprise: Scenario

  4. Consequences • You can... • ...outsource „services“ (e.g. where you are not competitive) • ...offer „services“ (e.g. make money with functions & processes you perform for others) • These services reach from • ...simple, fine grained functions... • ...to complete business processes, i.e. coarse grained functions

  5. O.K., But: How To Access Services? • Firewalls are obstructions to ubiquitious access to services • Wide range of different programming languages, programming paradigms and hosting environments,... makes orchestration a nightmare • ... We need a globally available invokation mechanism!

  6. Web services • Services that can be invoked by other programs on the network • Decentralization of processing mechanism (Sun, 1990) • Def: Web Service: collection of functions packaged and published on a network for use by other client programs

  7. Service Oriented Architecture (SOA)

  8. Ingredienti • Descrizione servizi (WSDL) • Archivio servizi (registry) • Meccanismi di invocazione

  9. WSDL

  10. How To Define New Web Services? • Well, it‘s nice to refer to web services that others have defined and agreed on (= tModels) • ...but what if I want to publish my own web services • e.g. simple functions usefull for others • or complete business processes that I offer • ...without creating a standard! We need a language to specify servicesand describe how others can bind to them! WSDL(Web Services Description Language)

  11. Supports Formats & Protocols Input & Output How to invoke How to encode Implements Provides WSDL Ingredients Port Type Operation Binding Message Port Service

  12. o1 Port Types: Graphical Representation o1 Request -Response o2 o2 Solicit -Response pt o3 One-Way o4 Notification

  13. Port Type Supports Operation Formats & Protocols How to invoke Input & Output Binding How to encode Message 1. 3. 2. Implements Provides Port Service Making Services Available (Widely Accepted) Abstract Service How To Do Business With Me What Business You Can Do With Me

  14. WSDL

  15. WSDL

  16. WSDL binding

  17. UDDI

  18. Repositories e registries • systems storing and managing • e-Service specifications • e-service providers • Some initiatives • UDDI

  19. UDDI • - accesso alla descrizione di servizi, di tipologie di servizi e di fornitori di servizi secondo una struttura dati ben definita; • - astrazione dalla tecnologia utilizzata nella realizzazione del servizio; • - la ricerca di un servizio secondo differenti chiavi di ricerca.

  20. How To Find Services? We need a globally available directory! • ...to catalogue services based on publish requests of service providers • ...to maintain taxonomy(ies) to support searching for appropriate services • ...to search services by human beings or by programs UDDI(Universal Description, Discovery & Integration)

  21. 3. 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 discover services at other companies 2. 4. Businesses populate the registry with descriptions of the services they support Business uses this data to facilitate easier integration with each other over the Web How UDDI Works Service Type Registrations BusinessRegistrations UDDI

  22. Registry Data WhitePages Who am I? • Businesses register public informationabout themselves YellowPages What do I offer? GreenPages How to dobusiness with me • Standards bodies, Programmers, Businesses register information about their Service Types(„tModels“) Service Type Registrations

  23. Frank Leymann businessEntity +49-7031-163998 Boeblingen, Germany Frank@ibm.com TB993… Frank‘s Flowershop www.Frank-Flower.com “Flowers for the world!“ contacts businessServices identifierBag categoryBag businessService businessService 23T701e54683nf… Online catalog “Website where you can … BindingTemplates Key Name Description BindingTemplates BindingTemplate keyedReference keyedReference 5E2D412E5-44EE-… http://www.flowers.de/flowerCat tModelInstanceDetails EE123… NAICS 02417 DFE-2B… DUNS 45231 tModelInstanceInfo 4453D6FC-223C-3ED0… http://www.rosetta.net/catalogPIP tModelKeys Example of a Registration

  24. Registry Operation queries • Peer nodes (websites) • Companies registerwith any node • Registrations replicatedon a daily basis • Complete set of“registered” recordsavailable at all nodes • Common set ofSOAP APIs supportedby all nodes • Compliance enforced bybusiness contract IBM Ariba other UDDI.org other Microsoft

  25. SOAP

  26. SOAP: Simple Object Access Protocol Provide an (Object) RPC over the Internet • Interoperability amongst a wide range of programs on a wide range of plattforms • Different programming languages, programming paradigms and hosting environments • Make existing programs more accessible to a broader range of users • Use of existing technology wherever possible • Usage of HTTP and XML („XML as HTTP payload“) • HTTP as RPC transport • XML as RPC encoding scheme • No special SOAP API, no special SOAP ORB

  27. POST/myFunctions/reverse HTTP/1.1 Host: www.Frank-Leymann.com Content-Type: text/plain Content-Length: 12  Hello, World Run Program HTTP POST: Invoking Code A simple RPC Client Server 200 OK Content-Type: text/plain Content-Length: 12 dlroW ,olleH

  28. RMI HTTP IIOP Tunneling The Firewall Client

  29. SOA

  30. ServiceRequestor Find Bind Transport Medium ServiceDirectory Publish ServiceProvider SOA Reminder

  31. SOAP ...And Relation To Web Services Service Requestor WSDL UDDI

  32. Web Services PerformDelivery UDDI, WSDL,SOAP,... Check Credit Rating ProduceInvoice SOA In Action

  33. Approfondimenti

  34. Example <?xml version="1.0"?> <definitions name="StockQuote" xmlns:tns="http://leymann.com/stockquote.wsdl" xmlns:xsd="http://leymann.com/stockquote.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <message name="GetLastTradePriceRequest"> <part name="tickerSymbol" element="xsd:string"/> <part name="time" element="xsd:timeInstant"/> </message> <message name="GetLastTradePriceResponse"> <part name="result" type="xsd:float"/> </message> <portType name="StockQuotePortType"> <operation name="GetLastTradePrice"> <input message="tns:GetLastTradePriceRequest"/> <output message="tns:GetLastTradePriceResponse"/> </operation> </portType> ...

  35. Example <bindingname="StockQuoteSoapBinding" type="tns:StockQuotePortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="GetLastTradePrice"> <soap:operation soapAction="http://leymann.com/GetLastTradePrice"/> <input> <soap:body use="encoded" namespace="http://leymann.com/stockquote" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body use="encoded" namespace="http://leymann.com/stockquote" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> ...

  36. Example <service name="StockQuoteService"> <documentation>My first service</documentation> <port name="StockQuotePort" binding="tns:StockQuoteSoapBinding"> <soap:address location="http://leymann.com/stockquote"/> </port> </service>

  37. SOAP Request/Response Structure Request Response Object ID (Which object?) Status Code (Did it work?) Extension Headers (What has been forgottento be build into the protocol?) Interface ID (Which interface?) Endpoint Reference Parameter (Out and inout parms) Method ID (Which method?) Extension Headers (What has been forgottento be build into the protocol?) Parameter (In and inout parms)

  38. IP Host Address TCP Port No Object Endpoint ID 209.111.234.34 80 /StockServer/getLastTradePrice SOAP Endpoint Reference POST /StockServer HTTP/1.1 Host: 209.111.234.34 Content-Type: text/xml; charset=„utf-8“ Content-Length: nnnn <SOAP-ENV:Body> <m:GetLastTradePrice xmlns:m="Some-URI"> ...

  39. A Simple SOAP RPC POST /StockQuote HTTP/1.1 Host: www.stockquoteserver.com Content-Type: text/xml; charset="utf-8„ Content-Length: nnnn <SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <m:GetLastTradePrice xmlns:m="Some-URI"> <symbol>DIS</symbol> </m:GetLastTradePrice> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Method Name Input Parameter

  40. A Simple SOAP Response HTTP/1.1 200 OK Content-Type: text/xml; charset="utf-8„ Content-Length: nnnn  <SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/ SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> <SOAP-ENV:Body> <m:GetLastTradePriceResponse xmlns:m="Some-URI"> <Price>34.5</Price> </m:GetLastTradePriceResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> StandardSuffix

  41. SOAP Header POST /StockQuote HTTP/1.1 Host: www.stockquoteserver.com Content-Type: text/xml; charset="utf-8„ Content-Length: nnnn SOAPAction: „Some-URI“  <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> <SOAP-ENV:Header> <t:Transaction xmlns:t="some-URI, SOAP-ENV:mustUnderstand="1"> 5 </t:Transaction> </SOAP-ENV:Header> <SOAP-ENV:Body> <m:GetLastTradePrice xmlns:m="Some-URI"> <symbol>DEF</symbol> </m:GetLastTradePrice> </SOAP-ENV:Body> </SOAP-ENV:Envelope> ProtocolExtensions

More Related