Presentation is loading. Please wait.

Presentation is loading. Please wait.

Distributed Systems 2006 Web Services (With material from [Møller & Schwartzbach, 2003])

Similar presentations


Presentation on theme: "Distributed Systems 2006 Web Services (With material from [Møller & Schwartzbach, 2003])"— Presentation transcript:

1 Distributed Systems 2006 Web Services (With material from [Møller & Schwartzbach, 2003])

2 Distributed Systems 20062 Plan Basics –SOAP –WSDL –UDDI Related specifications

3 Distributed Systems 20063 A Web Service 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 –These are typically conveyed using HTTP with an XML serialization in conjunction with other Web- related standards [W3C]

4 Distributed Systems 20064 Motivation Heterogeneous, distributed systems –Scalability –Interoperability –Modifiability The main motivation is interoperability –The ability for separately developed applications to work in together

5 Distributed Systems 20065 SOAP, SOAP, UDDI SOAP –A framework for exchanging XML-based information in a network –SOAP used to be an acronym: Simple Object Access Protocol –"This is no longer the case." (it is neither simple nor has anything to do with objects) –The currently most hyped XML/Web service technology WSDL (Web Service Description Language) –An XML-based language for describing network services –WSDL descriptions of capabilities and locations of services –Like an Interface Description Language for Web services –Often communication using SOAP + HTTP UDDI (Universal Description, Discovery, and Integration) –Provides a registry mechanism for clients and servers to find each other –Uses SOAP for communication

6 Distributed Systems 20066 web services (web services)

7 Distributed Systems 20067 An Example

8 Distributed Systems 20068 A Result

9 Distributed Systems 20069 SOAP Request Message transport Message intent Message contents Application data

10 Distributed Systems 200610 SOAP Response

11 Distributed Systems 200611 org.apache.axis.utils.tcpmon Part of Apache Axis toolset

12 Distributed Systems 200612 Anatomy of SOAP Lightweight, stateless protocol framework for exchanging XML messages –Applications can create complex interaction patterns Request/response Request/multiple responses... –by combining one-way exchanges with features provided by an underlying protocol and/or application-specific information Silent on the semantics of any application-specific data it conveys Message contents –xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/” soapenv:Envelope –soapenv:Header »Application-specific control information »May be processed by intermediaries –soapenv:Body »Information exchanged between sender and receiver Typical protocols –HTTP –SMTP

