web services & the grid
DESCRIPTION
Web Services & the Grid. Ian Atkinson [email protected] HPRC Manager, ITR School of Maths, Physics and IT James Cook University, Townsville, Australia. Outline of Presentation. What are Web Services? Programming models Grid vs. Web Services Technologies SOAP WSDL UDDI - PowerPoint PPT PresentationTRANSCRIPT
Web Services & the Grid
Ian Atkinson
HPRC Manager, ITRSchool of Maths, Physics and IT
James Cook University,Townsville, Australia
Outline of Presentation• What are Web Services?• Programming models• Grid vs. Web Services• Technologies
– SOAP– WSDL– UDDI
• Comparison with alternativesEssential Source: The Globus Toolkit 4 Programmer’s Tutorial.
Borja Sotomayor
Programming Evolution
• Low level assembly coding• High level languages (e.g fortran, cobol)
– libraries & subroutines
• Object Oriented Programming– reusability not as great as expected
• Component Based development– Web services is an example
How do achieve distribution?
• Many technologies exist– CORBA, RMI, RPC etc.
• Interoperability drawbacks gave birth to W3C Web Service definition
What are Web Services?
• Open standards (XML, SOAP, etc.) based Web applications that interact with other web applications for the purpose of exchanging data.
• Initially used for the exchange of data on private (enterprise) networks
• Have evolved to include transactions over the public Internet.
Humans & Machines
• Web browsers and HTML deal with application to human communication– General model for human-to-application
interaction
• SOAP and XML-based web services are for program-to-program communication– Resolves program, machine, operating system
and organizational boundaries– General model for application-to-application
interaction & access
Weather Service
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
Yet More Definitions…• Web Services define a platform-independent
standard based on XML to communicate within distributed systems.
• They are loosely coupled and allow short-term cooperation between services.
• The main protocol defining the kind of communication to a web service is SOAP (Simple Object Access Protocol).
More Definitions: CIMA
• A Web service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL).
• Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.
http://www.w3.org/TR/ws-arch/
Perspective
• This basic problem that web services solve is no different to many other distributed computing projects (corba, rmi etc.).
• Many previous efforts have aimed at smaller scales, or have been research projects.
• Web Services tackles real world implementation problems associated with large-scale distributed systems, – hence much more widely adopted than many earlier efforts
Component Distribution
• Component Based Development gives life to distributed computing
• Components made accessible over computer networks via standard interfaces
• Components are dubbed “services”• Allow us to create client/server applications
Distributed Web Services
Desirable Characteristics of a Web Service
• Self describing– XML Schema for grammar of payload– Human readable instances
• Discoverable– UDDI, WS-Inspection, (or other) method of advertising
availability– Capable of many to many integrations that are enabled by a
web service • Coarse grained
– Large documents representing entire business events or business objects
• Asynchronous– When appropriate (often for large scale work)
After Adam Good, 2005
Complete Stack
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
Grid v’s Web Services
• GRID– Grid computing: sharing heterogenous resources to solve massive
computational problems (e.g. different platforms, hardware,software/languages)
– Grid computing problems: clustering network, coordinated resource sharing, flexible access, security, high performance
– Stateful
• WEB– Another solution of middleware– Enabling technology (Internet protocols, xml) – Increase the interoperability– Toward business process management
– Stateless
Web Services and Grid Services
• Web Services advantages:– Best for complex stateless services– Business process management by BPEL
• Standard workflow language
– Extendable architecture (security, massaging, transport protocol)
Grid and Web Services:convergence…
Grid
Web
OGSI
GT2
GT1
HTTPWSDL,
WS-*
WSDL 2,
WSDM
Have beenconverging ?
Source: http://www.globus.org/wsrf
WSRF
W3C Web Services
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
Unraveling some acronyms…• SOAP
• WSDL
• UDDI
SOAP (simple object application
protocol)• or Service Oriented Architecture Protocol• Exchange XML-based messages over a network• Foundation layer of the web services stack• INTEROPERABILITY!! • XML can be interpreted independent of the
platform, OS, programming language• Legacy codes can be distributed through a
common interface• Always automatically generated and interpreted
by web service containers
SOAP Message Exchange
http transport
UDDI Service Registry
Servicediscovery
WSDL describing service
SOAP messages
QuickTime™ and aTIFF (LZW) decompressorare needed to see this picture.
QuickTime™ and aTIFF (LZW) decompressorare needed to see this picture.
Consumingprogram
Requestingservice
Exposingprogram
Service provider
http transport
Anatomy of SOAP
• Envelope - The root element in an XML encoded SOAP message. May contain:– recipient of the message, – content of the message and– the processing instructions
• Encoding Rules - Specify the way the application defined data-type instances will be exchanged
• Remote Procedure Call - representations that define a convention for representing the RPC calls and the responses to them
SOAP Body
SOAP Package
SOAP header
SOAP envelope
Header block
Header data
Header data
Header data
Body child element
Body child element
Sample SOAP Envelope<?xml version='1.0' ?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Header> <m:reservation xmlns:m="http://travelcompany.example.org/reservation"
env:role="http://www.w3.org/2003/05/soap-envelope/role/next" env:mustUnderstand="true"> <m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference> <m:dateAndTime>2001-11-29T13:20:00.000-05:00</m:dateAndTime> </m:reservation>
<n:passenger xmlns:n="http://mycompany.example.com/employees" env:role="http://www.w3.org/2003/05/soap-envelope/role/next"
env:mustUnderstand="true">
<n:name>Åke Jógvan Øyvind</n:name>
</n:passenger>
</env:Header>
SOAP Transport Methods
• Uses Internet application layer as a transport protocol
• HTTP is the most widely adopted.
• Others - SMTP, HTTPS etc.
SOAP Weaknesses
• XML can be slow to parse/interpret• Using “application protocols” as transport
protocols• Most uses of HTTP as a transport protocol
are done in ignorance of how the operation would be modeled in HTTP.– e.g HTTP - GET and POST are inefficiently used
• GET used when a post should be uses - vise versa
Web Service Deployment
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
WSDL
• Web Service Definition Language• XML based language for describing
Web Services• Answers the question:
How do I communicate with a web service?• Used to generate code stubs. YAY! (Mat)
WSDL
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
Web Service Invocation
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
WSDL Components• Types– a container for data type definitions using some type
system (such as XSD). • Message– an abstract, typed definition of the data being
communicated. • Operation– an abstract description of an action supported by
the service. • Port Type–an abstract set of operations supported by one or
more endpoints. • Binding– a concrete protocol and data format specification for a
particular port type• Port– a single endpoint defined as a combination of a binding
and a network address. • Service– a collection of related endpoints.
WSDL SpecificationTypes
message message message
operation
porttype
operation operation
binding
serviceport
An example - WSDL Types<?xml version="1.0"?>
<definitions name="StockQuote" targetNamespace="http://example.com/stockquote.wsdl" xmlns:tns="http://example.com/stockquote.wsdl" xmlns:xsd1="http://example.com/stockquote.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<types> <schema targetNamespace="http://example.com/stockquote.xsd"
xmlns="http://www.w3.org/2000/10/XMLSchema"> <element name="TradePriceRequest">
<complexType> <all> <element name="tickerSymbol" type="string"/> </all> </complexType>
</element> <element name="TradePrice">
<complexType> <all> <element name="price" type="float"/> </all> </complexType> </element> </schema> </types>
WSDL Operations
<message name="GetLastTradePriceInput"> <part name="body" element="xsd1:TradePriceRequest"/> </message>
<message name="GetLastTradePriceOutput"> <part name="body" element="xsd1:TradePrice"/></message>
<portType name="StockQuotePortType"><operation name="GetLastTradePrice">
<input message="tns:GetLastTradePriceInput"/> <output message="tns:GetLastTradePriceOutput"/> </operation>
</portType>
WSDL Bindings, Services, Ports
<binding name="StockQuoteSoapBinding" type="tns:StockQuotePortType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="GetLastTradePrice"> <soap:operation soapAction="http://example.com/GetLastTradePrice"/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation>
</binding> <service name="StockQuoteService"> <documentation>My first
service</documentation> <port name="StockQuotePort" binding="tns:StockQuoteBinding">
<soap:address location="http://example.com/stockquote"/> </port> </service> </definitions>
UDDI• Universal Description Discovery and
Integration• Platform-independent, XML-based registry • A protocol for publishing and discovering
metadata about Web Services over the internet
• Enables applications to find web services, at design, or runtime
Additional Specifications
• WS-Security – Defines how to use XML Encryption and XML Signature in
SOAP to secure message exchanges, as an alternative or extension to using HTTPS to secure the channel.
• WS-Reliability – Astandard protocol for reliable messaging between two Web
services.
• WS-ReliableMessaging – A protocol for reliable messaging between two Web services,
issued by Microsoft, BEA and IBM
• WS-Addressing – A way of describing the address of the recipient (and sender)
of a message, inside the SOAP message itself.
WS-Security
• Web Services Security• Communications protocol providing a means
for applying security to web services• How integrity and confidentiality can be
enforced• Kerberos, SAML, X.509• Attaching signature and encryption headers
to SOAP messages• HTTPS - Transport Layer Security
WS-Reliability
• SOAP over HTTP does not guarantee any level of reliability and security.
• Describes reliable delivery of messages between distributed applications– often connected by software /system /
networks that are not fail-safe.
WS-ReliableMessaging
Alternative Approaches to Web Services
• Noting that these are homogeneous systems:– CORBA– RMI
CORBA Comparison• Scalability
– Stateful programming model – Shared activation
• Performance– CORBA is only intermediary until object obtained (allowing direct client-server interaction)
– Binary transport
• Activation– Sophisticated four policy activation methods
• State Management– Provides state management with a connection-oriented protocol
• Garbage Collection– Implemented on per ORB vendor basis– No concept of distributed memory management
• Security– Just uses SSL
RMI Comparison• Scalabilitiy
– Good overall
– Registry could be bottleneck / • Performance
– Fairly high
– Use from Java applets in browser cause conversion to http –expensive • Activation
– Stub can be download over the network – Lazy activation and selection of specific server instances– Allows automatic instantiation of objects based on methods faulting and the fault resolution process
instantiating the remote object • State Management
– Provides both connection-oriented and connectionless protocols • Garbage Collection
– Distributed reference counting (like CORBA, DCOM)– Reference to remote objects is considered lease on object, which must be periodically renewed
• Security– Strong security– Must have security credentials to perform dynamic class loading
SOAP Comparison• Scalability
– Very scaleable especially over http if request/response model is maintained• Performance
– Degraded by XML overhead– But if you’re interoping between architectures anyway that overhead isn’t unreasonable
• Activation– Beyond SOAP’s scope
• State Management– Stateless if over http
• Garbage Collection– Beyond scope
• Security– https/SSL - not ideal for routability of course– WS-Security
• Other Disadvantages– No true standard serialization method– Multiple copies of objects transported
• Other Advantages– Encouragement of loose coupling (both physical and interface)– Protection of apps from changes in standards– Truly vendor-agnostic
Thank you…
Sample SOAP Message (cont’d)<env:Body>
<p:itinerary xmlns:p="http://travelcompany.example.org/reservation/travel"> <p:departure>
<p:departing>New York</p:departing> <p:arriving>Los Angeles</p:arriving> <p:departureDate>2001-12-14</p:departureDate>
<p:departureTime>late afternoon</p:departureTime> <p:seatPreference>aisle</p:seatPreference> </p:departure>
<p:return> <p:departing>Los Angeles</p:departing> <p:arriving>New York</p:arriving> <p:departureDate>2001-12-20</p:departureDate><p:departureTime>mid-morning</p:departureTime><p:seatPreference/>
</p:return> </p:itinerary> <q:lodging xmlns:q="http://travelcompany.example.org/reservation/hotels"> <q:preference>none</q:preference> </q:lodging>
</env:Body>
</env:Envelope>
A Soap Response<?xml version='1.0' ?> <env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"> • <env:Header>
<m:reservation xmlns:m="http://travelcompany.example.org/reservation" env:role="http://www.w3.org/2003/05/soap-envelope/role/next" env:mustUnderstand="true">
<m:reference>uuid:093a2da1-q345-739r-ba5d-pqff98fe8j7d</m:reference> <m:dateAndTime>2001-11-29T13:35:00.000-05:00</m:dateAndTime> </m:reservation>
<n:passenger xmlns:n="http://mycompany.example.com/employees" env:role="http://www.w3.org/2003/05/soap-envelope/role/next" env:mustUnderstand="true"> <n:name>Åke Jógvan Øyvind</n:name>
</n:passenger> </env:Header>
• <env:Body> – <p:itineraryClarification xmlns:p="http://travelcompany.example.org/reservation/travel">
<p:departure> <p:departing> <p:airportChoices> JFK LGA EWR </p:airportChoices> </p:departing>
</p:departure> <p:return> <p:arriving> <p:airportChoices> JFK LGA EWR </p:airportChoices> </p:arriving></p:return>
</p:itineraryClarification></env:Body>
</env:Envelope>
Why are Web Services Useful for On Line
Instruments
WS Architecture
• The basic architecture includes Web services technologies capable of:– Exchanging messages– Describing Web services– Publishing and discovering Web service descriptions
WS Architecture 2Software agents in the basic architecture can take on one or all of the
following roles:
Service requester -- requests the execution of a Web serviceService provider -- processes a Web service request
Discovery agency -- agency through which a Web service description is published and made discoverableade disc
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
SOA
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
• A web service is described using a standard, formal XML notion, called its service description, that provides all of the details necessary to interact with the service, including message formats (that detail the operations), transport protocols, and location.
• The nature of the interface hides the implementation details of the service so that it can be used independently of the hardware or software platform on which it is implemented and independently of the programming language in which it is written.
QuickTime™ and aTIFF (Uncompressed) decompressor
are needed to see this picture.
Restrictions on SOA
• The Web services architecture does not include the concept of automatically correlating requests and responses, as some RPC oriented technologies do.
• The correletion of request and response messages is typically application defined.
Asynchronous Web Services
Why Asynchronous Web Services?
• Speed– Due to overhead of XML and http XML web services can be
SLOW• Unpredictability
– Your app may be invoking a web service that itself is slow, unreliably available or involves a human in the process
• Size– Moving to larger coarsegrained documents and less
frequent chatty method calls can introduce more overhead
Blocking on downstream services creates instant bottlenecks in your application
Creating Asynchronous Web Services
• Write “begin” and “end” methods versus single invocation methods
Invoking Asynchronous Web Services
• Polling
• Blocking
• Callbacks
Web Services Stacks• To ensure interoperability when performing the publish, find and bind
operations expressed in the Service Oriented Architecture (SOA) diagram;
• conceptual and technical standards must be defined for each role and type of interaction.
• This section will explore each of roles and interactions in order identify each relevant stack of technologies.There are over arching concerns involving security, management and quality of services that must be addressed at each layer in the conceptual and technical stacks. The various solutions at each layer may or may not be independent of one other. More of these overarching concerns will emerge as the web services paradigm is adopted and evolved. What is most important is building a framework through which all such concerns may be applied to each of the layers in the stack so that as new concerns emerge they may be dealt with flexibly and consistently.
Wire "Stack"1. Transport2. Packaging3. Extensions
XML Messaging with SOAP Interactions
Description "Stack" Descriptions Applying to a Particular Web Service
Interface Implementation Policy Presentation
Description for Relationships between Web Services
Composition Orchestration Service Level Agreements Business Level Agreements
Discovery Agencies "Stack" Service Publication Producing Service Descriptions Publishing Service Descriptions
Service Discovery Acquiring Service Descriptions Consuming Service Descriptions Inspection
Stacks