Web Services - Concepts, Architecture and Applications Part 6: Service Description (WSDL)What is WSDL?Elements of WSDLTypes in WSDLMessages and FaultsOperationsMessage exchange patternsInterfacesBindings and portsBindings, endpoints, and servicesWSDL 1.1 vs WSDL 2.0On the use of WSDLConversationsConversations (example)Other standardsAutomatic developmentWeb Services - Concepts, Architecture and ApplicationsPart 6: Service Description (WSDL)Gustavo Alonso and Cesare PautassoComputer Science DepartmentETH Zü[email protected]://www.inf.ethz.ch/~alonso©ETH Zürich Part 6: WSDL 2What is WSDL? The Web Services Description Language specification is in working draft 2.0 (November 2003) WSDL discusses how to describe the different parts that comprise a Web service:Ä Abstract description• the type system used to describe the messages (based on XML Schema)• the messages involved in invoking the service• the individual operations composed of different message exchangepatterns• an interface that groups the operations that constitute an abstract serviceÄ Concrete description• binding the interface to a transport protocol• the endpoint or network address of the binding • a service as a collection of all bindings of the same interface©ETH Zürich Part 6: WSDL 3Elements of WSDLWSDL documentTypes (type information for the document, e.g., XML Schema)Message 1 Message 4Message 3Message 2Operation 1 Operation 3Operation 2Message 6Message 5Interface (abstract service)binding 1endpoint 1binding 2endpoint 2binding 3endpoint 3binding 4endpoint 4Service (the interface in all its available implementations)Abstract description of the serviceConcrete description of the service©ETH Zürich Part 6: WSDL 4Types in WSDL The types in WSDL are used to specify the contents of the messages (normal messages and fault messages) that will be exchanged as part of the interactions with the Web service The type system is typically based on XML Schema (structures and data types) - support is mandatory for all WSDL processors An extensibility element can be used to define a schema definition language other than XML Schema©ETH Zürich Part 6: WSDL 5Messages and Faults Called “message reference component”, it contains three elements:Ä message reference: indicating the message pattern used for this messageÄ direction: whether it is an inbound or outbound messageÄ message: the actual contents of the message expressed in terms of the types previously defined Messages are divided into parts, each of them being a data structure represented in XML. Each part must have a type (basic or complex types, previously declared in the WSDL document). If a SOAP binding is used, a WSDL message element is meant to match the contents of the body of a SOAP message. By looking at the types and looking at the message, it is possible to build a SOAP message that matches the WSDL description (and this can be done automatically since the description is XML based and the types also supported by SOAP) Called the “fault reference component”, it contains:Ä a nameÄ message reference: the message to which the fault refers toÄ direction: whether the fault is inbound or outboundÄ message: the actual contents©ETH Zürich Part 6: WSDL 6Operations An operation is a set of messages and faults. The sequencing and number of messages in the operation is determined by the message exchange pattern An operation has:Ä nameÄ message exchange patternÄ message references: the messages involved (input, output)Ä fault references: the faults involved (infault, outfault)Ä style (optional): RPC, set-attribute or get-attributeÄ features and properties Style:Ä RPC = implies interactions mirroring the behavior of RPCÄ set- and get- attribute = implies interactions of the type commonly found in object oriented languages Features and properties:Ä are used to specified characteristics of the message exchange implied by an operation. Examples include reliability, security, routing, etc©ETH Zürich Part 6: WSDL 7Message exchange patterns IN-ONLYÄ a single incoming message (A) with no faults ROBUST IN-ONLYÄ an inbound message (A) that might trigger a fault message IN-OUTÄ An incoming message (A) received from node NÄ An outgoing message (B) sent to node NÄ Faults, if any, replace message B IN-MULTI-OUTÄ Like IN-OUT but with zero or more outbound messages and “fault replaces message” behavior OUT-ONLYÄ An outbound message (A) that expects no faults ROBUST OUT-ONLYÄ An outbound message (A) that might trigger a fault OUT-INÄ An outbound message (A) to node NÄ An inbound message (B) from node NÄ Faults, if any, replace message B ASYNCHRONOUS OUT-INÄ Like OUT-IN but with trigger behavior for messages OUT-MULTI-INÄ reverse of IN-MULTI-OUT©ETH Zürich Part 6: WSDL 8Interfaces An interface defines the messages a service sends or receives by grouping the messages into operations An interface can extend the operations of other interfaces (inheritance) An interface has:Ä nameÄ extended interfaces: other interfaces that this one extendsÄ style default: default style for operationsÄ operationsÄ features and properties An interface corresponds to the abstract description of the Web service, it does not contain any information about where the service resides or what protocols are used to invoke the Web service©ETH Zürich Part 6: WSDL 9Bindings and ports A binding defines message formats and protocol details for the operations and messages of a given Port Type A binding corresponds to a single Port Type (obvious since it needs to refer to the operations and messages of the Port Type) A Port Type can have several bindings (thereby providing several access channels to the same abstract service) The binding is extensible with elements that allow to specify mappings of the messages and operations to any format or transport protocol. In this way WSDL is not protocol specific. A port specifies the address of a binding, i.e., how to access the service using a particular protocol and format Ports can only specify one address and they should not contain any binding information The port is often specified as part of a service rather than on its own©ETH Zürich Part 6: WSDL 10Bindings, endpoints, and services A binding describes a concrete message format and transmission protocol for a given endpoint A
View Full Document