web services · 2008. 5. 21. · web services einführung kommunikation java praktikum –ss 2008...

41
Praktikum aus Softwareentwicklung 2 Web Services 1 Java Praktikum – SS 2008 – [email protected]

Upload: others

Post on 20-Jan-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

Web Services

1Java Praktikum – SS 2008 – [email protected]

Page 2: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

Web Services

• Einführung– Definition, Eigenschaften, Anwendungen....

• Architektur

2Java Praktikum – SS 2008 – [email protected]

– Kommunikation, Basis Technologien....

• JAX– Überblick, Architektur...

• JAX-RPC– Übersicht, Architektur…

Page 3: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

• „...eine über das Internet zugängliche Programmier-Schnittstelle, basierend auf Internet-Technologien„

• „Mittels HTTP Adresse eindeutig identifizierbar.“

• „Gemeinsame Nutzung von Programmfunktionen über

Web Services EinführungDefinition

3Java Praktikum – SS 2008 – [email protected]

• „Gemeinsame Nutzung von Programmfunktionen über Rechnergrenzen.“

Page 4: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

• Lagerbestand von Händler abfragen– ISBN

–Artikelbezeichnung

Web Services EinführungAnwendungsbeispiele (B2B)

4Java Praktikum – SS 2008 – [email protected]

–Artikelbezeichnung

• Buchen von Flügen–Reisebüros bieten aktuelle Flüge verschiedener Gesellschaften (zentral)

• Abfragen an Suchmaschinen

Page 5: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

Web Services Einführung Kommunikation

5Java Praktikum – SS 2008 – [email protected]

Lose Kopplung:HTTP - zustandsloses Kommunikationsprotokoll

XML - "neutrales" Beschreibungs- und Nachrichtenformat

Page 6: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

Web Services Einführung Basistechnologien

Java, VB, .NET

Eine Komponente, die eine HTTP--Verbindung herstellen kann

Java, VB, .NET

Eine Komponente, dieHTTP-Verbindungen annehmen kann

6Java Praktikum – SS 2008 – [email protected]

DOM, SAX

Eine Komponente, dieAnwendungsfunktionalität bereit stellt

HTTP:TCP/IP, UDP

XML:SOAP, WSDL

DOM, SAX

Page 7: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

Web Services EinführungService Orientierte Architektur (SOA)

7Java Praktikum – SS 2008 – [email protected]

Page 8: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

• Sprachunabhängig

• Verteilte Software Komponenten

• Basiert auf XML Standards– WSDL - Web Service Description Language

Web Services EinführungEigenschaften

8Java Praktikum – SS 2008 – [email protected]

– WSDL - Web Service Description Language

– SOAP - Simple Object Access Protocol

– UDDI - Universal Description, Discovery and Integration

• DOM, SAX

• Internet Protokoll HTTP

• Lose Koppelung

Page 9: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

• REpresentational State Transfer• REST-like Web Services

– Verzicht auf WSDL– Verzicht auf Registry (UDDI)

• Service Requests

Web Services EinführungREST-like

9Java Praktikum – SS 2008 – [email protected]

• Service Requests– HTTP (GET,POST)– Kein XML, also keine Methoden und Typ Informationen

– Response Format nicht definiert, XML ist aber üblich.• Yahoo Web Services

– http://developer.yahoo.com/– Zum Beispiel: http://developer.yahoo.com/answers/

Page 10: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

• RPC – Remote Procedure Call– Sun RPC (NFS - Nework File System)– C/C++

• IIOP – Internet Inter-ORB Protocol– CORBA Middleware,

Web Services EinführungVorfahren und Verwandte

10Java Praktikum – SS 2008 – [email protected]

– CORBA Middleware, Common Object Request Broker Architecture

– Ziel ist Sprachunabhängigkeit– OMG Standard

http://www.omg.org/• DCOM – Distributed Component Object Model

– Objektorientiertes RPC-System von Microsoft, COM Erweiterung– .NET Remoting und Enterprise Services ab MS Vista integriert

• RMI – Remote Method Invocation– 100% Java– Serialisierung (fast) beliebiger Objekte

Page 11: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

Web Services EinführungLinks

• Apache– http://ws.apache.org/axis/java/index.html– http://ws.apache.org/axis2/

• IBM– http://www-106.ibm.com/developerworks/webservices

