Dimuthu Leelarathne Software Engineer WSO2 Introduction to WSDL 2.0 Dimuthu Leelarathne Software Engineer WSO2
WSDL What is WSDL? What is new in WSDL 2.0? Describes a service in two stages Abstract – The service contract Concreate – ”How” and ”Where”
WSDL 2.0 – 3 Specifications Part 0: Primer Introduction to main features of the language. Part 1: Core Describes WSDL2.0 using component model Part 2: Adjuncts MEPs and Bindings
WSDL 2.0 Vs. WSDL 1.1 At a glance definition renamed to description. portType renamed to interface. port renamed to endpoint. message elements are removed.
WSDL file
WSDL file ABSTRACT CONCRETE
WSDL2.0 components Top level components type interface binding service import/include documentation
WSDL file <description targetNamespace="xs:anyURI" > <documentation />* [ <import /> | <include /> ]* <types />? [ <interface /> | <binding /> | <service /> ]* </description>
documentation A brief description of a wsdl document <documentation>This wsdl describes my Echo Service</documentation>
types Defines the data types used in exchanged messages. Use xml schema
types example
interface A named set of abstract operations and abstract messages. <interface name="xs:NCName" extends="list of xs:QName"? styleDefault="list of xs:anyURI"? > <documentation />* [ <fault /> | <operation /> ]* </interface>
interface example
import and include a.wsdl, b.wsdl and c.wsdl together can represent a service <import namespace="http://finance.example.com/CreditCards/wsdl" location="credit-card-faults.wsdl"/> <include location="credit-card-faults.wsdl"/>
Interface inheritance An interfaces may extend one or more interfaces <interface name="xs:NCName" extends="list of xs:QName"?> ... </interface>
binding Binding element defines the underlying transport and wire format for messages. <description> <binding name="xs:NCName" interface="xs:QName"? type="xs:anyURI" > <documentation />* [ <fault /> | <operation /> ]* </binding> </description>
binding example
service A service element describes a set of endpoints, that refer to a single network address for a binding. <service name="reservationService" interface="tns:reservationInterface"> <endpoint name="reservationEndpoint" binding="tns:reservationSOAPBinding" address ="http://greath.example.com/2004/reservation"/> </service>
MEPs Message Exchange Patterns Message exchange between nodes Specifies sequencing, direction and cardinality New in WSDL 2.0: Extensible (was fixed in WSDL 1.1) - number and names of MEP not finalized Any number of nodes (was 2 in WSDL 1.1)
Predefined MEPs In-only (no faults) Out-only (no faults) Out-In (fault replaces message) Robust In-only (message triggers fault) Robust Out-only (message triggers fault) Out-Optional-In (message triggers fault) In-out (fault replaces message)
Operations Safe attribute of operation Agent does not incur any obligation beyond interaction. For example, you do not have to pay. Style attribute of operation Gives additional information about the operation RPC Style/ IRI /Mulitipart
Predefined bindings SOAP Binding extention WSDL HTTP Binding Extension
SOAP binding Definines a set of default rules Operations need not be explicitly stated SOAP header blocks can be declared – per message and per-fault Interface fault mapping to a SOAP fault
HTTP binding Complete control over the url Can select HTTP method, content type – So REST style invocations are supported Defines how to serialize parameters
WSDL 2.0 and REST
Why WSDL 2.0 ? Interface inheritence Abstract and concrete descriptions are consistent Bindings cannot override interface A single interface per binding HTTP binding is precisely defined
Why WSDL 2.0 ? Defines 8 MEPs. Extensible MEPs Language extentions Simple and easy Only Doc\Literal Better naming conventions Powerful – many extention points
Questions ?????
Introduction to WSDL 2.0 Thank you