Unformatted text preview:

Web Services Concepts Architecture and Applications Part 6 Service Description WSDL Gustavo Alonso and Cesare Pautasso Computer Science Department ETH Z rich alonso inf ethz ch http www inf ethz ch alonso Some slides were modified or added by Nilufer Onder Computer Science Department Michigan Technological University http www cs mtu edu nilufer What is WSDL Web Services Description Language WSDL is an XML format for describing network services as a set of endpoints operating on messages containing either document oriented or procedure oriented communication www w3 org TR wsdl The original document was prepared by Ariba IBM and Microsoft The Web Services Description Language specification is in working draft 2 0 November 2003 June 2007 WSDL discusses how to describe the different parts that comprise a Web service A WSDL document defines services as collections of network endpoints or ports The general framework is to store WSDL descriptions where potential clients can find the services they need ETH Z rich Part 6 WSDL 2 WSDL definitions In WSDL abstract definition of endpoints and messages is separated from their concrete network deployment or data format bindings Abstract definition Types a container for data type definitions e g using XSD Message a typed definition of the data being communicated Operation description of an action supported by the service Port type set of operations supported by one or more endpoints Concrete description Binding 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 ETH Z rich Part 6 WSDL 3 Types type information for the document e g XML Schema Message 1 Message 2 Operation 1 Message 3 Message 4 Message 5 Operation 2 Operation 3 Interface abstract service binding 1 binding 2 binding 3 binding 4 endpoint 1 endpoint 2 endpoint 3 endpoint 4 Service the interface in all its available implementations ETH Z rich Message 6 Concrete description of the service WSDL document Abstract description of the service Elements of WSDL Part 6 WSDL 4 From Web Services Description Language WSDL 1 1 W3C Note 15 March 2001 WSDL Example xml version 1 0 definitions name StockQuote Targetnamespace http example com stockquote wsdl Xmlns tns http example com stockquote wsdl Xmlns xsdl http example com stockquote xsd Xmlns soap http schemas xmlsoap org wsdl soap Xmlns http schemas xmlsoap org wsdl ETH Z rich Part 6 WSDL 5 From Web Services Description Language WSDL 1 1 W3C Note 15 March 2001 WSDL Example Types 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 ETH Z rich Part 6 WSDL 6 Types 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 7 From Web Services Description Language WSDL 1 1 W3C Note 15 March 2001 WSDL Example Messages message name GetLastTradePriceInput part name body element wsdl TradePriceRequest message message name GetLastTradePriceOutput part name body element wsdl TradePrice message ETH Z rich Part 6 WSDL 8 Messages 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 ETH Z rich 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 Part 6 WSDL 9 From Web Services Description Language WSDL 1 1 W3C Note 15 March 2001 WSDL Example Operation and Port portType name StockQuotePortType operation name GetLastTradePrice input message tns GetLastTradePriceInput output message tns GetLastTradePriceOutput operation portType ETH Z rich Part 6 WSDL 10 Operations 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 would add a line containing fault message to the operation An operation has name message exchange pattern message references the messages involved input output fault references the faults involved infault outfault style optional RPC setattribute or get attribute features and properties ETH Z rich 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 used to specified characteristics of the message exchange implied by an operation Examples include reliability security routing etc Part 6 WSDL 11 From Web Services Description Language WSDL 1 1 W3C Note 15 March 2001 WSDL Example Binding 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 ETH Z rich Part 6 WSDL 12 Bindings 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


View Full Document

MTU SSE 3200 - Service Description Lecture

Download Service Description Lecture
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Service Description Lecture and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Service Description Lecture 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?