Practical Applications of XML Technologies - PowerPoint PPT Presentation

1 / 85
About This Presentation
Title:

Practical Applications of XML Technologies

Description:

http://www.w3.org/ns/wsdl/message-triggers-fault. applied by ... restrictions on message content models when HTTP is applied as network communication protocol ... – PowerPoint PPT presentation

Number of Views:36
Avg rating:3.0/5.0
Slides: 86
Provided by: Mart199
Category:

less

Transcript and Presenter's Notes

Title: Practical Applications of XML Technologies


1
Practical Applications of XML Technologies
  • Foundations of Web Services
  • WSDL
  • Irena MlĂ˝nková
  • Martin NecaskĂ˝
  • Dept. of Software Engineering
  • Faculty of Mathematics and Physics
  • Charles University, Prague, Czech Republic

2
WSDL Basics
  • Web Services Description Language
  • language for describing web service interfaces
  • current version 2.0
  • http//www.w3.org/TR/wsdl20-primer
  • editors
  • David Booth, HP
  • Canyang Kevin Liu, SAP Labs

3
WSDL BasicsConceptual Structure
  • first approximation

Service
4
WSDL BasicsConceptual Structure
  • second approximation

Interface
Implementation
5
WSDL BasicsConceptual Structure
  • third approximation

Interface
Operation A
Implementation
Operation B
Operation C
6
WSDL BasicsConceptual Structure
  • example

Interface
ReserveFlight
Implementation
ConfirmFlight
CheckInFlight
7
WSDL BasicsConceptual Structure
  • WSDL allows describing of
  • interfaces of web services
  • where web services implementing these interfaces
    can be accessed and how
  • web service
  • implements interface composed of one or more
    abstract interfaces
  • can be accessed at various places in different
    ways
  • SOAP, HTTP,

8
WSDL BasicsConceptual Structure
SOAP1.2 Endpoint
Abstract Interface ManageCustomer
Service Interface
Abstract Interface ProcessPurchase A
HTTP GET Endpoint
Abstract Interface ProcessPurchase B
HTTP POST Endpoint
9
WSDL BasicsConceptual Structure
Service Description
Abstract Description
Message

Operation
Interface
Concrete Description
Binding

Service
Endpoint
10
WSDL BasicsSyntactical Structure
  • root element description
  • container for
  • abstract definition components
  • type system
  • element types
  • abstract interface
  • element interface

11
WSDL BasicsSyntactical Structure
  • and for
  • concrete definition components
  • service description
  • element service
  • binding between service and interface
  • element binding

12
WSDL BasicsElement description
lt?xml version"1.0" encoding"utf-8"
?gt ltdescription xmlns"http//www.w3.org/ns/wsdl"gt
ltdocumentationgt ... lt/documentationgt
lt!- type system --gt lttypesgt ... lt/typesgt
lt! WSDL 2.0 components --gt ltinterfacegt ...
lt/interfacegt ltbindinggt ... lt/bindinggt
ltservicegt ... lt/servicegt lt/descriptiongt
13
WSDL BasicsElement description
DEMO
14
WSDL Type System
15
WSDL BasicsConceptual Structure
Service Description
Abstract Description
Message

Operation
Interface
Concrete Description
Binding

Service
Endpoint
16
WSDL Type SystemElement types
  • describes formats for XML messages send and
    received by web service
  • any XML schema language with XML syntax can be
    applied inside
  • XML Schema, Relax NG, Schematron, etc.
  • we (and many others) consider XML Schema
  • XML Schema should be already known for you
  • non-XML type system can be applied as well

17
WSDL Type SystemElement types
lt?xml version"1.0" encoding"utf-8"
?gt ltdescription xmlns"http//www.w3.org/ns/wsdl"gt
ltdocumentationgt ... lt/documentationgt
lt!- type system --gt lttypesgt ... lt/typesgt
lt! WSDL 2.0 components --gt ltinterfacegt ...
lt/interfacegt ltbindinggt ... lt/bindinggt
ltservicegt ... lt/servicegt lt/descriptiongt
18
WSDL Type SystemElement types
DEMO
19
WSDL Abstract Interfaces
20
WSDL BasicsConceptual Structure
Service Description
Abstract Description
Message

