Hauptseminar Web Services W 3 C Standards I
Hauptseminar Web Services W 3 C Standards I: SOAP, WSDL, UDDI Tania Fichtner Technische Universität München, Lehrstuhl für Informatik 24. April 2003, München 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
Agenda: 0. Web Services - Einführung, Architektur, Vorgehen 1. SOAP - Beispiel, SOAP Nachricht, Datencodierung 2. WSDL - WSDL, Struktur, Beispiel 3. UDDI - UDDI Registry, Kernbestandteile, Datenmodell, Beispiel 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
0. Web Services 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
Web Services. Service Orientierte Architektur • Nachrichtenaustausch • Dienst Beschreibung • Veröffentlichen / Finden ht Suc Dienste. Konsument t iens D ch na HTTP, FTP, SMTP, … Nim mt Die nst in A nsp Anmeldung ruch 24. April 2003 Dienste. Registry Dienste. Anbieter Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
Web Services. „Web Service Protocol Stack“ UDDI Entdeckungsschicht UDDI Beschreibungsschicht WSDL XML-Messaging -schicht SOAP Transportschicht 24. April 2003 WSDL SOAP Web Service HTTP, SMTP, FTP, BEEP Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
1. SOAP. Simple Object Access Protocol 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
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. 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
SOAP. Request & Response. Ein Beispiel. SOAP request: „Was ist der Wert der Aktie: 923258? “ SOAP client Realtime. Kurs. Service SOAP client W 2 K C++ Linux Java SOAP response: „Wert: 4. 32“ 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
SOAP. Request Nachricht: Ein Beispiel. SOAP request: „Was ist der Wert der Aktie: 923258? “ <? xml version='1. 0' ? > SOAP client <env: Envelope xmlns: env=” http: //www. w 3. org/2002/12/soap-envelope” xmlns: xsi=”http: //www. w 3. org/2001/XMLSchema-instance” xmlns: xsd=”http: //www. w 3. org/2001/XMLSchema” > <env: Body> <ns 1: get. Kurs xmlns: ns 1=”urn: Real. Time. Kurs. Service”> <wkn xsi: type=“xsd: string“>923835</wkn> </ns 1: get. Kurs> </env: Body> </env: Envelope> 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
SOAP. Request Nachricht: Ein Beispiel. SOAP request: „Was ist der Wert der Aktie: 923258? “ <? xml version='1. 0' ? > SOAP client <env: Envelope xmlns: env=” http: //www. w 3. org/2002/12/soap-envelope” xmlns: xsi=”http: //www. w 3. org/2001/XMLSchema-instance” xmlns: xsd=”http: //www. w 3. org/2001/XMLSchema” > <env: Body> <ns 1: get. Kurs xmlns: ns 1=”urn: Real. Time. Kurs. Service”> <wkn xsi: type=“xsd: string“>923835</wkn> </ns 1: get. Kurs> </env: Body> </env: Envelope> 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
SOAP. Response Nachricht: Ein Beispiel. <? xml version='1. 0' ? > <env: Envelope xmlns: env=” http: //www. w 3. org/2002/12/soap-envelope” xmlns: xsi=”http: //www. w 3. org/2001/XMLSchema-instance” xmlns: xsd=”http: //www. w 3. org/2001/XMLSchema”> <env: Body> <ns 1: get. Kurs. Response xmlns: ns 1=”urn: Real. Time. Kurs. Service” env: encoding. Style= ”http: //schemas. xmlsoap. org/soap/encoding/” > <wert xsi: type=“xsd: string“>4. 32</wert> </ns 1: get. Kurs. Response> </env: Body> </env: Envelope> SOAP response: „Wert: 4. 32“ 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI SOAP client
SOAP. Response Nachricht: Ein Beispiel. <? xml version='1. 0' ? > <env: Envelope xmlns: env=” http: //www. w 3. org/2002/12/soap-envelope” xmlns: xsi=”http: //www. w 3. org/2001/XMLSchema-instance” xmlns: xsd=”http: //www. w 3. org/2001/XMLSchema”> <env: Body> <ns 1: get. Kurs. Response xmlns: ns 1=”urn: Real. Time. Kurs. Service” env: encoding. Style= ”http: //schemas. xmlsoap. org/soap/encoding/” > <wert xsi: type=“xsd: string“>4. 32</wert> </ns 1: get. Kurs. Response> </env: Body> </env: Envelope> SOAP response: „Wert: 4. 32“ 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI SOAP client
SOAP. Response Nachricht: Ein Beispiel. <? xml version='1. 0' ? > <env: Envelope xmlns: env=” http: //www. w 3. org/2002/12/soap-envelope” xmlns: xsi=”http: //www. w 3. org/2001/XMLSchema-instance” xmlns: xsd=”http: //www. w 3. org/2001/XMLSchema”> <env: Body> <ns 1: get. Kurs. Response xmlns: ns 1=”urn: Real. Time. Kurs. Service” env: encoding. Style= ”http: //schemas. xmlsoap. org/soap/encoding/” > <wert xsi: type=“xsd: string“>4. 32</wert> </ns 1: get. Kurs. Response> </env: Body> </env: Envelope> SOAP response: „Wert: 4. 32“ 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI SOAP client
SOAP. Nachricht URI: ”http: //www. w 3. org/2002/12/soap-envelope“ Envelope Header (optional) Header Block 1 (optional) Header Block 2 (optional) <env: Envelope> <env: Header> . . . </env: Header> <env: Body> . . . </env: Body> Body Fault (optional) </env: Envelope> SOAP Dokument 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
SOAP. Header • Optional. • Erweiterungen für Nachrichtenpfad. SOAP Sender SOAP Intermediary … SOAP Empfänger • Drei Attribute: „role“, „must. Understand“ und „relay“. 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
SOAP. Header <env: Envelope xmlns: env=“. . . ”> <env: Header> <p: ein. Block xmlns: p=“some. URI" env: role=“. . . /role/next" env: must. Understand="true"> env: must. Understand="true" . . . </p: ein. Block> <q: Blockzwei xmlns: q=“some. URI" env: relay="true"> env: relay="true" . . . </q: Blockzwei> <r: Blockdrei xmlns: r=“some. URI"> . . . </r: Blockdrei> </env: Header> Wer wird angesteuert? role must. Understand relay Muss er interpretiert werden? Wie wird er verarbeitet? <env: Body >. . . </env: Body> </env: Envelope> 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
SOAP. Body • Informationen für den Empfänger. • Fehler im Body signalisiert. Body Fault code: Spezifiziert Fehler • Code - Element - Value - Element - Subcode - Element (optional) reason: Menschen lesbare Meldung • Reason – Element - Text - Element detail: Anwendung spezifisch • Detail - Element (optional) • Node - Element (optional) • Role – Element (optional) 24. April 2003 node: Wer hat Fehler verursacht role: Rolle des Knotens Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
SOAP. Datencodierung • Eigene Datentypdefinition. • Standard: „http: //www. w 3. org/2002/12/soap-encoding“ • Attribut env: encoding. Style. • Zwei Kategorien Datentypen: – Einfache: atomare Datentypen – Zusammengesetzte: Structs und arrays. Datentypen wie in jeder Programmiersprache. 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
2. WSDL. Web Services Description Language 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
WSDL. Einführung • XML basierte Sprache. • Beschreibung von Web Services. • Enthält URL des Web Service. Abstrakte Definition Dienste. Anbieter Binding Port. Type Messages Types WSDL Implementation Service Port Aufbau WSDL Dokument 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
WSDL. Struktur eines WSDL Dokuments I • Die WSDL Spezifikation definiert sechs Hauptteile <definitions> WSDL Wurzelelement <types> Welche Datentypen werden gesendet? <message> Welche Nachrichten werden gesendet? <por. Type> <operation> <binding> <service> 24. April 2003 Welche Operationen werden unterstützt? Wie wird die Nachricht übermittelt? <port> Wo ist der Web Service zu finden? Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
WSDL. Struktur eines WSDL Dokuments II • WSDL Spezifikation noch zwei weitere Elemente. <definitions> . . . <import> Importiert externe WSDL Ressourcen. <documentation> 24. April 2003 Für Menschen leserliche Information. Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
WSDL. Beispiel: Realtime. Kurs. Service <definitions>: Das Realtime. Kursservice <types>: Definition des Complex. Type Aktienkurs. <message>: 1) get. Kurs. Request: wkn Parameter 2) get. Kurs. Response Aktienkurs Parameter <por. Type>: get. Kurs Operation, die aus einem Request/Response- Dienst besteht. 24. April 2003 <binding>: Anweisung das SOAP HTTP Transport Protokoll zu benutzen. <service>: Der Dienst ist unter der Adresse „http: //localhost: 8080/axis/services/“ zu finden. Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
WSDL. Spezifikation: <definitions> • WSDL Wurzelelement. <definitions name=„Realtime. Kurs. Service“ targetnamespace=”http: //. . . /wsdl/ Realtime. Kurs. Service. wsdl” xmlns=”http: //schemas. xmlsoap. org/wsdl/” xmlns: soap=„http: //schemas. xmlsoap. org/wsdl/soap“ xmlns: tns 1=”http: //. . . /wsdl/ Realtime. Kurs. Service. wsdl” xmlns: xsd=”http: //www. w 3. org/2001/XMLSchema”> 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
WSDL. Spezifikation: <types> • Datentypen die nicht im XML Schema-Standard sind. <types> <schema xmlns=http: //www. w 3. org/2001/XMLSchema target. Namespace=“Realtime. Kurs. Service“> <complex. Type 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> </complex. Type> <element name=”Aktienkurs” nillable=”true” type=”tns 1: Aktienkurs” /> </schema> </types> 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
WSDL. Spezifikation: <message> • Ausgetauschten Nachrichten. • Parameter im part Subelement definiert. <message name=”get. Kurs. Response”> <part name=”return” type=”tns 1: Aktienkurs” /> </message> <message name=”get. Kurst. Request”> <part name=”wkn” type=”xsd: string” /> </message> 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
WSDL. Spezifikation: <port. Type> und <operation> • Die am Web Service aufrufbaren Methoden. • Subelement operation. <port. Type> <operation name=”get. Kurs” parameter. Order=”wkn”> <input message=”tns 1: get. Kurs. Request” /> <output message=”tns 1: get. Kurs. Response” /> </operation> </port. Type> 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
WSDL. Spezifikation: <port. Type> und <operation> • Kommunikation Muster des operation Elements: „One-way“: „Requestresponse“: Client <input> 1. Client <input> <output> Server 2. „Solicitresponse“: 1. Client <output> 2. „Notification“: 24. April 2003 Client Server <input> <output> Server Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
WSDL. Spezifikation: <binding> • Beschreibt wie ein Web Service mit dem Client kommuniziert (HTTP GET, HTTP POST, SOAP). <binding name=”Realtimekurs. Service-Binding” type=”tns 1: Realtime. Kurs. Service”> <soap: binding style=”rpc” transport=”. . . soap/http”/> <operation name=”get. Kurs”> <soap: operation soap. Action=”get. Kurs”/> <input> <soap: body use=”encoded” encoding. Style=”. . . /encoding” namespace=”. . . /Realtime. Kurs. Service”/> </input> <output> <soap: body use=”encoded” encoding. Style=http: //. . . /encoding namespace=”. . . /Realtime. Kurs. Service”/> </output> </operation> </binding> 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
WSDL. Spezifikation: <service> und <port> • Adresse des Web Services. • port: Registrierungs- name des Web Services. • adress: URL des Web Service. <service name=”Realtime. Kurs. Service_Service”> <port name=”Realtime. Kurs. Service” binding=”Realtimekurs. Service-Binding”> <soap: address location=“http: //localhost: 8080/axis/ services/Realtime. Kurs. Service/”> </port> <documentation>WSDL File für Realtime. Kurs. Service </documentation> </service> 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
3. UDDI. Universal Description, Discovery and Integration 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
UDDI. Einführung • Standard um Web Services zugänglich machen. UDDI Registry Business + Service + Technik Sucht nach Dienste- Registry UDDI WSDL veröffentlicht Nimmt Dienst in Anspruch Dienste. Konsument 24. April 2003 - Spezifikation SOAP-Nachricht - Implementation SOAP-Nachricht Dienste. Anbieter Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
UDDI. Registry • Informationen in drei Kategorien aufgeteilt: UDDI Registry Business „White Pages“ Anbieter zu suchen Service „Yellow Pages“ Diensttypen zu suchen Technik „Green Pages“ 24. April 2003 Technische Informationen zu suchen Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
UDDI. Kernbestandteile 2. API Spezifikation 1. Datenstruktur „publishing“ & „inquiry“ functions. XML Schema UDDI 3. Replikations. Spezifikation 4. Spezifikation für Registry Anbieter UDDI „cloud services“ IBM, Microsoft, SAP angeboten 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
UDDI. Datenmodell • UDDI basiert auf XML Schema. <Business. Entity> <Business. Service> <Binding. Template>…</Binding. Template> t. Model <Binding. Template>…</Binding. Template> </Business. Service> t. Model </Business. Entity> 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
UDDI. Beispiel • http: //uddi. microsoft. com • UDDI Suchpfad: Business. Entity Business. Service Binding. Template t. Model 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
UDDI. Beispiel XMethods 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
Zusammenfassung • Anforderungen einer Web Service Architektur: üüüü? ? - Kompatibilität Integration im WWW Skalierbarkeit & Erweiterbarkeit Benutzer- & Web- freundlich Sicherheit Funktionssicherheit / Zuverlässigkeit - Management 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
Vielen Dank für Ihre Aufmerksamkeit! 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
Anhang I. Back Up 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
SOAP Nachricht. XML Schema für Element env. . . <xs: element name=“Envelope“ type=“tns: Envelope“> <xs: complex. Type name=“Envelope“> <xs: sequence> <xs: element ref=“tns: Header“ min. Occurs=“ 0“/> <xs: element ref=“tns: Body“ min. Occurs=“ 1“/> <xs: any namespace=”##other” min. Occurs=“ 0“ max. Occurs=”unbounded” process. Contents=”lax”/> </xs: sequence>. . . 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
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“, „ultimate. Receiver“ Knoten/Role Sender Intermediary Empfänger 24. April 2003 Nicht vorhanden n/a nein ja „none“ n/a nein „next“ n/a ja ja „ultimate. Receiver“ n/a nein ja Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
SOAP Header. Attribut „must. Understand“ • „must. Understand“-Attribut: – Teilt dem jeweiligen SOAP-Knoten mit, ob er den zugehörigen Header-Block interpretieren muss. Knoten „must. Understand“ „true“ „false“ Nicht vorhanden 24. April 2003 Intermediary Empfänger obligatorisch optional Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
SOAP Header. Attribute • „relay“-Attribut: – Zeigt an was getan werden muss, falls der Header-Block nicht vom angesteuerten SOAP-Knoten verarbeitet wurde. Role Short-name next user-defined Header block Yes No 24. April 2003 Understood & Processed Assumed ultimate. Receiver Yes none No Forwarded Yes No, unless reinserted No No, unless relay ="true" n/a Yes n/a No n/a Yes Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
SOAP. Fault-Beispiel <env: Body> <env: Fault> <env: Code> <env: Value>Client. Authentication</env: Value> <env: Subcode> <env: Value>rpc: Bad. Arguments</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: Fehler. Details xmlns: e="http: //www. beispiel. org/faults"> <e: message>Name does not match logindata</e: message> </e: Fehler. Details> </env: Detail> </env: Fault> </env: Body> 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
SOAP. Datentypen: Einfache Datentypen • Atomare Datentypen. • Einfache Datentypen der XML Schema Spezifikation. <? xml version='1. 0' ? > <env: Envelope xmlns: env="http: //www. w 3. org/2002/12/soap-envelope" xmlns: env-ENC="http: //www. w 3. org/2002/12/soap-encoding" xmlns: xsd="http: //www. w 3. org/2001/XMLSchema" xmlns: xsi="http: //www. w 3. org/2001/XMLSchema-instance" env-ENC: encodingstyle="http: //www. w 3. org/2002/12/soap encoding"> <env: Body> <get. Kurs> <wkn xsi: type=”xsd: string”>923835</wkn> </get. Kurs> </env: Body> </env: Envelope> 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
SOAP. Datentypen: Zusammengesetzte Datentypen • SOAP Arrays mit xsi: type- und array. Type- Attributen festgelegt. <env: Body> <get. Kurs. Response env: encoding. Style=“http: //www. w 3. org/2002/12/soap encoding"> <Return xmlns: ns 1=“http: //www. w 3. org/2002/12/soap-encoding“ xsi: type=“ns 1: Array“ ns 1: array. Type=“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> </get. Kurs. Response> </env: Body> • Multidimensionale Arrays möglich. 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
SOAP. Datentypen: Zusammengesetzte Datentypen • Struct: Zusammensetzung mehrere atomarer Datentypen zu einem Hochtyp. . <env: Body> <get. Kurs. Response env: encoding. Style=“http: //www. w 3. 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> </get. Kurs. Response> </env: Body>. . . 24. April 2003 Hauptseminar Web Services – W 3 C Standards I: SOAP, WSDL, UDDI
- Slides: 48