web services a good choice for sharing [ocean science] data
TRANSCRIPT
Web ServicesWeb Services
A good choice for sharing A good choice for sharing [ocean science] data.[ocean science] data.
Distributed ComputingDistributed Computing
Connecting systemsConnecting systems
TransparencyTransparency
ScalabilityScalability
Fault ToleranceFault Tolerance
Data Sharing ObstaclesData Sharing Obstacles
PlatformsPlatforms
LanguagesLanguages
TransportsTransports
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
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
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)
SOAP: RequirementsSOAP: Requirements
ApplicationApplication
Application ServerApplication Server
SOAP ImplementationSOAP Implementation
XML parser (sometimes)XML parser (sometimes)
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
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)
SOAP ExampleSOAP Example
Online Address BookOnline Address Book
Functions:Functions: getAddressForName( name )getAddressForName( name ) addEntry( <some data> )addEntry( <some data> ) getAllListings()getAllListings()
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>
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>
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
SOAP: DrawbacksSOAP: Drawbacks
PerformancePerformance XML lacks efficiency of parsingXML lacks efficiency of parsing
XML Infoset (W3C recommendation)XML Infoset (W3C recommendation) HTTP limitationsHTTP limitations
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