11Java Praktikum – SS 2008 – [email protected]

– http://www-106.ibm.com/developerworks/webservices

• Microsoft– http://msdn.microsoft.com/webservices

• Sun Microsystems– http://java.sun.com/webservices

• W3C– http://www.w3.org/2002/ws

Page 12: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

Web Services

• Einführung– Definition, Eigenschaften, Anwendungen....

• Architektur

12Java Praktikum – SS 2008 – [email protected]

– Kommunikation, Basis Technologien....

• JAX– Überblick, Architektur....

• JAX-RPC– Übersicht, Architektur…

Page 13: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

ArchitekturClient to Service

Benutzerschnittstelle und Prozesslogik

Web Service CallerJava, C++, C#, VB, PHP

13Java Praktikum – SS 2008 – [email protected]

Prozesslogik

Datenhaltung

Webservice Listener,Anwendungslogik,

Datenbankzugriff

Daten, Schema, Stored Procedures

Page 14: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

ArchitekturService to Service

14Java Praktikum – SS 2008 – [email protected]

Page 15: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

ArchitekturTechnologie Stack

Layer Protokoll Standard

Discover UDDI, DISCO, WSIL

Description WSDL, RDF

15Java Praktikum – SS 2008 – [email protected]

Description WSDL, RDF

Messaging SOAP, XML-RPC

Transport HTTP, SMTP, FTP

Network TCP/IP, UDP

UDDI – Universal Description, Discovery and Integration

WSDL – Webservice Description Language

SOAP – Simple Object Access Protocoll

Page 16: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

• Apache Axis– Axis 1– Axis 2: http://ws.apache.org/axis2/download/1_4/download.cgi– Eclipse 3.3

• Sun JAX-WS

ArchitekturJava Implementierungen

16Java Praktikum – SS 2008 – [email protected]

• Sun JAX-WS– https://jax-ws.dev.java.net/– NetBeans– Ab Java 6 integriert

• XFire– http://xfire.codehaus.org/– MyEclipse

• Alle basieren auf JAX-RPC

Page 17: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

• Web Service Description Language–Service Beschreibung in XML

• Server stellt WSDL zur Verfügung

ArchitekturWSDL

17Java Praktikum – SS 2008 – [email protected]

• Server stellt WSDL zur Verfügung

• Client „versteht“ WSDL–Generiert Code (Java, .NET, C++)

Page 18: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

Namespace prefix

Namespace

xsd http://www.w3.org/2001/XMLSchema

xsi http://www.w3.org/2001/XMLSchema-instance

ArchitekturXML Namespaces

18Java Praktikum – SS 2008 – [email protected]

xsi http://www.w3.org/2001/XMLSchema-instance

soapenc http://schemas.xmlsoap.org/soap/encoding/

wsdl http://schemas.xmlsoap.org/wsdl/

wsdlsoap http://schemas.xmlsoap.org/wsdl/soap/

apache http://xml.apache.org/xml-soap

ns User defined

Page 19: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

Java WSDL und XML

Service Endpoint Interface wsdl:portType

Method wsdl:operation

ArchitekturJava/WSDL Mapping

19Java Praktikum – SS 2008 – [email protected]

Parameters wsdl:input, wsdl:message, wsdl:part

Return wsdl:output, wsdl:message, wsdl:part

Throws wsdl:fault, wsdl:message, wsdl:part

Primitive types xsd and soapenc simple types (xsd:int…)

Java beans xsd:complexType

Java bean properties Nested xsd:elements of xsd:complexType

Arrays JAX-RPC defined array xsd:complexType

Page 20: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

Web Services

• Einführung– Definition, Eigenschaften, Anwendungen....

• Architektur

20Java Praktikum – SS 2008 – [email protected]

– Kommunikation, Basis Technologien....

• JAX– Überblick, Architektur....

• JAX-RPC– Übersicht, Architektur…

Page 21: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAXÜberblick

• JAX – Java API‘s for XML• Einteilung in 2 Bereiche: API‘s die direkt mit Dokumenten arbeiten und API‘s die mit Prozeduren arbeiten

21Java Praktikum – SS 2008 – [email protected]

arbeiten– Dokumenten-orientiert

