Anda di halaman 1dari 21

Introduction to WSDL

presented by Xiang Fu
Source
WSDL 1.1 specification
http://www.w3.org/TR/wsdl
WSDL 1.2 working draft
http://www.w3.org/TR/wsdl12/
W3C School Tutorial
http://www.w3schools.com/wsdl/wsdl_intro.asp
What is WSDL
Web Service Description Language.
An XML language used to describe and locate
web services.
Written in XML.
Describe functionality of a web service
Specify how to access the service (binding protocol,
message format, and etc.)
Not a W3C standard yet.
Version 1.1 released March 2001
Working draft of Version 1.2 released July 2003

Related Standards
Type System: XML Schema
Name space: XML namespaces
Binding: SOAP, HTTP, MIME and etc.
The Main Structure of WSDL
<definition namespace = http/ >
<type> xschema types </type>
<message> </message>
<port> a set of operations </port>
<binding> communication protocols </binding>
<service> a list of binding and ports </service>
<definition>
Types
<types> define types used in message
declaration
XML Schema, DTD, and etc.
XML Schema must be supported by any
vendor of WSDL conformant products.
<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
minOccur = 1 maxOccur=10/>
<element name = payment>
<complexType> <choice>
<element name = account type=string>
<element name = creditcard type=string>
</choice> </complexType>
</element>
</all>
</complexType>
</element>
</schema>
</types>
WSDL Messages
The <message> element defines the
data elements of an operation.
Each messages can consist of one or more
parts. The parts can be compared to the
parameters of a function call in a
traditional programming language.

<message name="GetLastTradePriceInput">
<part name="body" element="TradePriceRequest"/>
</message>

<message name="GetLastTradePriceOutput">
<part name="body" element="TradePrice"/>
</message>
WSDL Ports
The <portType> element is the most important
WSDL element.
It defines a web service, the operations that
can be performed, and the messages that are
involved.
The <port> defines the connection point to a
web service, an instance of <portType>.
It can be compared to a function library (or a
module, or a class) in a traditional programming
language. Each operation can be compared to a
function in a traditional programming language.
<portType name="StockQuotePortType">
<operation name="GetLastTradePrice">
<input message="tns:GetLastTradePriceInput"/>
<output message="tns:GetLastTradePriceOutput"/>
</operation>
</portType>
Operation Types
The request-response type is the most
common operation type, but WSDL defines
four types:
One-way: The operation can receive a message but
will not return a response
Request-response:The operation can receive a
request and will return a response
Solicit-response:The operation can send a request
and will wait for a response
Notification:The operation can send a message but
will not wait for a response
-- v 1.2 addition
request multiple response
One way and Notification
Example
<portType name=RegisterPort">
<operation name=register">
<input name=customerInfo" message=RegInfo"/>
</operation>

<operation name = register Response>
<output name = response message=ResponseInfo/>
</operation>
</portType >
Binding
Binding defines how message are
transmitted, and the location of the
service.
<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>
<service name="StockQuoteService">
<documentation>My first service</documentation>
<port name="StockQuotePort" binding="tns:StockQuoteBinding">
<soap:address location="http://example.com/stockquote"/>
</port>
</service>
WSDL and UDDI
Description of web service.
Discovery of web service?
UDDI yellow page.
What is UDDI
UDDI is a platform-independent framework for
describing services, discovering businesses, and
integrating business services by using the
Internet.
UDDI stands for Universal Description, Discovery
and Integration
UDDI is a directory for storing information about
web services
UDDI is a directory of web service interfaces
described by WSDL
How can UDDI be Used
If the industry published an UDDI
standard for flight rate checking and
reservation, airlines could register their
services into an UDDI directory.
Travel agencies could then search the
UDDI directory to find the airline's
reservation interface.
When the interface is found, the travel
agency can communicate with the service
immediately because it uses a well-
defined reservation interface. (by WSDL)
Whats missing?
Quality of service. (how fast, how reliable?)
Smart Searching (currently business code match)
DAML-S project.
DARPA Agent Markup Language for web Services.
Describes control flow
Quality of service.
Support smart discovery of service
Ontology based technology.
A big dictionary defining the relations between concepts.
e.g. vehicle car truck
Problems
Complex long running web services.
Communication infrastructure
Asynchronous communication
Analysis and verification
Automatic composition of complex
services.

Anda mungkin juga menyukai