Download presentation
Presentation is loading. Please wait.
Published byAlejandro Long Modified over 11 years ago
2
8 Sep 2008NVOSS 2008 - Web Services1 T HE US N ATIONAL V IRTUAL O BSERVATORY Introduction to Web Services Matthew J. Graham Caltech
3
8 Sep 2008NVOSS 2008 - 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 2008 - 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 2008 - 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 2008 - 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 2008 - 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 2008 - Web Services7
9
By accident, not by design Parameters in HTTP GET URLs: –http://processes.com/123/statushttp://processes.com/123/status –http://processes.com/services?action=getStatus&pid=123http://processes.com/services?action=getStatus&pid=123 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: http://processes.com/services/action=cancelJob&pid=123 Services which maintain idempotency whilst allowing parameterized URLs are accidentally RESTful 85% of web service traffic, 6x faster allegedly 8 Sep 2008NVOSS 2008 - 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 2008 - Web Services9
11
8 Sep 2008NVOSS 2008 - Web Services10 What is SOAP? Simple Object/Service-Oriented Access Protocol –http://wanderingbarque.com/nonintersecting/2006/11/15/the -s-stands-for-simple/http://wanderingbarque.com/nonintersecting/2006/11/15/the -s-stands-for-simple/ W3C specification –http://www.w3.org/TR/soaphttp://www.w3.org/TR/soap 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 2008 - 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 2008 - Web Services12 SOAP example Request: float Response: float
14
What is WSDL? Web Services Description Language W3C specification –http://www.w3.org/TR/wsdlhttp://www.w3.org/TR/wsdl 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 2008 - Web Services13
15
Anatomy of a WSDL 8 Sep 2008NVOSS 2008 - 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 2008 - 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 2008 - Web Services16
18
8 Sep 2008NVOSS 2008 - 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.orghttp://www.globus.org 8 Sep 2008NVOSS 2008 - 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 2008 - 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 2008 - Web Services20
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.