Title: Web Service Description Language WSDL
1Web Service Description Language (WSDL)
- John Schneider
- Chief Technologist
- john.schneider_at_agiledelta.com
2Overview
- What is WSDL?
- WSDL Concepts
- What things does WSDL describe?
- WSDL Syntax
- How does WSDL describe these things?
- WSDL Use Cases
- How might you use WSDL?
3What is WSDL?
- An XML format for describing web services
- To the Consumer How to use the service(e.g.,
To use my shopping cart, send these SOAP
messages over HTTP to http//myservice.net/cart) - To the Server How to configure the
service(e.g., Make my shopping cart available
using SOAP over HTTP at http//myservice.net/cart
) - To the Registry How to find the service(e.g.,
Find me all the shopping carts I can talk to.)
4WSDL Concepts by Example
Shopping Cart
Add
Remove
List
5WSDL Concepts by Example
WSDL Terms
Port Type
Operation
Shopping Cart
Add
Remove
List
6WSDL Concepts by Example
WSDL Terms
Shopping Cart Service
Port Type
Operation
AddItemInput
Shopping Cart
Binding
Port
Add
HTTP SOAP
Remove
Service
HTTP XML
List
Message
7What does WSDL Describe?
- Abstract Concepts
- Port Types (e.g., shopping basket)
- Operations (e.g., add, remove, list)
- Messages (i.e., inputs, outputs and faults)
- Data types (i.e., schemas)
- Concrete Bindings
- Data encoding styles (e.g., SOAP encoding)
- Transport protocols (e.g., HTTP, SMTP)
- Network addresses (e.g., http//myservice.net/cart
)
8How does WSDL Describe Things?
- ltdefinitions nameShoppingCartDefinitions
- xmlnshttp//schemas/xmlsoap.org/wsdl
targetNamespace gt - lttypesgt lt/typesgt
- ltmessage nameAddItemInputgt lt/messagegt
- ltmessage nameAddItemOutputgt lt/messagegt
- ltportType nameShoppingCartgt lt/portTypegt
- ltbinding nameCartHTTPXMLBinding
typetnsShoppingCartgt - ltbinding nameCartSOAPBinding
typetnsShoppingCartgt - ltservice nameShoppingCartServicegt
- ltport nameHTTPXMLCart bindingtnsCartHTTPXM
LBindinggt - ltport nameSOAPCart bindingtnsCartSOAPBindi
nggt - lt/servicegt
- ltimport namespace locationgt
- lt/definitionsgt
9How WSDL Describes Port Types
- A named collection of related operations
- ltportType nameShoppingCartgt
- ltoperation nameAddItemgt lt/operationgt
- ltoperation nameRemoveItemgt lt/operationgt
- ltoperation nameListItemsgt lt/operationgt
- lt/portTypegt
10How WSDL Describes Operations
- A signature (input, output and fault messages)
- Operations can be one-way, request-response,
notifications or solicit-response - ltoperation nameAddItemgt
- ltinput messagetnsAddItemInput/gt
- ltoutput messagetnsACK/gt
- ltfault nameBadCartID messagetnsBadCartID/
gt - ltfault nameServiceDown messagetnsServiceDo
wn/gt - lt/operationgt
Add
11How WSDL Describes Messages
- A named collection of message parts
- Each part has a name and a type
- ltmessage nameAddItemInputgt
- ltpart namecart-id typexsdstring/gt
- ltpart nameitem typecarttypesitem/gt
- ltpart nameimage typexsdbase64Binary/gt
- lt/messagegt
12How WSDL Describes Data Types
- Using the XML Schema language (however, other
type systems are permitted) - lttypesgt
- ltschema targetNamespacehttp//myservice.net/car
t/types - xmlnshttp//www.w3.org/2000/10/XMLSchemagt
- ltcomplexType nameitemgtltallgt
- ltelement namedescription typexsdstring/gt
- ltelement namequantity typexsdinteger/gt
- ltelement nameprice typexsdfloat/gt lt/all
gtlt/complexTypegt - lt/schemagt
- lt/typesgt
13How WSDL Describes Bindings
- A named association of protocol details with a
port type, its operations and its messages - ltbinding nameCartHTTPXMLBinding
typetnsShoppingCartgt - lthttpbinding verbPOST/gt
- ltoperation nameAddItemgt
- lthttpoperation location/AddItem/gt
- ltinputgt ltmimemimeXML/gt lt/inputgt
- ltoutputgt ltmimemimeXML/gt lt/outputgt
- ltfault nameBadCartIDgt ltmimemimeXML/gt
lt/faultgt - ltfault nameServiceDowngt ltmimemimeXML/gt
lt/faultgt lt/operationgt - lt/bindinggt
HTTP XML
14How WSDL Describes Bindings
- A named association of protocol details with a
port type, its operations and its messages - ltbinding nameCartHTTPXMLBinding
typetnsShoppingCartgt - lthttpbinding verbPOST/gt
- ltoperation nameAddItemgt
- lthttpoperation location/AddItem/gt
- ltinputgt ltmimemimeXML/gt lt/inputgt
- ltoutputgt ltmimemimeXML/gt lt/outputgt
- ltfault nameBadCartIDgt ltmimemimeXML/gt
lt/faultgt - ltfault nameServiceDowngt ltmimemimeXML/gt
lt/faultgt lt/operationgt - lt/bindinggt
HTTP XML
15How WSDL Describes Bindings
- A named association of protocol details with a
port type, its operations and its messages - ltbinding nameCartHTTPXMLBinding
typetnsShoppingCartgt - lthttpbinding verbPOST/gt
- ltoperation nameAddItemgt
- lthttpoperation location/AddItem/gt
- ltinputgt ltmimemimeXML/gt lt/inputgt
- ltoutputgt ltmimemimeXML/gt lt/outputgt
- ltfault nameBadCartIDgt ltmimemimeXML/gt
lt/faultgt - ltfault nameServiceDowngt ltmimemimeXML/gt
lt/faultgt lt/operationgt - lt/bindinggt
HTTP XML
16How WSDL Describes Bindings
- A named association of protocol details with a
port type, its operations and its messages - ltbinding nameCartHTTPXMLBinding
typetnsShoppingCartgt - lthttpbinding verbPOST/gt
- ltoperation nameAddItemgt
- lthttpoperation location/AddItem/gt
- ltinputgt ltmimemimeXML/gt lt/inputgt
- ltoutputgt ltmimemimeXML/gt lt/outputgt
- ltfault nameBadCartIDgt ltmimemimeXML/gt
lt/faultgt - ltfault nameServiceDowngt ltmimemimeXML/gt
lt/faultgt lt/operationgt - lt/bindinggt
HTTP XML
17How WSDL Describes Bindings
- A more complex example
- ltbinding nameCartHTTPSOAPBinding
typetnsShoppingCartgt - ltsoapbinding styleRPC transporthttp//schem
as.xmlsoap.org/soap/http/gt - ltoperation nameAddItemgt
- ltsoapoperation soapActionhttp//myservice.net
/cart/AddItem/gt - ltinputgt
- ltsoapbody useencoded namespacehttp//myse
rvice.net/cart - encodingStylehttp//schemas.xmlsoap.org/soap
/encoding/gt - lt/inputgt
- ltoutputgt
- ltsoapbody useencoded namespacehttp//myse
rvice.net/cart - encodingStylehttp//schemas.xmlsoap.org/soap
/encoding/gt - lt/outputgt
- ltfault nameBadCartIDgt ltsoapbody
useencoded namespace /gt lt/faultgt - ltfault nameServiceDowngt ltsoapbody use /gt
lt/faultgtlt/operationgt - lt/bindinggt
SOAP XML
18How WSDL Describes Ports
- A named association of a protocol binding with a
network address - ltport nameSOAPCart bindingtnsSOAPCartBindin
ggt - ltsoapaddress locationhttp//myservice.net/soa
p/cart/gt - lt/portgt
- ltport nameHTTPXMLCart bindingtnsHTTPXMLCart
Bindinggt - lthttpaddress locationhttp//myservice.net/car
t/gt - lt/portgt
HTTP SOAP
http//myservice.net/soap/cart
HTTP XML
http//myservice.net/cart
19How WSDL Describes Services
- A related collection of ports
- ltservice nameShoppingCartServicegt
- ltdocumentationgtA Shopping Cart for the
Weblt/documentationgt - ltport nameHTTPXMLCart bindingtnsHTTPXMLCart
Bindinggt - lthttpaddress locationhttp//myservice.net/car
t/gt - lt/portgt
- ltport nameSOAPCart bindingtnsSOAPCartBindin
ggt - ltsoapaddress locationhttp//myservice.net/soa
p/cart/gt - lt/portgt
- lt/servicegt
20How WSDL Describes Reuse
- ltimport namespacehttp//webservices.org/cart/car
t-type locationhttp//services.org/cart/cart-t
ype.wsdl/gt - ltbinding xmlnswshttp//webservices.org/cart/car
t-type nameCartHTTPXMLBinding
typewsShoppingCartgt
21How might you use WSDL?
- Use an application to automatically generate Web
Service stubs from WSDL - Assists in developing standard web services
- Service provider fills in implementation details
WSDL
Web Service
22How might you use WSDL?
- Use an application to automatically generate WSDL
descriptions of Web Services - Describe web services to consumers
- Associate technical details with UDDI entries
Web Service
23How might you use WSDL?
- Use as a declarative way to configure services
WSDL
Web Service
24How might you use WSDL?
- Use to configure remote service proxy objects
- Insulate consumers from invocation details
- Support fail-over to other addresses and
protocols - Insulate consumers from changes (e.g., location)
WSDL
Web Service
Remote Service
25Review and Questions