Operation
Interface
Concrete Description
Binding

Service
Endpoint
21
WSDL Abstract Interfaces
  • service description contains one or more abstract
    interfaces
  • each specified by element interface
  • abstract interface encapsulates set of
  • supported operations
  • faults reported by operations
  • describes functionality only in abstract way
  • no concrete details of how and where that
    functionality is offered and implemented

22
WSDL Abstract InterfacesElement interface
lt?xml version"1.0" encoding"utf-8"
?gt ltdescription xmlns"http//www.w3.org/ns/wsdl"gt
ltdocumentationgt ... lt/documentationgt
lt!- type system --gt lttypesgt ... lt/typesgt
lt! WSDL 2.0 components --gt ltinterfacegt ...
lt/interfacegt ltbindinggt ... lt/bindinggt
ltservicegt ... lt/servicegt lt/descriptiongt
23
WSDL Abstract InterfacesElement interface
  • attributes
  • name
  • unique among all abstract interfaces within
    containing description
  • child elements
  • optional documentation
  • one or more (in any order)
  • fault defines fault
  • operation defines operation

24
WSDL Abstract InterfacesElement interface
DEMO
25
WSDL Abstract InterfacesElement interface/fault
  • specifies fault message that may occure during
    execution of any operation within containing
    interface
  • referenced from operations within interface that
    may report that fault
  • similar to ordinary messages but handled slightly
    differently
  • disturbt normal message flow
  • binding to underlying communication protocol
    (e.g. SOAP) may be different

26
WSDL Abstract InterfacesElement interface/fault
  • attributes
  • required name
  • unique within parent interface
  • referenced from operations in same parent
    interface
  • optional element
  • content model of fault message
  • name of element defined in type system of web
    service description

27
WSDL Abstract InterfacesElement interface/fault
DEMO
28
WSDL Abstract InterfacesElement
interface/operation
  • operation provided by containing interface
  • specifies message interaction with service via
    that operation
  • set of ordinary and fault messages exchanged
    between service and other parties
  • associated with message exchange pattern (MEP)
  • MEP describes ordering and cardinality of
    messages within interaction via operation

29
WSDL Abstract InterfacesElement
interface/operation
  • attributes
  • required name
  • unique within parent interface
  • required pattern
  • xsanyURI
  • identifies desired MEP for operation

30
WSDL Abstract InterfacesElement
interface/operation
  • attributes
  • optional style
  • xsanyURI
  • identifies set of rules followed in defining
    operation
  • e.g. "http//www.w3.org/ns/wsdl/rpc" for
    RPC-style operations

31
WSDL Abstract InterfacesElement
interface/operation
DEMO
32
WSDL Abstract InterfacesMore on Message Exchange
Patterns
  • define sequence and cardinality of abstract
    messages in operation
  • each abstract message is represented by
    placeholder
  • placeholder is identified by its role and has
    direction ("in" or "out")
  • placeholders associated with specific message
    types when operation with that MEP is defined
  • minimal contract
  • other messages not specified by MEP may be sent
    during interaction

33
WSDL Abstract InterfacesMore on Message Exchange
Patterns
  • 8 predefined MEPs in Working Draft 27 March 2006
  • in-bound MEPs
  • service receives first message in interaction
  • In-Only, Robust In-Only, In-Out,
  • In-Optional-Out
  • out-bound MEPs
  • service sends first message in interaction
  • Out-Only, Robust Out-Only, Out-In,
  • Out-Optional-In
  • only three predefined MEPs in Recommendation 26
    June 2007
  • In-Only, Robust In-Only, In-Out
  • however, primer speaks about 8 MEPs

