14 Sep 2004 NVO Summer School1 Introduction to Web Services Technology Matthew J. Graham CACR/Caltech T HE US N ATIONAL V IRTUAL O BSERVATORY
14 Sep 2004 NVO Summer School2 Overview SOA SOAP, WSDL and UDDI Infrastructures: AXIS,.Net (Mono), Python, Perl, PHP Invocation Interoperability Emerging topics: attachments, state, security, asynchronous
14 Sep 2004 NVO Summer School3 Service Oriented Astronomy An application architecture within which all functions are defined as independent services with well-defined invocable interfaces which can be called in defined sequences to form scientific processes. Web Services are an implementation
14 Sep 2004 NVO Summer School4 Technological challenges WS technologies need to address four basic challenges: –Service Description –Service Implementation –Service Publishing, Discovery and Binding –Service Invocation and Execution
14 Sep 2004 NVO Summer School5 Whats wrong with HTTP GET? Things should be made as simple as possible, but no simpler - Albert Einstein Highly scalable, predominantly read-only data REST (Representational State Transfer) Amazon.com: –has both REST and SOAP APIs –85% of requests are REST –REST response is 6 times faster than SOAP
14 Sep 2004 NVO Summer School6 Why is SOAP better? Send and receive complex datatypes to invoke a particular method not just key- value pairs Security - not URI parameters Guaranteed or exact execution Binds to other protocols
14 Sep 2004 NVO Summer School7 What is SOAP? Simple Object Access Protocol An XML-based communication protocol and encoding format for exchanging structured information in a decentralized, distributed environment W3C specification (
14 Sep 2004 NVO Summer School8 Anatomy of a SOAP message An envelope to encapsulate data which defines formatting conventions for describing the message contents and routing directions A request/response message exchange pattern (RPC mechanism) A transport or binding protocol Data encoding rules for describing the mapping of application-defined datatypes into an XML tag-based representation
14 Sep 2004 NVO Summer School9 SOAP example Request: float float float float Response: float
14 Sep 2004 NVO Summer School10 What is WSDL? Web Services Description Language An XML grammar for describing a web service as a collection of endpoints capable of exchanging messages in a particular fashion W3C specification (
14 Sep 2004 NVO Summer School11 Anatomy of a WSDL file * * * * * * * - include other WSDLS - define datatypes used in elements - model data exchanged - a subset of operations supported for an endpoint - define input and output messages - concrete protocol and data format specification for a element - identifies actual endpoint for WS
14 Sep 2004 NVO Summer School12 WSDL example (I)
14 Sep 2004 NVO Summer School13 WSDL example (II) Return the comoving line of sight distance......
14 Sep 2004 NVO Summer School14 WSDL binding flavours (I) RPC Document Literal Encoding
14 Sep 2004 NVO Summer School15 WSDL binding flavours (II) RPC Document Literal Encoding
14 Sep 2004 NVO Summer School16 </portType WSDL binding flavours (III) 5 > Document/literal wrapped
14 Sep 2004 NVO Summer School17 UDDI Universal Description, Discovery and Integration A platform-independent, open framework for publishing and discovering information about web services OASIS specification (
14 Sep 2004 NVO Summer School18 What do I need? SOAP library WSDL parser Client and server stub code generator Service container (UDDI library)
14 Sep 2004 NVO Summer School19 Whats available? Java ( –Axis ( –Globus ( C#: –.Net; Mono ( –OGSI.NET / WSRF.NET ( Perl: –SOAP::Lite ( –OGSI::Lite / WSRF::Lite ( Python: –SOAPpy / ZSI ( –Twisted ( –PyGlobus/PyGridWare PHP –NuSOAP ( XForms (
14 Sep 2004 NVO Summer School20 Client Invocation Models Static: use generated stubs Dynamic: –no generated code –a proxy dynamically generates a class at runtime that conforms to a particular interface, proxying all invocations to a single generic method –standard Java : use javax.xml.rpc.Service.getPort() and createCall() –.Net : use RealProxy class (must extend ContextBound) or Reflection.Emit
14 Sep 2004 NVO Summer School21 Interoperability Suitable for and capable of being implemented in a neutral manner on multiple operating systems and in multiple programming languages Not all web services are interoperable! Web Services Interoperability Organisation ( WS-I Testing Tools
14 Sep 2004 NVO Summer School22 Emerging technologies Attachments: –DIME vs. MTOM ( mtom) mtom Security: –WS-Security ( 106.ibm.com/developerworks/webservices/library/ws -secure) 106.ibm.com/developerworks/webservices/library/ws -secure –WSS4J? State: –WSRF ( Asynchronous: – WS-CAF ( – WSRF
14 Sep 2004 NVO Summer School23 Conclusions Make sure a web service is the best solution to an application requirement Focus on the WSDL Use your favourite language and platform Interoperability is a great idea Be aware of emerging and converging technologies