1 / 38

Web Services Introduction

Web Services Introduction. Jan Odstrčil. Přehled. Web services - technologie WSDL, SOAP, UDDI Advanced Web services Web services – aplikace a použití Platformy pro Web services WS-I – úvodní představení WS-I Basic Profile 1.1 Otázky a odpovědi. Web services - technologie.

valora
Télécharger la présentation

Web Services Introduction

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 Introduction Jan Odstrčil

  2. Přehled • Web services - technologie • WSDL, SOAP, UDDI • Advanced Web services • Web services – aplikace a použití • Platformy pro Web services • WS-I – úvodní představení • WS-I Basic Profile 1.1 • Otázky a odpovědi

  3. Web services - technologie • Nezávislá na platformě, jazyce, hardware • Samopopisující, loosely coupled • Založená na standardech Internetu a XML • WSDL – jazyk pro popis Web services založený na XML • XSD – datové typy popsány v XML Schema • SOAP – protokol pro výměnu zpráv založených na XML • HTTP typicky využíváno jako transportní vrstva • UDDI – platformově nezávislá service registry • založené na XML

  4. Web services - technologie

  5. WSDL • Web Services Description Language • otevřený standard podporovaný W3C • popis služby a její komunikace v XML • využívá XML Schema pro popis typů

  6. WSDL • Definitions • hlavní tag uzavírající dokument • Types • sekce pro definici datových typů • obsahuje komplexní typy jako XML Schema • Message • definice zprávý – jak příchozí tak odchozí • Definuje parametry a návratové hodnoty

  7. WSDL • Operation • Definuje operaci (metodu) služby • Obsahuje obvykle input a output message • PortType • definuje rozhraní Web service deklarativně • obsahuje operace • Nehovoří o určité instanci, nelze se připojit

  8. WSDL • Binding • definuje způsob jak se budou posílat zprávy • Konkrétní protokol a datový formát (document/literal, rcp/encoded) • Port • endpoint – adresa a binding • Service • skupina souvisejících endpointu

  9. WSDL • <?xml version="1.0"?> • <definitions name="StockQuote" • targetNamespace="http://example.com/stockquote.wsdl" • xmlns:tns="http://example.com/stockquote.wsdl" • xmlns:xsd1="http://example.com/stockquote.xsd" • xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" • xmlns="http://schemas.xmlsoap.org/wsdl/"> • <types> • <schema targetNamespace="http://example.com/stockquote.xsd" • xmlns="http://www.w3.org/2000/10/XMLSchema"> • <element name="TradePriceRequest"> • <complexType> • <all> • <element name="tickerSymbol" type="string"/> • </all> • </complexType> • </element> • <element name="TradePrice"> • <complexType>

  10. WSDL • <message name="GetLastTradePriceInput"> • <part name="body" element="xsd1:TradePriceRequest"/> • </message> • <message name="GetLastTradePriceOutput"> • <part name="body" element="xsd1:TradePrice"/> • </message> • <portType name="StockQuotePortType"> • <operation name="GetLastTradePrice"> • <input message="tns:GetLastTradePriceInput"/> • <output message="tns:GetLastTradePriceOutput"/> • </operation> • </portType>

  11. WSDL <binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType"> • <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> • <operation name="GetLastTradePrice"> • <soap:operation soapAction="http://example.com/GetLastTradePrice"/> • <input> • <soap:body use="literal"/> • </input> • <output> • <soap:body use="literal"/> • </output> • </operation> • </binding> • <service name="StockQuoteService"> • <documentation>My first service</documentation> • <port name="StockQuotePort" binding="tns:StockQuoteBinding"> • <soap:address location="http://example.com/stockquote"/> • </port> • </service> • </definitions>

  12. WSDL • Documentation – wsdl je samo-dokumentované • Import - dokumenty je možné importovat • vhodné pro oddělení statické definice datových typů a portu od instance • Instance obsahuje binding, service a import <wsdl:definitions name="nmtoken"? targetNamespace="uri"?> <import namespace=„http://myS.org" location=„ http://myS.org/wsdl/StockType.wsdl"/> <wsdl:documentation>…text… </wsdl:documentation>

  13. SOAP • Simple Object Access Protocol • Protokol pro výměnu zpráv založených na XML • HTTP typicky využíváno jako transportní vrstva • SMTP také vhodný pro transport SOAP

  14. SOAP • Různé druhy kódování zpráv • RPC / Encoded • Document / Literal • Wrapped / Literal • Definováno v binding sekci WSDL

  15. SOAP rpc/encoded • public void myMethod(int x, float y); • <message name="myMethodRequest"> • <part name="x" type="xsd:int"/> • <part name="y" type="xsd:float"/> • </message> • <message name="empty"/> • <portType name="PT"> • <operation name="myMethod"> • <input message="myMethodRequest"/> • <output message="empty"/> • </operation> • </portType>

  16. SOAP rpc/encoded • <soap:envelope> • <soap:body> • <myMethod> • <x xsi:type="xsd:int">5</x> • <y xsi:type="xsd:float">5.0</y> • </myMethod> • </soap:body> • </soap:envelope> • Jednoduchý zápis ve wsdl • Jméno operace je v message – rychlé předání implementaci • Type encoding info (xsi:type="xsd:int") zabírá moc místa • Není ve shodě s WS-I

  17. SOAP wrapped/literal • <soap:envelope> • <soap:body> • <myMethod> • <x>5</x> • <y>5.0</y> • </myMethod> • </soap:body> • </soap:envelope> • Složitý zápis ve wsdl • Jméno operace je v message – rychlé předání implementaci • Type encoding info (xsi:type="xsd:int") zabírá moc místa • Je ve shodě s WS-I

  18. UDDI • Universal Description, Discovery and Integration • otevřený standard podporovaný OASIS • umožňuje publikaci, vyhledávání, kategorizaci • v počátcích globální UDDI registry (MS, IBM, SAP) • 3 základní komponenty • White Pages — adresy, kontakty • Yellow Pages — kategorizacepodle standardních taxonomii; • Green Pages — technické informaceoserviceszveřejněných společnostmi

  19. UDDI • businessEntity • informace o straně publikující service • businessService • popisné informace o určité skupině technických services • bindingTemplate • technické informace endpointu služby a implementační specifikaci • tModel • popis specifikaci pro služby, základ pro technícký popis

  20. UDDI

  21. UDDI • <tModel authorizedName="..." operator="..." tModelKey="..."> •    <name>StockQuote Service</name> •    <description xml:lang="en"> •       WSDL description of a standard stock quote service interface •    </description> •    <overviewDoc> •       <description xml:lang="en">WSDL source document. •      </description> •      <overviewURL> • http://stockquote-definitions/stq.wsdl •      </overviewURL> •    </overviewDoc> •    <categoryBag> • <keyedReference tModelKey="uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4" •                 keyName="uddi-org:types" •                 keyValue="wsdlSpec"/> •    </categoryBag> • </tModel>

  22. Advenced Web services • WS - Reliable Messaging • jednoduché posílání, spolehlivé • WS - Attachment • posílání velkých dokumentů / binárních • WS – Security • rozšíření SOAP message o security • chrání pomocí integrity zprávy • message authentication

  23. Web services – aplikace a použití • Více než informace o počasí • Aplikace dostupné jako služba „masám“ • Google Search API, eBay • SalesForce (CRM, lze rozšířit, integrovat) • Mobile Portal Content • Integrační scénáře • banka koupí banku • jedna divize s druhou • Intereoperabilita vítězí nad „efektivitou“

  24. Web services – aplikace a použití

  25. Platformy pro Web services

  26. Platformy pro Web services • Microsoft .Net • Apache Axis • Sun J2EE, JAX-WS JAX-B • Systinet Server for Java / C++ • webMethods Glue • IONA Artix • IBM

  27. WS-I – úvodní představení • Web Services Interoperability Organization • Otevřená organizace zaměřená na podporu interopertabilty Web services • různé platformy, jazyky, operační systémy • Přibližně 130 členů: BEA, IBM, Accenture, CA, DaimlerChrysler, DISA, HP, Microsoft, Nokia, OMG, SAP, Sun, webMethods

  28. WS-I – doporuční, profiles, tools • Samotná specifikace obvykle nestačí • nepřesná, konflikt s jinou specifikací / verzí • Poskytuje doporučení, návody a nástroje • profile – sada specifikací určité verze, říká jak je používat dohromady • demo aplikace – demonstruje interoperabilitu profilu • testovací nástroje – testují shodu implementace s profilem

  29. WS-I – rozšířené služby • Pro členy poskytuje další služby • Organizuje interoperability setkání • několikadenní setkání na určité téma • snaha o živé ověření interoperability a případné testování • Publikuje výsledky o interop setkáních • Organizuje poskytování testovacích Web service pro pravidelné testy

  30. WS-I – existující profily • XML Schema Work Plan • Basic Profile 1.1 • Attachment Profile 1.0 • Basic Security Profile 1.1

  31. WS-I Basic Profile 1.1 • Sada Web services specifikací rozšířená o • vyjasnění, upřesnění, rozvedení, interpretace • Zaměřuje se na: • Zprávy (SOAP) • Popis služeb (WSDL, XSD) • Publikace a vyhledávání služeb (UDDI) • Zabezpečení (HTTPS)

  32. WS-I Basic Profile 1.1 • Conformance requrements • požadavané kritérium které je třeba splnit • MUST, SHOULD, MAY • Conformance Targets • Indikuje na co je Conformance requrements aplikován • SOAP message • WSDL document • UDDI tModel

  33. WS-I Basic Profile 1.1 • Conformance requrements • požadavané kritérium které je třeba splnit • MUST, SHOULD, MAY • Conformance Targets • Indikuje na co je Conformance requrements aplikován • SOAP message • WSDL document • UDDI tModel

  34. BP 1.1 Test Assertions • Dokument obsahuje sadu testovacích assertion • Assertion je ve stavu OK nebo FAILED • Testovací tool implementuje požadované assertions a generuje reporty o stavu

  35. WSDL Assertions - ukázka • BP2700 • The wsdl:definitions is a well-formed XML 1.0 document • BP2202 • The XML declaration statement uses UTF-8 or UTF-16 for the encoding. • BP2098 • The "location" attribute is specified for the wsdl:import element, and has a non-empty value. • BP2104 • The targetNamespace attribute on the wsdl:definitions element for the imported WSDL description has the same value as the namespace attribute on the wsdl:import element that imported the WSDL description.

  36. UDDI a SOAP Assertions • BP3002 • The uddi:bindingTemplate element contains a uddi:accessPoint element, with a non-empty value. • BP1004 • The request message is a POST message, without any use of framework extension.

  37. Otázky a odpovědi

More Related