34
WSDL Abstract InterfacesMore on Message Exchange
Patterns
  • only three predefined MEPs in Recommendation 26
    June 2007
  • In-Only
  • Robust In-Only
  • In-Out
  • however, primer of that version speaks about 8
    MEPs
  • version inconsistency?

35
WSDL Abstract InterfacesMore on Message Exchange
Patterns
  • In-Out
  • "http//www.w3.org/ns/wsdl/in-out"
  • consists of exactly two placeholders
  • placeholder
  • message label "In", direction "in"
  • sent from some node N
  • placeholder
  • message label "Out", direction "out"
  • sent back to N

36
WSDL Abstract InterfacesMore on Message Exchange
Patterns
  • In-Only
  • "http//www.w3.org/ns/wsdl/in-only"
  • consists of exactly one placeholder
  • placeholder
  • message label "In", direction "in"
  • sent from some node N

37
WSDL Abstract InterfacesMore on Message Exchange
Patterns
  • Robust In-Only
  • "http//www.w3.org/ns/wsdl/in-only"
  • consists of exactly one placeholder
  • placeholder
  • message label "In", direction "in"
  • sent from some node N
  • difference between In-Only and Robust In-Only is
    in Fault Propagation Rule applied

38
WSDL Abstract InterfacesMore on Fault
Propagation Rules
  • rules indicating where faults can occur in
    interaction specified by MEP
  • Fault Replaces Message
  • any ordinary message after the first one can be
    replaced with fault message
  • fault message must have identical direction as
    replaced message and must be delivered to same
    target as replaced message
  • if there is no path to target node, fault must be
    discarded
  • http//www.w3.org/ns/wsdl/fault-replaces-message
  • applied by In-Out MEP

39
WSDL Abstract InterfacesMore on Fault
Propagation Rules
  • Message Triggers Fault
  • any ordinary message including the first can
    trigger fault message
  • fault message must have opposite direction to the
    ordinary message and must be delivered to the
    originator of the ordinary message
  • if there is no path to the originator, fault must
    be discarded
  • http//www.w3.org/ns/wsdl/message-triggers-fault
  • applied by Robust In-Only MEP

40
WSDL Abstract InterfacesMore on Fault
Propagation Rules
  • No Faults
  • faults must not be propagated
  • http//www.w3.org/ns/wsdl/no-faults
  • applied by In-Only MEP

41
WSDL Abstract InterfacesMore on Operation Styles
  • specifies additional information about operation
  • may define various constraints
  • e.g. structural constraints on element
    declarations specifying content models of
    messages of operation
  • particular operation style identified by IRI
  • three predefined operation styles in WSDL 2.0
  • http//www.w3.org/ns/wsdl/style/rpc
  • http//www.w3.org/ns/wsdl/style/iri
  • http//www.w3.org/ns/wsdl/style/multipart

42
WSDL Abstract InterfacesMore on Operation Styles
  • http//www.w3.org/ns/wsdl/style/rpc
  • restrictions on message content models to allow
    RPC-based communication
  • http//www.w3.org/ns/wsdl/style/iri
  • restrictions on message content models when HTTP
    is applied as network communication protocol
  • allows serialization of messages to HTTP
    requests/response with GET/POST/PUT/DELETE HTTP
    methods
  • e.g. GET does not allow HTTP message body and
    everything must be encoded into HTTP message
    header and/or HTTP request query

43
WSDL Abstract InterfacesElement
interface/operation
  • ordinary messages specified by child elements
  • input, output
  • fault messages specified by child elements
  • infault, outfault
  • any number of ordinary and fault messages in any
    order
  • restricted by associated MEP

44
WSDL Abstract InterfacesElement
interface/operation/inputoutput
  • specifies one ordinary input/output message
  • attributes
  • optional messageLabel
  • xsNCName
  • identifies role the message plays in MEP
  • unique within containing operation
  • predefined values "In", "Out"
  • not necessary when standard MEP is applied