• JAXP – Java API für XML Processing• JAXB – Java Architecture for XML Binding• SAAJ – SOAP with Attachments API for Java (SAAJ ist eine Implementation von JAXM – Java API for XML Messaging

– Prozedur-orientiert• JAX-RPC – Java API for XML-based RPC• JAXR – Java API for XML Registries

Page 22: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAXArchitektur

22Java Praktikum – SS 2008 – [email protected]

Page 23: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAXJAXP

• JAXP – Java API für XML Processing– SAX API– Simple API for XML

– DOM API – Document Object Model

23Java Praktikum – SS 2008 – [email protected]

– XSLT API – XML Stylesheet Language for Transformations• XML Stylesheet Language (XSL) bestimmt wie die XML Daten angezeigt werden

• XSLT benutzt die Formatangaben von XSL für die Transformation

Page 24: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAXJAXB - Überblick

• Java Architecture for XML Binding– Ein Konzept um XML Dokumente im Speicher zu repräsentieren

– Automatisches Erzeugen von Java Klassen aus vorgegebenem XML Schema

24Java Praktikum – SS 2008 – [email protected]

vorgegebenem XML Schema– Spezielle Klassen für XML-Elemente / Attribute– Methoden zum Zugriff auf Attribute und Baumstruktur (getypt)

– Java Objekte instanzieren diese Klassen– Abbildungsprozess erfolgt über Marshalling Framework

„marshal“ Java Objekte �XML Elemente„unmarshal“ XML Elemente � Java Objekte

Page 25: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAXJAXB – Bind Process

3

1

25Java Praktikum – SS 2008 – [email protected]

Validierung

5

4

3

2

Page 26: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAXJAXB – compile

<?xml version="1.0"?>

<XmlEmployees>

<XmlEmployee>

<EmpNo>2</EmpNo>

<FirstName>Robert</FirstName>

<LastName>Nelson</LastName>

public interface XmlEmployeeType {

java.lang.String getJobCode();

26Java Praktikum – SS 2008 – [email protected]

<LastName>Nelson</LastName>

<PhoneExt>250</PhoneExt>

<HireDate>1988-12-28</HireDate>

<DeptNo>600</DeptNo>

<JobCode>VP</JobCode>

<JobGrade>2</JobGrade>

<JobCountry>USA</JobCountry>

<Salary>105900.000000</Salary>

<FullName>Nelson,

Robert</FullName>

</XmlEmployee>

</XmlEmployees>

java.lang.String getJobCode();

void setJobCode(java.lang.String value);

java.lang.String getDeptNo();

void setDeptNo(java.lang.String value);

java.lang.String getPhoneExt();

void setPhoneExt(java.lang.String

value);

....

}

Page 27: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAXSAAJ

• SOAP with Attachments API for Java ist ein Standard für die Versendung von XML Dokumenten über das Internet

• Basiert auf SOAP 1.1 und der SOAP with

27Java Praktikum – SS 2008 – [email protected]

• Basiert auf SOAP 1.1 und der SOAP with Attachments Spezifikation

• Low-level SOAP Schnittstellen• JAX-RPC basiert auf SAAJ• Synchroner Request/Response Mechanismus

Page 28: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAXJAXR - Registries

• Java API for XML Registries

• Registries sind Verzeichnisse von Services

• Generische API zum Abfragen/Bearbeiten von

28Java Praktikum – SS 2008 – [email protected]

• Generische API zum Abfragen/Bearbeiten von Registries, die JAXR Provider bereitstellen

• Unterstützt Vereinigungsmenge der Konzepte komplementärer Ansätze (z.B. UDDI, ebXML)

• Package: javax.xml.registry

Page 29: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAXJAXR - Architketur

29Java Praktikum – SS 2008 – [email protected]

Page 30: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAXSOAP – (1/3)

• Simple Object Access Protocol

• Lightweight Message Protokoll

• Getypter Datenaustausch zwischen Applikationen

• Nachrichtenstruktur wird in XML definiert

30Java Praktikum – SS 2008 – [email protected]

• Nachrichtenstruktur wird in XML definiert

• Besonders geeignet für RPC Funktionalität

• Lose Kopplung

• Transport Binding über darunterliegendes Transport Protokoll - HTTP

Page 31: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAXSOAP – (2/3)

• Spezifikation SOAP v. 1.1

• W3C Spezifikation: http://www.w3.org

• Umfasst:

31Java Praktikum – SS 2008 – [email protected]

• Umfasst:– SOAP envelope – Struktur eine SOAP Nachricht

– SOAP encoding – deserialisierungs Regeln

– SOAP binding Framework – Binding an ein bestimmtes Transport Protokoll

– SOAP RPC

Page 32: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAXSOAP – (3/3)

32Java Praktikum – SS 2008 – [email protected]

Page 33: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

Web Services

• Einführung– Definition, Eigenschaften, Anwendungen....

• Architektur

33Java Praktikum – SS 2008 – [email protected]

– Kommunikation, Basis Technologien....

• JAX– Überblick, Architektur....

• JAX-RPC– Übersicht, Architektur….

Page 34: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAX-RPCÜbersicht

• „Java API for XML based RPC“• RPC = Remote Procedure Call• Programmierschnittstelle

34Java Praktikum – SS 2008 – [email protected]

– Für Entwicklung von Web Services– Für Entwicklung von Web Services Clients

• Referenz Implementierung und Developer Pack von Sun Microsystems: JWSDP 2.0–http://java.sun.com/webservices/downloads/webservicespack.html

Page 35: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAX-RPCClient/Server Schnittstelle

• Protokoll basiert auf SOAP• API “versteckt” hohe Komplexität• Ein Service X implementiert ein Interface welches ein oder

mehrere Remote Prozeduren des Services beschreibt• Client verwendet Stub Objekt zum Aufrufen von Methoden des

35Java Praktikum – SS 2008 – [email protected]

• Client verwendet Stub Objekt zum Aufrufen von Methoden des Service Objekts Tie

Page 36: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAX-RPCClient/Server Schichten

36Java Praktikum – SS 2008 – [email protected]

Page 37: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAX-RPCEntwicklungschritte

• Entwicklung des Webservices1. Implementierung:

Codierung des „service endpoint interface“

37Java Praktikum – SS 2008 – [email protected]

Codierung des „service endpoint interface“ 2. Build (otpional): Generierung, Übersetzung und

Verpackung der Dateien welche für den Service benötigt werden – kann auch zur Laufzeit erfoglen, wie bei Axis via Reflection

3. Deploy: abhängig von Distribution (JAR, WAR, deployment descriptor…)

Page 38: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAX-RPCType Mappings

Java Type XML Type

int, long, short, float, byte… xsd:int, xsd:long, xsd:short…

byte[] xsd:base64Binary

java.lang.String xsd:string

38Java Praktikum – SS 2008 – [email protected]

java.lang.String xsd:string

java.math.BigInteger xsd:integer

java.math.BigDecimal xsd:decimal

java.util.Calendar xsd:dateTime

java.util.Date xsd:date

java.util.Map apache:Map

java.util.Collection soapenc:Array

Page 39: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAX-RPCServer

• Web Services Engine verwaltet Services–Kommunikation basiert auf HTTP– Implementierung basiert auf Servlets

39Java Praktikum – SS 2008 – [email protected]

– Implementierung basiert auf Servlets–Realisiert SOAP Protokoll

• Notwendige Komponenten–HTTP Server–Servlet Engine–Services Engine

Page 40: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

JAX-RPCArten von Clients

• 3 Arten von Webservice Clients– Static stub � die Stub-Klasse wird vor der Laufzeit erzeugt. Die Stub Klasse wird als statischer Proxy verwendet

– Dynamic proxy � die Stub-Klasse wird zur Laufzeit erzeugt

40Java Praktikum – SS 2008 – [email protected]

– Dynamic proxy � die Stub-Klasse wird zur Laufzeit erzeugt und kann auch als dynamischer Proxy bezeichnet werden

– Dynamic invocation interface (DII) � mit diesen Interface können Remote Procedures auch dann aufgerufen werden, wenn die Signatur oder der Service bis zur Laufzeit nicht bekannt sind. Diese Clients sind kompliziert zu entwickeln und man benötigt genau Kenntnisse von WSDL -Dokumenten

Page 41: Web Services · 2008. 5. 21. · Web Services Einführung Kommunikation Java Praktikum –SS 2008 –Gerald.Ehmayer@borland.com 5 Lose Kopplung: HTTP - zustandsloses Kommunikationsprotokoll

Praktikum aus Softwareentwicklung 2

Ende der 8. Übung

41Java Praktikum – SS 2008 – [email protected]