1 / 48

Hauptseminar Web Services W3C Standards I: SOAP, WSDL, UDDI

Hauptseminar Web Services W3C Standards I: SOAP, WSDL, UDDI. Tania Fichtner Technische Universität München, Lehrstuhl für Informatik 24. April 2003, München. Agenda: 0. Web Services Einführung, Architektur, Vorgehen SOAP Beispiel, SOAP Nachricht, Datencodierung WSDL

blue
Download Presentation

Hauptseminar Web Services W3C Standards I: SOAP, WSDL, UDDI

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. HauptseminarWebServices W3C Standards I: SOAP, WSDL, UDDI Tania Fichtner Technische Universität München, Lehrstuhl für Informatik 24. April 2003, München

  2. Agenda: • 0. Web Services • Einführung, Architektur, Vorgehen • SOAP • Beispiel, SOAP Nachricht, Datencodierung • WSDL • WSDL, Struktur, Beispiel • UDDI • UDDI Registry, Kernbestandteile, Datenmodell, Beispiel

  3. 0. Web Services

  4. Dienste- Registry Sucht nach Dienst Dienste- Konsument HTTP, FTP, SMTP, … Anmeldung Nimmt Dienst in Anspruch Dienste- Anbieter Web Services. Service Orientierte Architektur • Nachrichtenaustausch • Dienst Beschreibung • Veröffentlichen / Finden Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  5. UDDI Entdeckungsschicht UDDI WSDL Beschreibungsschicht WSDL SOAP XML-Messaging -schicht SOAP Web Service Transportschicht HTTP, SMTP, FTP, BEEP Web Services. „Web Service Protocol Stack“ Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  6. 1. SOAP. Simple Object Access Protocol

  7. SOAP. Einführung • XML basiertes Datentransportprotokoll. • Umfasst Formatierung von Daten. • Kann in verschiedenen Nachrichten Systemen benutzt, und über verschiedene Transportprotokolle versendet werden.  Im Vordergrund: entfernte Methodenaufrufe (RPC) via HTTP. • Ermöglicht Dienst- und Datenaustausch. Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  8. SOAP request: „Was ist der Wert der Aktie: 923258?“ SOAP client SOAP client W2K C++ Linux Java SOAP. Request & Response. Ein Beispiel. RealtimeKursService SOAP response: „Wert: 4.32“ Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  9. SOAP. Request Nachricht: Ein Beispiel. SOAP request: „Was ist der Wert der Aktie: 923258?“ <?xml version='1.0' ?> <env:Envelope xmlns:env=” http://www.w3.org/2002/12/soap-envelope” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” > <env:Body> <ns1:getKurs xmlns:ns1=”urn:RealTimeKursService”> <wkn xsi:type=“xsd:string“>923835</wkn> </ns1:getKurs> </env:Body> </env:Envelope> SOAP client Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  10. SOAP. Request Nachricht: Ein Beispiel. SOAP request: „Was ist der Wert der Aktie: 923258?“ <?xml version='1.0' ?> <env:Envelope xmlns:env=” http://www.w3.org/2002/12/soap-envelope” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” > <env:Body> <ns1:getKurs xmlns:ns1=”urn:RealTimeKursService”> <wkn xsi:type=“xsd:string“>923835</wkn> </ns1:getKurs> </env:Body> </env:Envelope> SOAP client Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  11. SOAP. Response Nachricht: Ein Beispiel. <?xml version='1.0' ?> <env:Envelope xmlns:env=” http://www.w3.org/2002/12/soap-envelope” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”> <env:Body> <ns1:getKursResponse xmlns:ns1=”urn:RealTimeKursService” env:encodingStyle= ”http://schemas.xmlsoap.org/soap/encoding/” > <wert xsi:type=“xsd:string“>4.32</wert> </ns1:getKursResponse> </env:Body> </env:Envelope> SOAP client SOAP response: „Wert: 4.32“ Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  12. SOAP. Response Nachricht: Ein Beispiel. <?xml version='1.0' ?> <env:Envelope xmlns:env=” http://www.w3.org/2002/12/soap-envelope” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”> <env:Body> <ns1:getKursResponse xmlns:ns1=”urn:RealTimeKursService” env:encodingStyle= ”http://schemas.xmlsoap.org/soap/encoding/” > <wert xsi:type=“xsd:string“>4.32</wert> </ns1:getKursResponse> </env:Body> </env:Envelope> SOAP client SOAP response: „Wert: 4.32“ Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  13. SOAP. Response Nachricht: Ein Beispiel. <?xml version='1.0' ?> <env:Envelope xmlns:env=” http://www.w3.org/2002/12/soap-envelope” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”> <env:Body> <ns1:getKursResponse xmlns:ns1=”urn:RealTimeKursService” env:encodingStyle= ”http://schemas.xmlsoap.org/soap/encoding/” > <wert xsi:type=“xsd:string“>4.32</wert> </ns1:getKursResponse> </env:Body> </env:Envelope> SOAP client SOAP response: „Wert: 4.32“ Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  14. URI:”http://www.w3.org/2002/12/soap-envelope“ Envelope <env:Envelope> </env:Envelope> Header (optional) <env:Header> ... </env:Header> Header Block 1 (optional) Header Block 2 (optional) <env:Body> ... </env:Body> Body Fault (optional) SOAP Dokument SOAP. Nachricht Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  15. SOAP Sender SOAP Intermediary SOAP Empfänger … SOAP. Header • Optional. • Erweiterungen für Nachrichtenpfad. • Drei Attribute: „role“, „mustUnderstand“ und „relay“. Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  16. env:role=“.../role/next" role env:mustUnderstand="true" mustUnderstand env:relay="true" relay SOAP. Header Wer wird angesteuert? <env:Envelope xmlns:env=“...”> <env:Header> <p:einBlock xmlns:p=“someURI" env:role=“.../role/next" env:mustUnderstand="true"> ... </p:einBlock> <q:Blockzwei xmlns:q=“someURI" env:relay="true"> ... </q:Blockzwei> <r:Blockdrei xmlns:r=“someURI"> ... </r:Blockdrei> </env:Header> <env:Body >... </env:Body> </env:Envelope> Muss er interpretiert werden? Wie wird er verarbeitet? Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  17. Body Fault • Code - Element - Value - Element - Subcode - Element (optional) • Reason – Element • - Text - Element • Detail - Element (optional) • Node - Element (optional) • Role – Element (optional) SOAP. Body • Informationen für den Empfänger. • Fehler im Body signalisiert. code: Spezifiziert Fehler reason: Menschen lesbare Meldung detail: Anwendung spezifisch node: Wer hat Fehler verursacht role: Rolle des Knotens Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  18. SOAP. Datencodierung • Eigene Datentypdefinition. • Standard: „http://www.w3.org/2002/12/soap-encoding“ • Attribut env:encodingStyle. • Zwei Kategorien Datentypen: • Einfache: atomare Datentypen • Zusammengesetzte: Structs und arrays.  Datentypen wie in jeder Programmiersprache. Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  19. 2. WSDL. Web Services Description Language

  20. Dienste- Anbieter WSDL Aufbau WSDL Dokument WSDL. Einführung • XML basierte Sprache. • Beschreibung von Web Services. • Enthält URL des Web Service. Abstrakte Definition Binding PortType Messages Types Implementation Service Port Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  21. WSDL Wurzelelement Welche Datentypen werden gesendet? Welche Nachrichten werden gesendet? Welche Operationen werden unterstützt? Wie wird die Nachricht übermittelt? Wo ist der Web Service zu finden? WSDL. Struktur eines WSDL Dokuments I • Die WSDL Spezifikation definiert sechs Hauptteile <definitions> <types> <message> <porType> <operation> <binding> <service> <port> Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  22. Importiert externe WSDL Ressourcen. Für Menschen leserliche Information. WSDL. Struktur eines WSDL Dokuments II • WSDL Spezifikation noch zwei weitere Elemente. <definitions> ... <import> <documentation> Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  23. <definitions>: Das RealtimeKursservice <types>: Definition des ComplexType Aktienkurs. <message>: • getKursRequest: wkn Parameter • getKursResponse Aktienkurs Parameter <porType>: getKurs Operation, die aus einem Request/Response- Dienst besteht. <binding>: Anweisung das SOAP HTTP Transport Protokoll zu benutzen. <service>: Der Dienst ist unter der Adresse „http://localhost:8080/axis/services/“ zu finden. WSDL. Beispiel: RealtimeKursService Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  24. WSDL. Spezifikation: <definitions> • WSDL Wurzelelement. <definitions name=„RealtimeKursService“ targetnamespace=”http://.../wsdl/ RealtimeKursService.wsdl” xmlns=”http://schemas.xmlsoap.org/wsdl/” xmlns:soap=„http://schemas.xmlsoap.org/wsdl/soap“ xmlns:tns1=”http://.../wsdl/ RealtimeKursService.wsdl” xmlns:xsd=”http://www.w3.org/2001/XMLSchema”> Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  25. WSDL. Spezifikation: <types> • Datentypen die nicht im XML Schema-Standard sind. <types> <schema xmlns=http://www.w3.org/2001/XMLSchema targetNamespace=“RealtimeKursService“> <complexType name=“Aktienkurs“> <sequence> <element name=”name” nillable=”true” type=”xsd:string” /> <element name=”wkn” nillable=”true” type=”xsd:string” /> <element name=”kurs” type=”xsd:double” /> </sequence> </complexType> <element name=”Aktienkurs” nillable=”true” type=”tns1:Aktienkurs” /> </schema> </types> Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  26. WSDL. Spezifikation: <message> • Ausgetauschten Nachrichten. • Parameter im part Subelement definiert. <message name=”getKursResponse”> <part name=”return” type=”tns1:Aktienkurs” /> </message> <message name=”getKurstRequest”> <part name=”wkn” type=”xsd:string” /> </message> Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  27. WSDL. Spezifikation: <portType> und <operation> • Die am Web Service aufrufbaren Methoden. • Subelement operation. <portType> <operation name=”getKurs” parameterOrder=”wkn”> <input message=”tns1:getKursRequest” /> <output message=”tns1:getKursResponse” /> </operation> </portType> Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  28. WSDL. Spezifikation: <portType> und <operation> • Kommunikation Muster des operation Elements: Client Server „One-way“: <input> 1. „Request- response“: Client <input> Server <output> 2. 1. „Solicit- response“: Client Server <output> <input> 2. Client Server „Notification“: <output> Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  29. WSDL. Spezifikation: <binding> • Beschreibt wie ein Web Service mit dem Client kommuniziert (HTTP GET, HTTP POST, SOAP). <binding name=”RealtimekursService-Binding” type=”tns1:RealtimeKursService”> <soap:binding style=”rpc” transport=”...soap/http”/> <operation name=”getKurs”> <soap:operation soapAction=”getKurs”/> <input> <soap:body use=”encoded” encodingStyle=”.../encoding” namespace=”.../RealtimeKursService”/> </input> <output> <soap:body use=”encoded” encodingStyle=http://.../encoding namespace=”.../RealtimeKursService”/> </output> </operation> </binding> Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  30. WSDL. Spezifikation: <service>und<port> • Adresse des Web Services. • port: Registrierungs- name des Web Services. • adress: URL des Web Service. <service name=”RealtimeKursService_Service”> <port name=”RealtimeKursService” binding=”RealtimekursService-Binding”> <soap:address location=“http://localhost:8080/axis/ services/RealtimeKursService/”> </port> <documentation>WSDL File für RealtimeKursService </documentation> </service> Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  31. 3. UDDI. Universal Description, Discovery and Integration

  32. SOAP-Nachricht SOAP-Nachricht UDDI. Einführung • Standard um Web Services zugänglich machen. UDDI Registry Business + Service + Technik Sucht nach Dienst WSDL Dienste- Registry veröffentlicht UDDI • Spezifikation • Implementation Nimmt Dienst in Anspruch Dienste- Konsument Dienste- Anbieter Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  33. UDDI Registry Anbieter zu suchen Diensttypen zu suchen Technische Informationen zu suchen UDDI. Registry • Informationen in drei Kategorien aufgeteilt: Business „White Pages“ Service „Yellow Pages“ Technik „Green Pages“ Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  34. UDDI „cloud services“  IBM, Microsoft, SAP angeboten UDDI. Kernbestandteile • Datenstruktur •  XML Schema 2. API Spezifikation „publishing“ & „inquiry“ functions. UDDI 3. Replikations- Spezifikation 4. Spezifikation für Registry Anbieter Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  35. <BusinessService> </BusinessService> tModel <BindingTemplate>…</BindingTemplate> <BindingTemplate>…</BindingTemplate> tModel <BusinessService> </BusinessService> tModel <BindingTemplate>…</BindingTemplate> <BindingTemplate>…</BindingTemplate> tModel UDDI. Datenmodell • UDDI basiert auf XML Schema. <BusinessEntity> </BusinessEntity> Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  36. UDDI. Beispiel • http://uddi.microsoft.com • UDDI Suchpfad: BusinessEntity  BusinessService  BindingTemplate  tModel Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  37. UDDI. Beispiel XMethods Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  38. Zusammenfassung • Anforderungen einer Web Service Architektur: • Kompatibilität • Integration im WWW • Skalierbarkeit & Erweiterbarkeit • Benutzer- & Web- freundlich • Sicherheit • Funktionssicherheit / Zuverlässigkeit • Management ? ? Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  39. Vielen Dank für Ihre Aufmerksamkeit!

  40. Anhang I. Back Up

  41. SOAP Nachricht. XML Schema für Element env ... <xs:element name=“Envelope“ type=“tns:Envelope“> <xs:complexType name=“Envelope“> <xs:sequence> <xs:element ref=“tns:Header“ minOccurs=“0“/> <xs:element ref=“tns:Body“ minOccurs=“1“/> <xs:any namespace=”##other” minOccurs=“0“ maxOccurs=”unbounded” processContents=”lax”/> </xs:sequence> ... Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  42. Knoten/Role Sender Intermediary Empfänger Nicht vorhanden n/a nein ja „none“ n/a nein nein „next“ n/a ja ja „ultimateReceiver“ n/a nein ja SOAP Header. Attribut „role“ • „role“-Attribut: • Definiert welcher SOAP-Knoten sich um die Auswertung des Header Blocks kümmerns soll. • Es gibt 3 standardisierte Rollen: „none“, „next“, „ultimateReceiver“ Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  43. Knoten „mustUnderstand“ „true“ „false“ Nicht vorhanden Intermediary obligatorisch optional optional Empfänger obligatorisch optional optional SOAP Header. Attribut „mustUnderstand“ • „mustUnderstand“-Attribut: • Teilt dem jeweiligen SOAP-Knoten mit, ob er den zugehörigen Header-Block interpretieren muss. Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  44. SOAP Header. Attribute • „relay“-Attribut: • Zeigt an was getan werden muss, falls der Header-Block nicht vom angesteuerten SOAP-Knoten verarbeitet wurde. Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  45. SOAP. Fault-Beispiel <env:Body> <env:Fault> <env:Code> <env:Value>Client.Authentication</env:Value> <env:Subcode> <env:Value>rpc:BadArguments</env:Value> </env:Subcode> </env:Code> <env:Reason> <env:Text xml:lang="de">Login-Daten sind ungültig</env:Text> <env:text xml:lang="en-US">Login Data not valid</env:Text> </env:Reason> <env:Detail> <e:FehlerDetails xmlns:e="http://www.beispiel.org/faults"> <e:message>Name does not match logindata</e:message> </e:FehlerDetails> </env:Detail> </env:Fault> </env:Body> Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  46. SOAP. Datentypen: Einfache Datentypen • Atomare Datentypen. • Einfache Datentypen der XML Schema Spezifikation. <?xml version='1.0' ?> <env:Envelope xmlns:env="http://www.w3.org/2002/12/soap-envelope" xmlns:env-ENC="http://www.w3.org/2002/12/soap-encoding"   xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   env-ENC:encodingstyle="http://www.w3.org/2002/12/soap- encoding"> <env:Body> <getKurs> <wkn xsi:type=”xsd:string”>923835</wkn> </getKurs> </env:Body> </env:Envelope> Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  47. SOAP. Datentypen: Zusammengesetzte Datentypen • SOAP Arrays mit xsi:type- und arrayType- Attributen festgelegt. • Multidimensionale Arrays möglich. <env:Body> <getKursResponse env:encodingStyle=“http://www.w3.org/2002/12/soap- encoding"> <Return xmlns:ns1=“http://www.w3.org/2002/12/soap-encoding“ xsi:type=“ns1:Array“ ns1:arrayType=“xsd:string[3]“> <item xsi:type=”xsd:string”>923835</item> <item xsi:type=”xsd:string”>IBM</item> <item xsi:type=”xsd:double”>4.32</item> </Return> </getKursResponse> </env:Body> Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

  48. SOAP. Datentypen: Zusammengesetzte Datentypen • Struct: Zusammensetzung mehrere atomarer Datentypen zu einem Hochtyp. ... <env:Body> <getKursResponse env:encodingStyle=“http://www.w3.org/2002/12/soap- encoding"> <aktie> <wkn xsi:type=”xsd:string”>923835</wkn> <name xsi:type=”xsd:string”>IBM</name> <wert xsi:type=”xsd:double”>4.32</wert> </aktie> </getKursResponse> </env:Body> ... Hauptseminar Web Services – W3C Standards I: SOAP, WSDL, UDDI

More Related