45
WSDL Abstract InterfacesElement
interface/operation/inputoutput
  • attributes
  • required element
  • union of xstoken and xsQName
  • specifies message content model
  • values
  • any any single element
  • none no content
  • other content is described by extension
    property that references non-XML content
    declaration
  • reference to element declared in type system

46
WSDL Abstract InterfacesElement
interface/operation/inputoutput
DEMO
47
WSDL Abstract InterfacesElement
interface/operation/infaultoutfault
  • specifies one fault input/output message
  • attributes
  • optional messageLabel
  • xsNCName
  • identifies role the message plays in MEP
  • unique within containing operation
  • predefined values "In", "Out"
  • not necessary when standard MEP is applied

48
WSDL Abstract InterfacesElement
interface/operation/infaultoutfault
  • attributes
  • required ref
  • xsQName
  • reference to abstract fault within containing
    interface
  • specifies fault content model
  • allows reusability of faults within the interface

49
WSDL Abstract InterfacesElement
interface/operation/infaultoutfault
DEMO
50
WSDL Abstract InterfacesImports
  • XSD element import can be used for importing
    external XML schemas into type system
  • attributes namespace and schemaLocation
  • WSDL element import can be used for importing
    external WSDL descriptions
  • attributes namespace and schemaLocation
  • attribute extends of element interface that
    allows extending external interfaces
  • list of xsQName

51
WSDL Abstract InterfacesImports
DEMO
52
WSDL Abstract Interfaces
  • "not-yet-picked" "low-hanging" fruit for
    interoperability efforts
  • service can be bounded to more abstract
    interfaces
  • abstract interface can be defined separately from
    web service itself

53
WSDL Abstract Interfaces
  • Real-world scenario 1
  • two standardization organizations
  • each defining own standardized abstract interface
    for processing purchase orders
  • each has own type system, abstract operations and
    faults
  • concrete purchase order processing web service
    supports three abstract interfaces
  • one own abstract interface
  • two standardized interfaces

54
WSDL Abstract Interfaces
  • Real-world scenario 2
  • party understands standardized abstract interface
    for purchasing flights
  • it is necessary to find all services that support
    that abstract interface

55
WSDL Bindings
56
WSDL BasicsConceptual Structure
Service Description
Abstract Description
Message

Operation
Interface
Concrete Description
Binding

Service
Endpoint
57
WSDL Bindings
  • service description contains one or more bindings
  • each specified by element binding
  • binding supplies protocol and encoding details to
    given abstract interface
  • implementation details needed to access service
    via that interface
  • for each particular protocol there is binding
    extension
  • two predefined binding extensions in WSDL 2.0
  • SOAP and HTTP
  • other binding extensions can be created

58
WSDL Bindings
  • binding is expressed with mixture of constructs
    from WSDL 2.0 namespace and binding extension
    namespace
  • we will study WSDL 2.0 constructs with SOAP1.2
    binding extensions

59
WSDL BindingsElement binding
lt?xml version"1.0" encoding"utf-8"
?gt ltdescription xmlns"http//www.w3.org/ns/wsdl"gt
ltdocumentationgt ... lt/documentationgt
lt!- type system --gt lttypesgt ... lt/typesgt
lt! WSDL 2.0 components --gt ltinterfacegt ...
lt/interfacegt ltbindinggt ... lt/bindinggt
ltservicegt ... lt/servicegt lt/descriptiongt
60
WSDL BindingsElement binding
  • attributes
  • required name
  • xsNCName
  • unique within containing service description
  • optional interface
  • xsQName
  • indicates interface for which binding information
    is being specified
  • if present all interface operations and faults
    must be binded inside

61
WSDL BindingsElement binding
  • attributes
  • required type
  • xsanyURI
  • specifies kind of binding details inside
  • http//www.w3.org/ns/wsdl/soap for SOAP1.2
    binding
  • http//www.w3.org/ns/wsdl/http for HTTP binding

