The document provides an overview of the Web Service Description Language (WSDL) which is an XML format for describing network services. It describes the key components of a WSDL document including the types, messages, portTypes, bindings and services sections. It also provides an example WSDL document and demonstrates how to create a web service and its corresponding WSDL.
11
WSDL: Web ServiceWSDL:Web Service
Description LanguageDescription Language
Gary SharpGary Sharp
Mike BreakironMike Breakiron
2.
2
OutlineOutline
What and whyWhatand why
WSDL document structureWSDL document structure
Sections and elementsSections and elements
– types, messages, portTypes, bindings, and servicestypes, messages, portTypes, bindings, and services
NamespacesNamespaces
Demo1 – create a web service and its WSDLDemo1 – create a web service and its WSDL
documentdocument
Demo2 – XMethods WSDL interpretationDemo2 – XMethods WSDL interpretation
WSDL referencesWSDL references
3.
3
What is WSDL?Whatis WSDL?
Web Service Description LanguageWeb Service Description Language
WSDL is a document written in XMLWSDL is a document written in XML
The document describes a Web serviceThe document describes a Web service
Specifies the location of the service andSpecifies the location of the service and
the methods the service exposesthe methods the service exposes
4.
4
Why WSDL?Why WSDL?
WithoutWSDL, calling syntax must beWithout WSDL, calling syntax must be
determined from documentation that mustdetermined from documentation that must
be provided, or from examining wirebe provided, or from examining wire
messagesmessages
With WSDL, the generation of proxies forWith WSDL, the generation of proxies for
Web services is automated in a trulyWeb services is automated in a truly
language- and platform-independent waylanguage- and platform-independent way
5.
5
Where does WSDLfit?Where does WSDL fit?
SOAP is the envelope containing theSOAP is the envelope containing the
messagemessage
WSDL describes the serviceWSDL describes the service
UDDI is a listing of web services describedUDDI is a listing of web services described
by WSDLby WSDL
6.
6
Document StructureDocument Structure
Writtenin XMLWritten in XML
Two types of sectionsTwo types of sections
– Abstract and ConcreteAbstract and Concrete
AbstractAbstract sections define SOAP messagessections define SOAP messages
in a platform- and language-independentin a platform- and language-independent
mannermanner
Site-specific matters such as serializationSite-specific matters such as serialization
are relegated to theare relegated to the ConcreteConcrete sectionssections
7.
7
Abstract DefinitionsAbstract Definitions
Types:Types:Machine- and language-Machine- and language-
independent type definitions.independent type definitions.
Messages:Messages: Contains function parametersContains function parameters
(inputs are separate from outputs) or(inputs are separate from outputs) or
document descriptions.document descriptions.
PortTypes:PortTypes: Refers to message definitionsRefers to message definitions
in Messages section that describe functionin Messages section that describe function
signatures (operation name, inputsignatures (operation name, input
parameters, output parameters).parameters, output parameters).
8.
8
Concrete DescriptionsConcrete Descriptions
Bindings:Bindings:Specifies binding(s) of eachSpecifies binding(s) of each
operation in the PortTypes section.operation in the PortTypes section.
Services:Services: Specifies port address(es) ofSpecifies port address(es) of
each binding.each binding.
9.
9
OperationOperation
AnAn operationoperation issimilar to a function in ais similar to a function in a
high level programming languagehigh level programming language
A message exchange is also referred toA message exchange is also referred to
as an operationas an operation
Operations are the focal point ofOperations are the focal point of
interacting with the serviceinteracting with the service
11
An ExampleAn Example
<?xmlversion="1.0" encoding="UTF-8" ?><?xml version="1.0" encoding="UTF-8" ?>
This first line declares the document as anThis first line declares the document as an
XML document.XML document.
Not required, but helps the XML parserNot required, but helps the XML parser
determine whether to parse the file ordetermine whether to parse the file or
signal an errorsignal an error
12.
12
Types SectionTypes Section
TheThetypetype element defines the data typeselement defines the data types
that are used by the web service.that are used by the web service.
<xsd:complexType name="PERSON"><xsd:complexType name="PERSON">
<xsd:sequence><xsd:sequence>
<xsd:element name="firstName“ type="xsd:string"/><xsd:element name="firstName“ type="xsd:string"/>
<xsd:element name="lastName" type="xsd:string"/><xsd:element name="lastName" type="xsd:string"/>
<xsd:element name="ageInYears" type="xsd:int"/><xsd:element name="ageInYears" type="xsd:int"/>
</xsd:sequence></xsd:sequence>
</xsd:complexType></xsd:complexType>
13.
13
Messages SectionMessages Section
AAmessagemessage element defines parameterselement defines parameters
The name of an output message element endsThe name of an output message element ends
in "Response" by conventionin "Response" by convention
<message name="Simple.foo"><message name="Simple.foo">
<part name="arg" type="xsd:int"/><part name="arg" type="xsd:int"/>
</message></message>
<message name="Simple.fooResponse"><message name="Simple.fooResponse">
<part name="result" type="xsd:int"/><part name="result" type="xsd:int"/>
</message></message>
14.
14
PortTypes SectionPortTypes Section
Definesa web service, the operations that can beDefines a web service, the operations that can be
performed, and the messages that are involved.performed, and the messages that are involved.
<portType name="SimplePortType"><portType name="SimplePortType">
<operation name="foo" parameterOrder="arg" ><operation name="foo" parameterOrder="arg" >
<input message="wsdlns:Simple.foo"/><input message="wsdlns:Simple.foo"/>
<outputmessage="wsdlns:Simple.fooResponse"/><outputmessage="wsdlns:Simple.fooResponse"/>
</operation></operation>
</portType></portType>
15.
15
Bindings SectionBindings Section
TheThebindingbinding element defines the messageelement defines the message
format and protocol details for each port.format and protocol details for each port.
<operation name="foo"><operation name="foo">
<soap:operation soapAction="http://tempuri.org/action/Simple.foo"/><soap:operation soapAction="http://tempuri.org/action/Simple.foo"/>
<input><input>
<soap:body use="encoded"<soap:body use="encoded"
namespace="http://tempuri.org/message/"namespace="http://tempuri.org/message/"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</input></input>
<output><output>
<soap:body use="encoded“<soap:body use="encoded“
namespace="http://tempuri.org/message/“namespace="http://tempuri.org/message/“
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
</output></output>
</operation></operation>
16.
16
The Port ElementThePort Element
Each <port> element associates a locationEach <port> element associates a location
with a <binding> in a one-to-one fashionwith a <binding> in a one-to-one fashion
<port name="fooSamplePort"<port name="fooSamplePort"
binding="fooSampleBinding">binding="fooSampleBinding">
<soap:address<soap:address
location="http://carlos:8080/fooService/foo.asp"/>location="http://carlos:8080/fooService/foo.asp"/>
</port></port>
17.
17
Services SectionServices Section
Acollection of related endpoints, where anA collection of related endpoints, where an
endpoint is defined as a combination of aendpoint is defined as a combination of a
binding and an addressbinding and an address
<service name="FOOSAMPLEService"><service name="FOOSAMPLEService">
<port name="SimplePort“<port name="SimplePort“
binding="wsdlns:SimpleBinding">binding="wsdlns:SimpleBinding">
<soap:address<soap:address
location="http://carlos:8080/FooSample/location="http://carlos:8080/FooSample/
FooSample.asp"/>FooSample.asp"/>
</port></port>
</service></service>
18.
18
An ExampleAn Example
<messagename="Simple.foo"><message name="Simple.foo">
<part name="arg" type="xsd:int"/><part name="arg" type="xsd:int"/>
</message></message>
<message name="Simple.fooResponse"><message name="Simple.fooResponse">
<part name="result" type="xsd:int"/><part name="result" type="xsd:int"/>
</message></message>
<portType name="SimplePortType"><portType name="SimplePortType">
<operation name="foo" parameterOrder="arg" ><operation name="foo" parameterOrder="arg" >
<input message="wsdlns:Simple.foo"/><input message="wsdlns:Simple.foo"/>
<output message="wsdlns:Simple.fooResponse"/><output message="wsdlns:Simple.fooResponse"/>
</operation></operation>
</portType></portType>
The above describes what kind of C/C++ function call?The above describes what kind of C/C++ function call?
int foo(int arg);int foo(int arg);
19.
19
NamespacesNamespaces
The purpose ofnamespaces is to avoid namingThe purpose of namespaces is to avoid naming
conflicts.conflicts.
Imagine two complimentary web services,Imagine two complimentary web services,
named A and B, each with an element namednamed A and B, each with an element named
“foo”.“foo”.
Each instance of foo can be referenced as A:fooEach instance of foo can be referenced as A:foo
and B:fooand B:foo
Example: "xmlns:xsd" defines a shorthand (xsd)Example: "xmlns:xsd" defines a shorthand (xsd)
for the namespacefor the namespace
SeeSee http://www.w3.org/2001/XMLSchemahttp://www.w3.org/2001/XMLSchema..
20.
20
DemoDemo
Create a webservice and generate itsCreate a web service and generate its
WSDL documentWSDL document
22
WSDL References [Primary]WSDLReferences [Primary]
http://msdn.microsoft.com/library/default.asp?uhttp://msdn.microsoft.com/library/default.asp?u
-a good overview of WSDL-a good overview of WSDL
http://msdn.microsoft.com/library/default.ahttp://msdn.microsoft.com/library/default.a
sp?url=/library/en-sp?url=/library/en-
us/dnwebsrv/html/understandWSDL.aspus/dnwebsrv/html/understandWSDL.asp
-another good WSDL description-another good WSDL description