web services a good choice for sharing [ocean science] data

15
Web Services Web Services A good choice for sharing A good choice for sharing [ocean science] data. [ocean science] data.

Upload: vincent-hunt

Post on 12-Jan-2016

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Web Services A good choice for sharing [ocean science] data

Web ServicesWeb Services

A good choice for sharing A good choice for sharing [ocean science] data.[ocean science] data.

Page 2: Web Services A good choice for sharing [ocean science] data

Distributed ComputingDistributed Computing

Connecting systemsConnecting systems

TransparencyTransparency

ScalabilityScalability

Fault ToleranceFault Tolerance

Page 3: Web Services A good choice for sharing [ocean science] data

Data Sharing ObstaclesData Sharing Obstacles

PlatformsPlatforms

LanguagesLanguages

TransportsTransports

Page 4: Web Services A good choice for sharing [ocean science] data

Data Sharing MethodsData Sharing Methods

CORBA, RMI, DCOMCORBA, RMI, DCOM

ProblemsProblems Goals lacked heterogeneous environment Goals lacked heterogeneous environment Difficult-to-implementDifficult-to-implement Proprietary protocolsProprietary protocols Not modular – crammed specificationsNot modular – crammed specifications

Page 5: Web Services A good choice for sharing [ocean science] data

The Web ServiceThe Web Service

Defined: Process between systemsDefined: Process between systemsLeverage Internet standardsLeverage Internet standards Passes XML messages over HTTPPasses XML messages over HTTP

PromotesPromotes Interoperability Interoperability

Perl to C++ to AppleScript…Perl to C++ to AppleScript… Loose couplingLoose coupling

Implementation-independent & VersioningImplementation-independent & Versioning

Page 6: Web Services A good choice for sharing [ocean science] data

SOAPSOAP

The Emerging Web Service The Emerging Web Service Interface to existing programsInterface to existing programs Modular DesignModular Design

Extensible – add-on distinct specs Extensible – add-on distinct specs SecuritySecurity ReliabilityReliability

Customizable – combine features as neededCustomizable – combine features as needed No forced modelNo forced model 80+ implementations (platforms,languages)80+ implementations (platforms,languages)

Page 7: Web Services A good choice for sharing [ocean science] data

SOAP: RequirementsSOAP: Requirements

ApplicationApplication

Application ServerApplication Server

SOAP ImplementationSOAP Implementation

XML parser (sometimes)XML parser (sometimes)

Page 8: Web Services A good choice for sharing [ocean science] data

SOAP: How It WorksSOAP: How It Works

Calls functions of existing programsCalls functions of existing programs Application server knows:Application server knows:

Available functionsAvailable functionsHow to decode requestsHow to decode requestsHow to encode responsesHow to encode responses

XML Request – invokes a function callXML Request – invokes a function callWith function parameters (if necessary)With function parameters (if necessary)

XML ResponseXML ResponsePackages returned data of the functionPackages returned data of the function

Page 9: Web Services A good choice for sharing [ocean science] data

SOAP: Getting StartedSOAP: Getting Started

Receiving SOAP requestsReceiving SOAP requests Define a SOAP “Service”Define a SOAP “Service”

Tell Server “Providing” programTell Server “Providing” program

How to translate data (mapping)How to translate data (mapping)

Sending SOAP requestsSending SOAP requests Write SOAP callWrite SOAP call

Knowing what you are receivingKnowing what you are receiving

What parameters to pass along (if necessary)What parameters to pass along (if necessary)

Page 10: Web Services A good choice for sharing [ocean science] data

SOAP ExampleSOAP Example

Online Address BookOnline Address Book

Functions:Functions: getAddressForName( name )getAddressForName( name ) addEntry( <some data> )addEntry( <some data> ) getAllListings()getAllListings()

Page 11: Web Services A good choice for sharing [ocean science] data

SOAP Response: Notify ServerSOAP Response: Notify Server

<isd:<isd:serviceservice … …

id="urn:AddressFetcher">id="urn:AddressFetcher">

<isd:<isd:providerprovider type="java" ...type="java" ...

methods="getAddressFromName addEntry getAllListings" …methods="getAddressFromName addEntry getAllListings" …

class="samples.addressbook.AddressBook" …class="samples.addressbook.AddressBook" …

……

<isd:mappings><isd:mappings>

… …

</isd:service></isd:service>

Page 12: Web Services A good choice for sharing [ocean science] data

SOAP Request: Making the CallSOAP Request: Making the CallURL url = new URL("http://ragnarok.whoi.edu:7001/soap/servlet/rpcrouter");URL url = new URL("http://ragnarok.whoi.edu:7001/soap/servlet/rpcrouter");……

Call call = new Call(); …Call call = new Call(); …

call.setTargetObjectURI("call.setTargetObjectURI("urn:AddressFetcherurn:AddressFetcher");");

call.setMethodName("call.setMethodName("getAddressFromNamegetAddressFromName");");……

Vector params = new Vector();Vector params = new Vector();

params.addElement( … "John B. Good“ …);params.addElement( … "John B. Good“ …);

call.setParams(params);call.setParams(params);

Response response = call.invoke(url);Response response = call.invoke(url);

Parameter ret = response .getReturnValue();Parameter ret = response .getReturnValue();……

<do something><do something>

Page 13: Web Services A good choice for sharing [ocean science] data

SOAP: In ActionSOAP: In Action

getAddressFromName(“John B. Good”)getAddressFromName(“John B. Good”)Try itTry it

addEntry(“John Doe ...”)addEntry(“John Doe ...”)Try itTry it

getAddressFromName(“John Doe”)getAddressFromName(“John Doe”)Try itTry it

getAllListings()getAllListings()Try itTry it

Page 14: Web Services A good choice for sharing [ocean science] data

SOAP: DrawbacksSOAP: Drawbacks

PerformancePerformance XML lacks efficiency of parsingXML lacks efficiency of parsing

XML Infoset (W3C recommendation)XML Infoset (W3C recommendation) HTTP limitationsHTTP limitations

Page 15: Web Services A good choice for sharing [ocean science] data

Popular Web ServicesPopular Web Services

ProductProduct Support OSSupport OS LanguageLanguage

Apache SOAP Apache SOAP UNIX, Windows UNIX, Windows JavaJava

GLUE GLUE UNIX, WindowsUNIX, Windows JavaJava

WASPWASP UNIX, WindowsUNIX, Windows C++C++

SOAP::LiteSOAP::Lite UNIX, WindowsUNIX, Windows PerlPerl

SOAPx4 SOAPx4 UNIXUNIX PHPPHP