13 Distributed Systems 200613 (Really, the Google search API is a bad example of a web service design –E.g., http://www.prescod.net/rest/googleapi/ http://www.prescod.net/rest/googleapi/ But has its merits, e.g., in interaction with other web services)

14 Distributed Systems 200614 WSDL WSDL is an XML-based language that allows formal descriptions of the interfaces of Web services –which interactions does the service provide? –which arguments and results are involved in the interactions? –which network addresses are used to locate the service? –which communication protocol should be used? –which data formats are the messages represented in? So what are the benefits? –an interface description is a contract between the server developers and the client developers –having formal descriptions allows tool support, e.g. code template generators

15 Distributed Systems 200615 A WSDL Example (1)

16 Distributed Systems 200616 A WSDL Example (2) Data types defined using XML Schema Message types defined from data types Port type defining operations Binding to SOAP RPC over HTTP Port where the running service may be accessed

17 Distributed Systems 200617 WSDL Layers The language can be described as having two layers –the service definition layer describes abstract properties: data types message types operations services –The binding layer describes concrete properties: Protocols Data formats (using SOAP, HTTP, MIME)

18 Distributed Systems 200618 WSDL Elements An actual WSDL document consists of a set of definitions of the following kinds: –types - containing XML Schema element and type definitions –message - consisting of either a number of named parts typed by XML Schema elements, or a single part typed by a XML Schema type –portType - describing a set of operations, each being either one-way: receiving an input message, request-response: receiving an input message and then responding with an output message (like Remote Procedure Calls), solicit-response: sending an output message and then receiving an input message, or notification: sending an output message –binding - selects communication protocol and data formats for each operation and message –service - describes a collection of named ports, each associated with a binding and a network address An import mechanism allows modularization of definitions.

19 Distributed Systems 200619 SOAP in WSDL The SOAP binding in WSDL: –selects document or rpc style (rpc wraps message parts) –selects HTTP/SMTP/... protocol –selects encoding type Encoded – specifies data formats Literal –places message parts in header or body parts of the envelope

20 Distributed Systems 200620 Examples of style versus encoding public void myMethod(int x, float y); –RPC/Encoded 5 5.0 –RPC/Literal 5 5.0 –(Document/Encoded) –Document/Literal 5 5.0 WS-I Compliance –Tries to clean up to web service mess so that web services may actually interoperate –Recommends RPC/Literal or Document/Literal (Why not use Document/Literal all the time?)

21 Distributed Systems 200621 Problems with WSDL The HTTP and MIME bindings are too loosely specified (so not all WSDL documents "make sense") WSDL is closely tied with SOAP –SOAP is big and complicated without offering very much Complex interaction patterns cannot be described (e.g. transactions)

22 Distributed Systems 200622 Using Web Services with Java JAX-RPC (JSR-101) –Java API for XML-Based RPC Including WSDL Java mapping –Apache AXIS (Apache Extensible Interaction System) http://ws.apache.org/axis/ a Java-based implementation of SOAP + WSDL –largely allows the programmer to forget these technologies WSDL Java Used together with a servlet container such as Tomcat or Jetty –Java Web Services Developer Pack JAX-WS 2.0 (JSR-224) –Java API for XML Web Services – was JAX-RPC 2.0 –Heavy use of Java 5.0 annotations to customize mapping from WSDL and at runtime –@WebService @BindingType(value="http://www.w3.org/2003/05/soap/bindings /HTTP/") public class AddNumbersImpl { –Similar to.NET, will (probably) be built into Java 6.0

23 Distributed Systems 200623 UDDI - Universal Description, Discovery, and Integration A Web service registry mechanism –"a meta service for locating Web services by enabling robust queries against rich metadata" UDDI business registration: XML files used to describe business entities and their Web services –white pages - business address, contact info, etc. –yellow pages - industrial categorizations based on standard taxonomies (allows search within particular industry, product category, geographical region,...) –green pages - more technical information, for instance WSDL descriptions UDDI also provides a SOAP+WSDL-based registry API for registering ("publish") and discovering ("inquire") Web services A UDDI browser: http://www.soapclient.com/uddisearch.htmlhttp://www.soapclient.com/uddisearch.html

24 Distributed Systems 200624 An Example <businessEntity businessKey="ba744ed0-3aaf-11d5-80dc-002035229c64" operator="www.ibm.com/services/uddi" authorizedName="0100001QS1"> http://www.ibm.com/services/uddi/uddiget?businessKey= BA744ED0-3AAF-11D5-80DC- 002035229C64 XMethods Web services resource site Tony Hong thong@xmethods.net...

25 Distributed Systems 200625 An Example <businessService serviceKey="d5921160-3e16-11d5-98bf-002035229c64" businessKey="ba744ed0-3aaf-11d5-80dc-002035229c64"> XMethods Delayed Stock Quotes 20-minute delayed stock quotes <bindingTemplate bindingKey="d594a970-3e16-11d5-98bf-002035229c64" serviceKey="d5921160-3e16-11d5-98bf-002035229c64"> SOAP binding for delayed stock quotes service http://services.xmethods.net:80/soap

26 Distributed Systems 200626 UDDI Elements A UDDI businessEntity describes a business and its services –Key attributes locate various data structures –a businessService describes a particular service (or family of services) –a bindingTemplate describes where and how a service is accessed –a tModel describes compliance with a specification (e.g. a WSDL description) This tModel for the single service described above refers to bindings in a WSDL description: <tModel tModelKey="uuid:0e727db0-3e14-11d5-98bf-002035229c64" operator="www.ibm.com/services/uddi" authorizedName="0100001QS1"> XMethods Simple Stock Quote Simple stock quote interface wsdl link http://www.xmethods.net/tmodels/SimpleStockQuote.wsdl the WSDL document has no service part - the service address is specified in the bindingTemplate UDDI is much more general (and more complicated) than these examples suggest...

27 Distributed Systems 200627 SOAP to UDDI The following SOAP message could be sent to a UDDI registry to inquire about services named "delayed stock quotes": delayed stock quotes –Alternatively, we could search by category codes of various kinds –The find_service meta-service operation is specified in the WSDL for the UDDI API –Of course, the UDDI registries are also registered services :-)

