Presentation is loading. Please wait.

Presentation is loading. Please wait.

8 Sep 2008NVOSS 2008 - Web Services1 T HE US N ATIONAL V IRTUAL O BSERVATORY Introduction to Web Services Matthew J. Graham Caltech.

Similar presentations

Presentation on theme: "8 Sep 2008NVOSS 2008 - Web Services1 T HE US N ATIONAL V IRTUAL O BSERVATORY Introduction to Web Services Matthew J. Graham Caltech."— Presentation transcript:


2 8 Sep 2008NVOSS Web Services1 T HE US N ATIONAL V IRTUAL O BSERVATORY Introduction to Web Services Matthew J. Graham Caltech

3 8 Sep 2008NVOSS Web Services2 Web service deoccultation Invocations Strange languages Action at a distance High priesthood

4 Bluffers guide Web service (think a (code) library on the web) –A piece of software available over a network with a formal description of how it is called and what it returns that a computer can understand REST (think HTTP GET and POST) –An approach to web services that uses the existing infrastructure of the web SOAP (think envelopes) –An approach to web services that uses an XML-based messaging framework WSDL (think a contract) –An XML description of a web service (normally SOAP) and how to interact with it 8 Sep 2008NVOSS Web Services3

5 What we wont cover (look in the book) Data formats: –I want to use something other than XML Security: –I want to protect my data/resources Attachments –I want to upload/download a file State –I want the service to remember things Asynchrony –Its going to take some time Messaging –I want more than just request/response 8 Sep 2008NVOSS Web Services4

6 Web services in the VO SkyNodes, Open SkyQuery and WESIX Footprint Services and STOMP Spectrum Services Registry Interface VOSpace CasJobs CDS VOServices (IRAF) … 8 Sep 2008NVOSS Web Services5

7 Numquam ponenda est pluralitas sine necessitate WWW is the largest, most distributed and scalable application on the planet REST (Representation State Transfer) is an architectural style not an implementation: –Distinguishes resources and operations –Each resource is identified by a URI –The only operations are the HTTP methods –Data reflecting the state of a resource is exchanged (in XML) 8 Sep 2008NVOSS Web Services6

8 REST by analogy HTTP MethodThinkDescription/proc analogy PUTCREATECreate a resource with the user specified id Start a new process GETRETRIEVERetrieve a resource representation Get the status of a process POSTUPDATEUpdate a resource/Append to a resource/Create a resource with a server assigned id Amend a process DELETE Delete a resourceKill a process 8 Sep 2008NVOSS Web Services7

9 By accident, not by design Parameters in HTTP GET URLs: – – HTTP GET is safe – it does nothing else than retrieval HTTP GET, PUT and DELETE are idempotent – the effects on the system of one or N identical requests are the same Consider HTTP GET with: Services which maintain idempotency whilst allowing parameterized URLs are accidentally RESTful 85% of web service traffic, 6x faster allegedly 8 Sep 2008NVOSS Web Services8

10 When to use REST RESTful services are good for WWW-type functionality Limitations: –No formal description: WADL not widely used yet Not an issue for pure REST (no parameters in URL) –No messaging infrastructure: Reliable messaging Message routing –No message level security: Digital signatures –No resource lifecycle management –No transaction support –No asynchronous event notification 8 Sep 2008NVOSS Web Services9

11 8 Sep 2008NVOSS Web Services10 What is SOAP? Simple Object/Service-Oriented Access Protocol – -s-stands-for-simple/ -s-stands-for-simple/ W3C specification – An XML-based messaging framework for exchanging information between peers in a decentralized, distributed environment Defines the message structure but not the message content (needs other technologies) Fundamentally stateless (no memory of what has happened previously) One-way message exchange paradigm

12 8 Sep 2008NVOSS Web Services11 Anatomy of a SOAP message SOAP envelope –SOAP header (optional) Routing Transactional Security Contextual User profile –SOAP body Message payload (actual data) –XML namespace and schema

13 8 Sep 2008NVOSS Web Services12 SOAP example Request: float Response: float

14 What is WSDL? Web Services Description Language W3C specification – An XML grammar for describing the public interface of a web service in terms of: –its exposed operations –the message formats –protocol bindings (e.g. SOAP, HTTP) Most commonly used with SOAP –defines format of message content in the SOAP body 8 Sep 2008NVOSS Web Services13

15 Anatomy of a WSDL 8 Sep 2008NVOSS Web Services14 A WSDL document describes: a set of services which exchange messages the data in the messages is defined in a set of types each message transfer in a service defines an operation operations have bindings to specific implementations using protocols like HTTP

16 8 Sep 2008NVOSS Web Services15 WSDL example … … … Return the comoving line of sight distance...

17 Using SOAP and WSDL Start with WSDL (contract-first) vs. start with code (contract-last) Frameworks provide APIs: – to handle SOAP: (De)serialization: converting code object to/from XML representation – and code bindings derived from WSDL: Stub: client-side proxy to service Skeleton: server-side to handle request and response Alternate approach: –SOAP (and WSDL) are just XML –Use XSLT, curl, JavaScript, etc. 8 Sep 2008NVOSS Web Services16

18 8 Sep 2008NVOSS Web Services17 Just to scare you (WS-*) WS-I Basic Profile WS-I Basic Security Profile WS-Manageability WS-Management WS-MetadataExchange WS-Notification WS-Policy WS-PolicyAssertions WS-PolicyAttachment WS-PolicyFramework WS-Polling WS-Provisioning WS-Reliability WS-ReliableMessaging WS-RemotePortals WS-ResourceFramework WS-ResourceLifetime WS-ResourceProperties WS-Routing WS-SecureConversation WS-Security WS-SecurityPolicy WS-Addressing WS-AtomicTransaction WS-Attachments WS-BaseNotification WS-BPEL WS-BrokeredNotification WS-BusinessActivity WS-CAF WS-Choreography WS-CDL WS-Context WS-Coordination WS-CoordinationFramework WS-Discovery WS-DistributedManagement WS-Enumeration WS-Eventing WS-ExperienceLanguage WS-Federation WS-GAF WS-Inspection WSIL WS-Semantics WS-Topic WS-Transaction WS-Transaction Management WS-Transfer WS-Trust ASAP ebXML MTOM SAML SOAP SwA UBL UDDI WSDL XACML XML Encryption XML Signature XKMS

19 Grids and clouds Services on supercomputers: –Montage on TeraGrid –NESSSI Computing on demand: –Virtualization –Providers: Amazon EC2 Google Apps Globus –http://www.globus.org 8 Sep 2008NVOSS Web Services18

20 Beyond REST Data event streams are the future of astronomy: –High volume –Frequent –Low latency Hugh percentage of traffic with RESTful services is polling status –Polling does not scale –Not real time SOAP is overly complicated The proposed solution: XMPP (PubSub) 8 Sep 2008NVOSS Web Services19

21 A brief introduction to XMPP/Jabber Extensible Messaging and Presence Protocol: –Persistent connections –Stateful –Designed to be an event stream protocol –Natively federated and asynchronous –Identity, security and presence built in Jabber servers designed to handle at least 10 5 concurrent connections Sample message: 8 Sep 2008NVOSS Web Services20

Download ppt "8 Sep 2008NVOSS 2008 - Web Services1 T HE US N ATIONAL V IRTUAL O BSERVATORY Introduction to Web Services Matthew J. Graham Caltech."

Similar presentations

Ads by Google