62
WSDL BindingsElement binding
  • attributes
  • optional wsoapprotocol
  • xmlnswsoap"http//www.w3.org/ns/wsdl/soap"
  • specifies underlying network transfer protocol
    for SOAP1.2
  • http//www.w3.org/2003/05/soap/bindings/HTTP/ for
    HTTP

63
WSDL BindingsElement binding
  • child elements
  • optional documentation
  • one or more (in any order)
  • fault defines fault binding
  • operation defines operation binding

64
WSDL BindingsElement binding
DEMO
65
WSDL BindingsElement binding/fault
  • specifies binding of abstract fault to concrete
    message format
  • e.g., for SOAP
  • SOAP codes and subcodes representing abstract
    fault in SOAP fault messages

66
WSDL BindingsElement binding/fault
  • attributes
  • required ref
  • xsQName
  • references abstract fault for which binding
    information is being specified
  • optional wsoapcode
  • union of xsQName, xstoken
  • maps abstract fault to specific SOAP fault with
    given code
  • optional wsoapsubcodes
  • union of (list of xsQName), xstoken
  • specification of SOAP subcodes

67
WSDL BindingsElement binding/fault
DEMO
68
WSDL BindingsElement binding/operation
  • specifies binding of abstract message to concrete
    message format
  • e.g., for SOAP
  • binding abstract WSDL MEP to SOAP MEP

69
WSDL BindingsElement binding/operation
  • attributes
  • required ref
  • xsQName
  • references abstract message for which binding
    information is being specified
  • optional wsoapmep
  • union of xsanyURI, xstoken
  • maps abstract fault to specific SOAP fault with
    given code

70
WSDL BindingsElement binding/operation
DEMO
71
WSDL BindingsDefining SOAP Header Blocks
  • WSDL SOAP binding extensions allow defining
    required/optional header blocks in SOAP messages
  • element header contained in elements fault, input
    and output

72
WSDL BindingsElement header
  • attributes
  • required element
  • xsQName
  • element declaration within containing service
    type system
  • required mustUnderstand
  • xsboolean
  • when true, SOAP header block must be complemented
    with SOAP mustUnderstand attribute set to true

73
WSDL BindingsElement header
  • attributes
  • required required
  • xsboolean
  • specifies whether this SOAP header block is
    required or not

74
WSDL BindingsElement header
DEMO
75
WSDL Services
76
WSDL BasicsConceptual Structure
Service Description
Abstract Description
Message

Operation
Interface
Concrete Description
Binding

Service
Endpoint
77
WSDL Services
  • WSDL description contains one or more services
  • service specifies set of endpoints where
    particular deployed implementation of bindinded
    interface is provided
  • endpoints are alternate places at which service
    is provided

78
WSDL ServicesElement service
lt?xml version"1.0" encoding"utf-8"
?gt ltdescription xmlns"http//www.w3.org/ns/wsdl"gt
ltdocumentationgt ... lt/documentationgt
lt!- type system --gt lttypesgt ... lt/typesgt
lt! WSDL 2.0 components --gt ltinterfacegt ...
lt/interfacegt ltbindinggt ... lt/bindinggt
ltservicegt ... lt/servicegt lt/descriptiongt
79
WSDL ServicesElement service
  • attributes
  • required name
  • xsNCName
  • unique within containing service description
  • required interface
  • xsQName
  • indicates interface implemented by this service

80
WSDL ServicesElement service
  • child elements
  • required endpoint

81
WSDL ServicesElement service
DEMO
82
WSDL ServicesElement endpoint
  • defines details of particular service endpoint at
    which service is available
  • endpoint service access point
  • attributes
  • required name
  • xsNCName
  • unique within containing service

83
WSDL ServicesElement endpoint
  • attributes
  • required binding
  • xsQName
  • indicates binding of interface implemented by
    service
  • optional address
  • xsanyURI
  • physical address where service can be accessed

84
WSDL ServicesElement endpoint
DEMO
85
WSDL 2.0 vs. WSDL 1.1
Write a Comment
User Comments (0)
About PowerShow.com