Why WSDL ?
WSDL uses XML to describe interfaces Consider Web browsers and Web servers
What is WSDL ?
WSDL is a standard used to describe network services used to facilitate the interaction between web services providers and consumers.
WSDL is not a programming language. Send me strings and I will return strings. I expect SOAP messages that include the strings in the body. I expect this body to be RPC encoded with the operation name so that I will know which operation the body contents belong to. I will return SOAP messages that include Strings in the body. These will also be encoded so that you know what to do with them.
Inside WSDL
WSDL standardizes XML elements that describe a collection of communication endpoints (also called as ports.) Each port is associated with a network address. Collectively ports of web services providers and web services consumers is called as network service.
WSDL defines a network service using seven XML elements WSDL Document
<definitions>: Root WSDL Element <type>: What data types will be transmitted? <message>: What messages will be transmitted? <operation>: What action will be supported? <portType>: What operations will be supported? <binding>: How will the messages be transmitted on the wire? <port>: Where is the service located? <service>: What other services are supported?
definitions
Must be the root element Define the name of the service Declare the namespaces used in the document Describe all the data type used by the Client and Server Can be omitted of only simple data types are used Define the name of the request/response messages Define also the message part elements Define the combination of message elements to form a complete one-way or round-trip operation
types
message
portType
10
binding
Provide specific details on how a portType operation will actually be transmitted over the wire SOAP specific information can be defined here. WSDL includes built-in extensions for defining SOAP services
service
11
<?xml version="1.0" encoding="UTF-8" ?> <wsdl:definitions > <wsdl:types > : </wsdl:types> Can be omitted if only simple data <wsdl:message > types, e.g. int, String are used : </wsdl:message> <wsdl:portType > : </wsdl:portType> <wsdl:binding > : </wsdl:binding> <wsdl:service > : A Sample WSDL file </wsdl:service> </wsdl:definitions>
12
WSDL Document
13
14
15
16
portType Element
17
18
19
20