Distributed Systems 2006 - PowerPoint PPT Presentation

1 / 40
About This Presentation
Title:

Distributed Systems 2006

Description:

UDDI (Universal Description, Discovery, and Integration) ... Alternatively, we could search by category codes of various kinds ... – PowerPoint PPT presentation

Number of Views:40
Avg rating:3.0/5.0
Slides: 41
Provided by: klausmari
Category:

less

Transcript and Presenter's Notes

Title: Distributed Systems 2006


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

2
Plan
  • Basics
  • SOAP
  • WSDL
  • UDDI
  • Related specifications

3
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
Motivation
  • Heterogeneous, distributed systems
  • Scalability
  • Interoperability
  • Modifiability
  • The main motivation is interoperability
  • The ability for separately developed applications
    to work in together

5
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
(web services)
web services
(web services)
web services
7
An Example
8
A Result
9
SOAP Request
Message transport
Message intent
Message contents
Application data
10
SOAP Response
11
org.apache.axis.utils.tcpmon
  • Part of Apache Axis toolset

12
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-specifi
    c data it conveys
  • Message contents
  • xmlnssoapenv"http//schemas.xmlsoap.org/soap/env
    elope/
  • soapenvEnvelope
  • soapenvHeader
  • Application-specific control information
  • May be processed by intermediaries
  • soapenvBody
  • Information exchanged between sender and receiver
  • Typical protocols
  • HTTP

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

14
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
A WSDL Example (1)
16
A WSDL Example (2)
Data types defined using XML Schema
Message types definedfrom data types
Binding to SOAP RPCover HTTP
Port where the runningservice may be accessed
Port type defining operations
17
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
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
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
Examples of style versus encoding
  • public void myMethod(int x, float y)
  • RPC/Encoded
  • ltsoapenvelopegt ltsoapbodygt ltmyMethodgt ltx
    xsitype"xsdint"gt5lt/xgt lty xsitype"xsdfloat"gt5
    .0lt/ygt lt/myMethodgt lt/soapbodygt lt/soapenvelopegt
  • RPC/Literal
  • ltsoapenvelopegt ltsoapbodygt ltmyMethodgt ltxgt5lt/xgt
    ltygt5.0lt/ygt lt/myMethodgt lt/soapbodygt
    lt/soapenvelopegt
  • (Document/Encoded)
  • Document/Literal
  • ltsoapenvelopegt ltsoapbodygt ltxElementgt5lt/xElementgt
    ltyElementgt5.0lt/yElementgt lt/soapbodygt
    lt/soapenvelopegt
  • 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
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
Using Web Services with Java
  • JAX-RPC (JSR-101)
  • Java API for XML-Based RPC
  • Including WSDL lt-gt 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 lt-gt 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
  • _at_WebService_at_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
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 SOAPWSDL-based registry API
    for registering ("publish") and discovering
    ("inquire") Web services
  • A UDDI browser http//www.soapclient.com/uddisear
    ch.html

24
An Example
  • ltbusinessEntity businessKey"ba744ed0-3aaf-11d5-80
    dc-002035229c64"
  • operator"www.ibm.com/services/udd
    i"
  • authorizedName"0100001QS1"gt
  • ltdiscoveryURLsgt
  • ltdiscoveryURL useType"businessEntity"gthttp//
    www.ibm.com/services/uddi/uddiget?businessKeyBA74
    4ED0-3AAF-11D5-80DC- 002035229C64lt/discove
    ryURLgt
  • lt/discoveryURLsgt
  • ltnamegtXMethodslt/namegt
  • ltdescription xmllang"en"gtWeb services
    resource sitelt/descriptiongt
  • ltcontactsgt
  • ltcontact useType"Founder"gt
  • ltpersonNamegtTony Honglt/personNamegt
  • ltphone useType"Founder" /gt
  • ltemail useType"Founder"gtthong_at_xmethods.netlt
    /emailgt
  • lt/contactgt
  • lt/contactsgt
  • ...

25
An Example
  • ltbusinessServicesgt
  • ltbusinessService serviceKey"d5921160-3e16-11d
    5-98bf-002035229c64"
  • businessKey"ba744ed0-3aaf-11
    d5-80dc-002035229c64"gt
  • ltnamegtXMethods Delayed Stock Quoteslt/namegt
  • ltdescription xmllang"en"gt20-minute
    delayed stock quoteslt/descriptiongt
  • ltbindingTemplatesgt
  • ltbindingTemplate bindingKey"d594a970-3e16
    -11d5-98bf-002035229c64"
  • serviceKey"d5921160-3e16
    -11d5-98bf-002035229c64"gt
  • ltdescription xmllang"en"gtSOAP binding
    for delayed stock quotes servicelt/descriptiongt
  • ltaccessPoint URLType"http"gthttp//servi
    ces.xmethods.net80/soaplt/accessPointgt
  • lttModelInstanceDetailsgt
  • lttModelInstanceInfo
    tModelKey"uuid0e727db0-3e14-11d5-98bf-002035229c
    64" /gt
  • lt/tModelInstanceDetailsgt
  • lt/bindingTemplategt
  • lt/bindingTemplatesgt
  • lt/businessServicegt
  • lt/businessServicesgt
  • lt/businessEntitygt

26
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
  • lttModel tModelKey"uuid0e727db0-3e14-11d5-98bf-00
    2035229c64"
  • operator"www.ibm.com/services/uddi"
  • authorizedName"0100001QS1"gt
  • ltnamegtXMethods Simple Stock Quotelt/namegt
  • ltdescription xmllang"en"gtSimple stock quote
    interfacelt/descriptiongt
  • ltoverviewDocgt
  • ltdescription xmllang"en"gtwsdl
    linklt/descriptiongt
  • ltoverviewURLgthttp//www.xmethods.net/tmodels/S
    impleStockQuote.wsdllt/overviewURLgt
  • lt/overviewDocgt
  • ltcategoryBaggt ltkeyedReference
    tModelKey"uuidc1acf26d-9672-4404-9d70- 39b756e
    62ab4 ... lt/categoryBaggt
  • lt/tModelgt

27
SOAP to UDDI
  • The following SOAP message could be sent to a
    UDDI registry to inquire about services named
    "delayed stock quotes"
  • lt?xml version"1.0" encoding"UTF-8"?gt
  • ltEnvelope xmlns"http//schemas.xmlsoap.org/s
    oap/envelope/"gt
  • ltBodygt
  • ltfind_service businessKey"" generic"1.0"
    xmlns"urnuddi-orgapi"gt
  • ltnamegtdelayed stock quoteslt/namegt
  • lt/find_servicegt
  • lt/Bodygt
  • lt/Envelopegt
  • 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
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.com
  • http//www.google.com/search?qoasissoa

29
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
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
Internal Service Layer
  • Defines an applications boundary with a layer of
    services that establishes a set of available
    operations and coordinates the applications
    response in each situation

32
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
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
External Deutschs 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
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?idZAPFLASH-08
    052004

36
FastWS
  • Application are unaware of which protocol they
    use
  • Implementations may serve XML and Fast
    concurrently
  • http//java.sun.com/developer/technicalArticles/We
    bServices/fastWS/

37
The Web Service Stack
38
Status of the Stack
39
Summary
  • Web services
  • Machine-to-machine interaction over a network
  • Typically WSDL SOAP HTTP
  • A large number of supporting specifications

40
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
Write a Comment
User Comments (0)
About PowerShow.com