20
Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC-2 (SS2014)

Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Embed Size (px)

Citation preview

Page 1: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Projekt Systemintegration Datler, Kroiß, Sachs

Systemintegration ILV, FL / MIC-2  (SS2014)

Page 2: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Aufgabenstellung

Im Rahmen dieses Projektes sollen verschiedene Arten von Web Services entwickelt

und in einer Applikation integriert werden.

2© 2013/14 FH Technikum Wien

Page 3: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Architekturüberblick - Angabe

3© 2013/14 FH Technikum Wien

Page 4: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Architekturüberblick - Umsetzung

4© 2013/14 FH Technikum Wien

AutoverleihPython

http://sintrest-sumpfgottheit.rhcloud.comOpenShift - Red Hats Cloud Angebot, AWS, US Region

WährungsrechnerJava

http://lnurn3.schlof.net:8080/SOAP_CurrencyConverter/wsdl/CurrencyConverter.wsdlNetcup Serverhousing, Nürnberg, DE

Google MapsGoogle Distance Matrix

VerleihnixPython

http://sintapp.herokuapp.com/leihen/Heroku, AWS, EU Region

REST

SOAP

REST

GoogleAPI-CacheRedisLabs, AWS, US Region

Page 5: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Google Maps

Google Distance Matrix

5© 2013/14 FH Technikum Wien

Page 6: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Google Distance Matrix

Ermittlung von Reise-Distanzen zwischen zwei Positionen Users of the free API:

– 100 elements per query.– 100 elements per 10 seconds.– 2 500 elements per 24 hour period.

Aufruf: http://maps.googleapis.com/maps/api/distancematrix/output?parameters– Parameter: origins, destinations, key (optional)

Return Value:– JSON oder XML JSON

6© 2013/14 FH Technikum Wien

Page 7: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Google Distance Matrix

Aufruf: http://maps.googleapis.com/maps/api/distancematrix/json?origins=Vienna&destinations=Graz&mode=bicycling&language=en-DE&sensor=false

Parameter: Origins Destinations Mode (optional) Language (optional key (optional)

Return Value:– JSON oder XML JSON{ "destination_addresses" : [ "Graz, Austria" ], "origin_addresses" : [ "Vienna, Austria" ], "rows" : [ { "elements" : [ { "distance" : { "text" : "210 km", "value" : 210314 }, "duration" : { "text" : "12 hours 14 mins", "value" : 44054 }, "status" : "OK" } ] } ], "status" : "OK"}

7© 2013/14 FH Technikum Wien

Page 8: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Währungsumrechner

JAVA & SOAP

8© 2013/14 FH Technikum Wien

Page 9: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Currency Converter

Technologoie: Java

IDE: Eclipse JEE Kepler

SOAP / WSDL basiert

WSDL auf:– http://lnurn3.schlof.net:8080/SOAP_CurrencyConverter/wsdl/

CurrencyConverter.wsdl

Nützliches Tool: http://wsdlbrowser.com/

9© 2013/14 FH Technikum Wien

Page 10: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Currency Converter – getCurrencyList()

String[ ] getCurrencyList()

10© 2013/14 FH Technikum Wien

Page 11: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Currency Converter – getConversionRate() Double

getConversionRate(double _val, String _fromCur, String _toCur)

11© 2013/14 FH Technikum Wien

Page 12: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Currency Converter –Überprüfung des Algorithmus

12© 2013/14 FH Technikum Wien

Page 13: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Lessons Learned

Deployment auf public hosting services war eine Herausforderung

Ausgangsdatei vom Aufbau „unkonventionell“

13© 2013/14 FH Technikum Wien

Page 14: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Autoverleih

Python & REST

14© 2013/14 FH Technikum Wien

Page 15: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

REST API - GET

REST_URL=“http://sintrest-sumpfgottheit.rhcloud.com/api”

curl $REST_URL/kunden/2{ "city": "Tamsweg", "country": "\u00d6sterreich", "id": 2, "leihen": [], "name": "Bob Builder", "plz": "5589", "street": "Lederwaschstrasse 2"}

15© 2013/14 FH Technikum Wien

Page 16: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

REST API - PUT

REST_URL=“http://sintrest-sumpfgottheit.rhcloud.com/api”

curl -X PUT -H "Content-Type: application/json" -d '{"street": "Erlenweg 1" }' $REST_URL/kunden/2{ "city": "Tamsweg", "country": "\u00d6sterreich", "id": 2, "leihen": [], "name": "Bob Builder", "plz": "5589", "street": "Erlenweg 1"}

16© 2013/14 FH Technikum Wien

Page 17: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

REST API - POST

REST_URL=“http://sintrest-sumpfgottheit.rhcloud.com/api”

curl -X POST -H "Content-Type: application/json" –d ’{“name": "Lana Horvat",

"street" : "Murve ulica 66", "city" : "Novigrad", "plz" : "52466" , "country" : "Kroatien" }’

$REST_URL/kunden

17© 2013/14 FH Technikum Wien

Page 18: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

REST API - DELETE

REST_URL=“http://sintrest-sumpfgottheit.rhcloud.com/api”

curl -X DELETE $REST_URL/kunden/6

18© 2013/14 FH Technikum Wien

Page 19: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Lessons Learned, Difficulty Easy

REST– curl– Python: requests Library

SOAP– Wenn man eine funktioniernde LIB

gefunden hat

19© 2013/14 FH Technikum Wien

Page 20: Projekt Systemintegration Datler, Kroiß, Sachs Systemintegration ILV, FL / MIC- 2 (SS2014)

Lessons Learned, Difficulty There be Dragons

Deployment– „In der Eclipse geht’s“

Gr⅞bere Encodingprobleme Different Configs for Different Cloudproviders Did I mention Deployment

20© 2013/14 FH Technikum Wien