wsdl web services description language
DESCRIPTION
WSDL Web Services Description Language. Presented By: -Maitreya Natu. Outline. Introduction Document Structure Examining WSDL Web Services, Grids, Agents and WSDL References. What?. Describes the technical details of how a Web Service works - PowerPoint PPT PresentationTRANSCRIPT
Outline
Introduction Document Structure Examining WSDL Web Services, Grids, Agents and WSDL References
What? Describes the technical details of how a Web Service works WSDL is a simple XML grammar for describing how to
communicate with a Web service It defines the messages (both abstract and concrete) that are
sent to and from a service It defines logical collections of messages (“port type”, “interface”) It defines how a given “port type” is bound to particular wire
protocols It defines where the service is located
Enables one to separate the description of abstract functionality offered by a service from concrete details.
Who?
WSDL 1.1 specification exists as a W3C Note, co-submitted by representatives of Microsoft and IBM
Why?
Classic IDL Model Almost all distributed systems have a language for describing
interfaces IDL in DCE and CORBA MIDL in COM and DCOM
Definitions are processed by an IDL compiler to generate stubs for clients which look like local function calls Dispatch routines for the server that invoke the developer’s
code WSDL acts as an IDL for Web Services distributed programming
model defines the communication protocol, the data transfer syntax and
location of the endpoint
How?
Developers use tool kits capable of reading and writing WSDL
Perl SOAP::Lite Constructs a local stub of a remote service object using WSDL
document as its template Programmer requests the local stub which silently
communicates with remote server SOAP::Lite -> service (
http://api.google.com/GoogleSearch.wsdl) -> do GoogleSearch(@parameters);
Microsoft’s .Net Web Services provides tools for consuming and producing WSDL documents wsdl.exe, creates a proxy class from a WSDL description
When?
WSDL 1.1, published as a W3C Note in March 2001
WSDL 1.2, published as W3C Working Draft in June 2003
Opinion
Principal advantage Wide acceptance as a fundamental component of
Web services Principal Disadvantage
Separates documentation from service Additional work to discover technical
specifications Stale WSDL files!
SOAP and WSDL
SOAP is a standard for communicating pure content. It needs a language to describe the content
SOAP messages carry type information It needs information about the service name, number of
parameters and types
WSDL automates the generation of client stubs for web services in a truly language and platform independent way
Document Structure
Abstract Section
Concrete Section
•Defines SOAP messages in a platform and language independent manner•Helps define set of services that several websites can implement
Site specific matters like serialization, bindings etc.
Document Structure
Types
Messages
Operations
Port Type
Bindings
Port
Service
Machine and language independent type definitions
Abstract typed definition of data communicated (function parameters)
Abstract description of supported action
Abstract set of operations supported
Document Structure
Types
Messages
Operations
Port Type
Bindings
Port
Service
A concrete protocol and data formatSpecification of a port type
A single endpoint defined as a combination of binding and networkaddress
A collection of related endpoints
Document Structure
<definitions><types>
Definition of types… …</types><message>
Definition of a message… …</message><portType>
<operation> <input message/> <output message/> </operation></portType><binding portType=“…”>
<operation> <input message/> <output message/> </operation></binding><service>
<port binding= “...”> Network Address… … </port></service>
</definitions>
Definitions
<definitions><types>
Definition of types… …</types><message>
Definition of a message… …</message><portType>
<operation> <input message/> <output message/> </operation></portType><binding portType=“…”>
<operation> <input message/> <output message/> </operation></binding><service>
<port binding= “...”> Network Address… … </port></service>
</definitions>
• Declares that document is XML• Defines the root element in the WSDL document <definitions>• Namespace declarations
Definitions
<?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://scemas.xmlsoap.org/wsdl/soap/”xmlns=“http://schemas.xmlsoap.org/wsdl/”>
:::::
</definitions>• Declares that document is XML • Defines the root element in the WSDL document <definitions>• Namespace declarations
What are Namespaces for?
To avoid naming conflicts 2 services can use the same name only if they mean exactly
the same thing in both instances With 2 distinct namespaces, one web service “add” can
mean a different thing than other web service “add” Namespace attribute declares a shorthand for each
namespace used in the document http://www.infotects.com/addService#add ~ carlos:add If carlos is declared as a shorthand for
http://www.infotects.com/addService Location pointed by URI does not have to be a real web
location, they are use to guarantee uniqueness A GUID can be used instead “335DB901-D44A-11D4-A96E-0080AD76435D” is a valid
namespace designator
Types
<definitions><types>
Definition of types… …</types><message>
Definition of a message… …</message><portType>
<operation> <input message/> <output message/> </operation></portType><binding portType=“…”>
<operation> <input message/> <output message/> </operation></binding><service>
<port binding= “...”> Network Address… … </port></service>
</definitions>
• Declares the application specific data types• XML Schema allows for definition of complex data types which are equivalent to C structs
Types
<types> <schema targetNameSpace=“http://example.com/stockquote.wsdl”
xmlns=“http://www.w3.or/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>
• Declares the application specific data types• XML Schema allows for definition of complex data types which are equivalent to C structs
Messages
<definitions><types>
Definition of types… …</types><message>
Definition of a message… …</message><portType>
<operation> <input message/> <output message/> </operation></portType><binding portType=“…”>
<operation> <input message/> <output message/> </operation></binding><service>
<port binding= “...”> Network Address… … </port></service>
</definitions>
• Abstract definition of the data being transmitted• Consists of logical parts, each of which is associated with a type definition within some type system
Messages
<message name=“GetLastTradePriceInput”> <part name=“body” element=“xsdl:TradePriceRequest”/><message>
<message name=“GetLastTradePriceOutput”> <part name=“body” element=“xsdl:TradePrice”/><message>
• Abstract definition of the data being transmitted• Consists of logical parts, each of which is associated with a type definition within some type system (here an XML schema defined in types section)
Messages
Message part
Type Definition
<definitions …> <types> <schema …>
<element name=“PO” type=“tns:POType”/> <complexType name=“POType”>
<element name=“id” type=“string”/> <element name=“name” type=“string”/> <element name=“items”> <complexType>
<all><element name=“item” type=“int”>
</all></complexType>
</element> </complexType>
</schema> </types>
<messages name=“PO”> <part name=“po” element=“tns:tns:PO”/>
</message><definitions>
Messages
Message part
Type Definition
<definitions …> <types> <schema …>
<element name=“PO” type=“tns:POType”/> <complexType name=“POType”>
<element name=“id” type=“string”/> <element name=“name” type=“string”/> <element name=“items”> <complexType>
<all><element name=“item” type=“int”>
</all></complexType>
</element> </complexType>
</schema> </types>
<messages name=“PurchaseOrder”> <part name=“pOrder” element=“tns:PO”/>
</message><definitions>
Port Type
<definitions><types>
Definition of types… …</types><message>
Definition of a message… …</message><portType>
<operation> <input message/> <output message/> </operation></portType><binding portType=“…”>
<operation> <input message/> <output message/> </operation></binding><service>
<port binding= “...”> Network Address… … </port></service>
</definitions>
• A set of abstract operations • Each operation declares the abstract messages involved
Port Type
<portType name=“StockQuotePortType”> <operation name=“GetLastTradePrice”>
<input message=“tns:GetLastTradePriceInput”/> <output message=“tns:GetLastTradePriceOutput”/>
</operation></portType>
• A set of abstract operations • Each operation declares
• The name of method• Parameters• Types of each parameter
Port Type
<types> <schema …> <element name=“TradePriceRequest”>… type=“string”…</element> <element name=“TradePrice”> … type=“float” …</element> </schema></types>
<message name=“GetLastTradePriceInput”> <part name=“body” element=“xsdl:TradePriceRequest”/><message>
<message name=“GetLastTradePriceOutput”> <part name=“body” element=“xsdl:TradePrice”/><message>
<portType name=“StockQuotePortType”> <operation name=“GetLastTradePrice”>
<input message=“tns:GetLastTradePriceInput”/> <output message=“tns:GetLastTradePriceOutput”/>
</operation></portType>
Types
Message
Operations &Port Type
float GetLastTradePrice (string TradePriceRequest)
Operations WSDL operations refer to 4 transmission primitives
that an endpoint can support One-way: The endpoint receives a message Request-response: The endpoint receives a message, and
sends a correlated message Solicit-response: The endpoint sends a message, and
receives a correlated message Notification: The endpoint sends a message
These primitives are abstractly defined; a given binding describes the concrete correlation information
Operations: one way operation
<portType …> <operation …>
<input name=“…” message=“…”/> </operation></portType>
Operations: Request-response operation
<portType …> <operation …>
<input name=“…” message=“…”/> <output name=“…” message=“…”/> <fault name=“…” message=“…”/>
</operation></portType>
Operations: Solicit-response operation
<portType …> <operation …>
<output name=“…” message=“…”/> <input name=“…” message=“…”/> <fault name=“…” message=“…”/>
</operation></portType>
Operations: Notification operation
<portType …> <operation …>
<output name=“…” message=“…”/></operation>
</portType>
Bindings
<definitions><types>
Definition of types… …</types><message>
Definition of a message… …</message><portType>
<operation> <input message/> <output message/> </operation></portType><binding portType=“…”>
<operation> <input message/> <output message/> </operation></binding><service>
<port binding= “...”> Network Address… … </port></service>
</definitions>
• defines a concrete protocol and data format specification for a particular port type• specifies how each operation call and response is sent on the wire (protocol, serialization and encoding)
Bindings
<binding name=“StockQuoteSoapBinding” type=“tns:StockQuotePortType”> <stk:binding preferredEncoding=“UTF-8” /> <soap:binding style=“rpc” transport=“http://schemas.xmlsoap.org/soap/http/”> <operation name=“GetLastTradePrice”>
<soap:operation soapAction = “http://example.com/GetLastTradePrice”/>
<input> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</input> <output> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</output> </operation></binding>
Bindings
<binding name=“StockQuoteSoapBinding” type=“tns:StockQuotePortType”> <stk:binding preferredEncoding=“UTF-8” /> <soap:binding style=“rpc” transport=“http://schemas.xmlsoap.org/soap/http/”> <operation name=“GetLastTradePrice”>
<soap:operation soapAction = “http://example.com/GetLastTradePrice”/>
<input> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</input> <output> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</output> </operation></binding>
• name: referred by ‘Port’ element in ‘Services’ section
•type: refers to port Type
Bindings
<binding name=“StockQuoteSoapBinding” type=“tns:StockQuotePortType”> <stk:binding preferredEncoding=“UTF-8” /> <soap:binding style=“rpc” transport=“http://schemas.xmlsoap.org/soap/http/”> <operation name=“GetLastTradePrice”>
<soap:operation soapAction = “http://example.com/GetLastTradePrice”/>
<input> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</input> <output> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</output> </operation></binding>
• style: (rpc or document)• transport: specifies the underlying protocol (here HTTP SOAP)
• MSTK2 extension element, sepcifies preferred encoding as “UTF-8”
Bindings
<binding name=“StockQuoteSoapBinding” type=“tns:StockQuotePortType”> <stk:binding preferredEncoding=“UTF-8” /> <soap:binding style=“rpc” transport=“http://schemas.xmlsoap.org/soap/http/”> <operation name=“GetLastTradePrice”>
<soap:operation soapAction = “http://example.com/GetLastTradePrice”/>
<input> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</input> <output> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</output> </operation></binding>
• corresponds to elements in PortTypes section
Bindings
<binding name=“StockQuoteSoapBinding” type=“tns:StockQuotePortType”> <stk:binding preferredEncoding=“UTF-8” /> <soap:binding style=“rpc” transport=“http://schemas.xmlsoap.org/soap/http/”> <operation name=“GetLastTradePrice”>
<soap:operation soapAction = “http://example.com/GetLastTradePrice”/>
<input> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</input> <output> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</output> </operation></binding>
• SOAP specific URI: gets used in SOAP message in SOAP Action header verbatim• Used for HTTP binding to identify the intent of the message
Bindings
<binding name=“StockQuoteSoapBinding” type=“tns:StockQuotePortType”> <stk:binding preferredEncoding=“UTF-8” /> <soap:binding style=“rpc” transport=“http://schemas.xmlsoap.org/soap/http/”> <operation name=“GetLastTradePrice”>
<soap:operation soapAction = “http://example.com/GetLastTradePrice”/>
<input> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</input> <output> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</output> </operation></binding>
• Specifies what gets into the body of the resulting SOAP message
Bindings
<binding name=“StockQuoteSoapBinding” type=“tns:StockQuotePortType”> <stk:binding preferredEncoding=“UTF-8” /> <soap:binding style=“rpc” transport=“http://schemas.xmlsoap.org/soap/http/”> <operation name=“GetLastTradePrice”>
<soap:operation soapAction = “http://example.com/GetLastTradePrice”/>
<input> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</input> <output> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</output> </operation></binding>
• Specifies whether the data is “encoded” or “literal”
Bindings
<binding name=“StockQuoteSoapBinding” type=“tns:StockQuotePortType”> <stk:binding preferredEncoding=“UTF-8” /> <soap:binding style=“rpc” transport=“http://schemas.xmlsoap.org/soap/http/”> <operation name=“GetLastTradePrice”>
<soap:operation soapAction = “http://example.com/GetLastTradePrice”/>
<input> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</input> <output> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</output> </operation></binding>
• prevents name clashing• this URI is used verbatim in the resulting SOAP message
Bindings
<binding name=“StockQuoteSoapBinding” type=“tns:StockQuotePortType”> <stk:binding preferredEncoding=“UTF-8” /> <soap:binding style=“rpc” transport=“http://schemas.xmlsoap.org/soap/http/”> <operation name=“GetLastTradePrice”>
<soap:operation soapAction = “http://example.com/GetLastTradePrice”/>
<input> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</input> <output> <soap:body use=“encoded”
namespace=“http://tempuri.org/message/” encodingStyle=“http://schemas.xmlsoap.org/soap/encoding/” />
</output> </operation></binding>
• determines the encoding style if use=“encoded”• For SOAP encoding, this should have the URI value of “http://schemas.xmlsoap.org/soap/encoding/”
Ports & Services
<definitions><types>
Definition of types… …</types><message>
Definition of a message… …</message><portType>
<operation> <input message/> <output message/> </operation></portType><binding portType=“…”>
<operation> <input message/> <output message/> </operation></binding><service>
<port binding= “...”> Network Address… … </port></service>
</definitions>
• Port: defines an individual endpoint by specifying a single address for a binding• Service: groups a set of related ports together
Ports
<service name=“StockQuoteService”>> <documentation> My First service </documentation> <port name=“StockQuotePort” binding=“tns:StockQuoteBinding”>
<soap:address location=“http://example.com/stockquote”/> </port></service>
• Ports: associates a location with a binding in a one to one fashion
Ports
<service name=“StockQuoteService”>> <documentation> My First service </documentation> <port name=“StockQuotePort” binding=“tns:StockQuoteBinding”>
<soap:address location=“http://example.com/stockquote”/> </port></service>
URL associated with the binding
Binding name as defined in Bindings section
Port Name (to differentiate among multiple ports)
Services
<service name=“StockQuoteService”>> <documentation> My First service </documentation> <port name=“StockQuotePort” binding=“tns:StockQuoteBinding”>
<soap:address location=“http://example.com/stockquote”/> </port></service> •None of the ports communicate with each other
•several ports can use same port type but employ different bindings or addresses
• There can be more than one service elements• Ports can be grouped in a service
• according to URL• according to protocol
Major Changes in WSDL V 1.2
Port Type is called Interface Interface Inheritance feature is added Better definition of HTTP 1.1 and SOAP 1.2
binding Describes how to use WSDL with SOAP,
HTTP and MIME
Examining WSDL
Verbosity WSDL First Too much flexibility adds overhead Get rid of difference between document and
RPC Binding style Get rid of difference between Literal and
Encoded Binding style Why 4 ways to define bindings?
Grids and WSDL
OGSA designed for both persistent and transient services together.
This will be achieved through Development of WSDL conventions Standard WSDL interfaces Behaviors of core services MatchMaker protocol to link services
Agents and WSDL
Agent ontology is defined using XML schema components
Behavior as a WSDL interface Performatives as operations with request response
messages Reference to external framework by Bindings
between abstract definition and implementation Agent Service logically as Endpoint with a physical
location and port
SOAP/WSDL vs ACLs
ASK, REPLY and TELL: 4 WSDL types of messages
ACL Content: Message Tags SENDER: defined in WSDL message as Service ERROR and SORRY: WSDL Fault Tag Ontology : XML Schema Agent Management Systems : SOAP for Transport Sophisticated message transport services: ??? Services requiring Negotiation: ???
Upcoming plans Web Services: Standardized enterprise components offered
across the Web Grid Services: scientific/ computing resources that facilitate
large-scale scientific research Multi-Agent systems: heterogeneous agents that cooperate or
compete to solve distributed AI problems Key research challenges are:
Support automated interoperability without human intervention Semantic Web Services: to make services accessible and
understandable Emerging ontologies (DAML-S): to construct semantically rich
service description
References W3C Note on WSDL 1.1 W3C Working Draft on WSDL 1.2 WSDL Explained
-Carlos C. Tapang Examining WSDL
-Rich Salz WSDL Gets a Close Look
-Darryl K. Taft All we Want for Christmas is a WSDL Working Group
-Martin Gudgin, Timothy Ewald Emerging Technology Briefs: WSDL
-Rael Dornfest, Clay Shirky WSDL First
-Will Provost Agents of the Grid: A Comparison with web Servies
-A. Avila-Rosas, UK International semantic Web conference, 2002, Italy