28 Distributed Systems 200628 Sidetrack: SOA Service-Oriented Architecture –Practices and technology that enable application functionality to be provided and consumed as services –Services can be invoked, published and discovered, and are abstracted away from the implementation using a single, standards-based form of interface. Resources –http://www.cbdiforum.comhttp://www.cbdiforum.com –http://www.google.com/search?q=oasis+soahttp://www.google.com/search?q=oasis+soa

29 Distributed Systems 200629 SOA and Web Services SOA is not equivalent to web services –Other possible underlying technologies J2EE/CORBA,.NET, … Concepts map well to web services

30 Distributed Systems 200630 SOA Concepts Service –Contractually defined behavior –Implemented and provided by a component, used by another component –Web services Maps to a web service Service descriptions –Each service should include a service description in standardized format –Technical parameters, constraints, and policies that define the terms to invoke the service –Web services Maps to a WSDL description of a web service Advertising and discovery –Services should be able to be discovered –Services need to be advertised to be discovered –Web services May be provided by a UDDI repository Data model –Invoker and invokee need to have a common conception of data –Web services XML Schemas may define data as used by services

31 Distributed Systems 200631 Internal: Service Layer Defines an application’s boundary with a layer of services that establishes a set of available operations and coordinates the application’s response in each situation

32 Distributed Systems 200632 Internal: Services Service guidelines –Self-contained – coarse-grained functionality –“Stateless” – should not retain client state between invocations –Context-independence – should not depend on other services

33 Distributed Systems 200633 External: Architecture Service-Oriented Architecture does not define a software architecture per se –”… the structure or structures of [a] system, which comprise software elements, the externally visible properties of those elements, and the relationships among them” [Bass et al., 2003] Interaction among services still need to be designed at an architectural level

34 Distributed Systems 200634 External: Deutsch’s Eight Fallacies of Distributed Computing 1. The network is reliable 2. Latency is zero 3. Bandwidth is infinite 4. The network is secure 5. Topology doesn't change 6. There is one administrator 7. Transport cost is zero 8. The network is homogeneous

35 Distributed Systems 200635 Seven Fallacies of SOA Fallacy #1 –There's Nothing New Under the Sun, and SOA Is No Exception Fallacy #2 –SOA is a Revolutionary Paradigm Shift Fallacy #3 –SOAs are All Hype, No Substance Fallacy #4 –SOA is a Panacea Fallacy #5 –The Overhead from SOA Leads to Unacceptably Poor Performance Fallacy #6 –A Bottom-Up Approach to SOA is Good Enough Fallacy #7 –SOA is Optional http://www.zapthink.com/report.html?id=ZAPFLASH-08052004

36 Distributed Systems 200636 FastWS Application are unaware of which protocol they use –Implementations may serve XML and Fast concurrently –http://java.sun.com/developer/technicalArticles/WebServices/fastWS/

37 Distributed Systems 200637 The Web Service Stack

38 Distributed Systems 200638 Status of the Stack

39 Distributed Systems 200639 Summary Web services –Machine-to-machine interaction over a network –Typically WSDL + SOAP + HTTP A large number of supporting specifications

40 Distributed Systems 200640 References [Møller & Schwartzbach, 2003] –Møller, A., and Schwartzbach, M. (2003). Interactive Web Services with Java. http://www.brics.dk/~amoeller/WWW, accessed 2006- 02-14 http://www.brics.dk/~amoeller/WWW


Download ppt "Distributed Systems 2006 Web Services (With material from [Møller & Schwartzbach, 2003])"

Similar presentations


Ads by Google