WEB SERVICE DESCRIPTION LANGUAGE WSDL - PowerPoint PPT Presentation

1 / 30
About This Presentation
Title:

WEB SERVICE DESCRIPTION LANGUAGE WSDL

Description:

definitions name='DefinitionsName' targetNamespace='NamespaceURI' xmlns:prefix ... Specifies the name for the WSDL definition as a whole. ... – PowerPoint PPT presentation

Number of Views:207
Avg rating:3.0/5.0
Slides: 31
Provided by: olddominio
Learn more at: http://www.cs.odu.edu
Category:

less

Transcript and Presenter's Notes

Title: WEB SERVICE DESCRIPTION LANGUAGE WSDL


1
WEB SERVICE DESCRIPTION LANGUAGE( WSDL)
  • -SIVA SAGAR TELLA

2
Overview
  • What is WSDL?
  • Why WSDL?
  • Elements of WSDL.
  • Structure of WSDL file.
  • Different Elements of WSDL file.

3
What is WSDL ?
  • WSDL stands for Web Service Description Language.
  • WSDL is an XML document.
  • WSDL is used to describe Web services.
  • WSDL is also used to locate Web services.

4
Why WSDL?
  • Many Organizations provide web services over the
    network.
  • For a client to use a particular web service he
    has to know the format of the request to be sent
    and the format of the response that is returned.
  • Client can also know the address of the web
    service using WSDL.
  • WSDL is an XML format for describing network
    services as a set of endpoints operating on
    messages containing either document-oriented or
    procedure-oriented information.
  • The operations and messages are described
    abstractly, and then bound to a concrete network
    protocol and message format to define an
    endpoint.

5
Elements of WSDL File
  • ltdefinitionsgt
  • lttypesgt definition of types lt/typesgt
  • ltmessagegtdefinition of message lt/messagegt
  • ltportTypegt definition of a port lt/portTypegt
  • ltbindinggt definition of a binding lt/bindinggt
  • ltservicegt definition of a service lt/servicegt
  • lt/definitionsgt

6
Structure of WSDL file
  • The WSDL document can be divided into two groups
    of sections.
  • 1) Abstract Definition.
  • Platform and language
    independent elements are
    specified.
  • 2) Concrete Descriptions.
  • Platform and language
    dependent elements are
    specified
  • Abstract Definition group contains lttypesgt,
    ltmessagesgt and ltportTypegt elements.
  • Concrete Description group contains ltbindinggt and
  • ltservicegt elements.

7
Client Invoking a Web Service
8
With WSDL Terminology
9
ltdefinitionsgt Element
  • Root element of the WSDL document.
  • Contains all other elements definitions in the
    documents.
  • Sets the name of the WSDL document and declares
    the namespaces used in the document.

10
Outline of ltdefinitionsgt Element
  • ltdefinitions name"DefinitionsName"
    targetNamespace"NamespaceURI" xmlnsprefix"Names
    paceURI" xmlnssoap"http//schemas.xmlsoap.org/ws
    dl/soap/" xmlnsxsdhttp//www.w3.org/2001/XMLSch
    ema
  • xmlns"http//schemas.xmlsoap.org/wsdl/"gt
  • lt!-- Content of the WSDL file --gt
  • lt/definitionsgt

11
Attributes of ltdefinitionsgt Element
  • targetNamespace
  • Specifies the name for the WSDL
    definition as a whole.
  • All the elements in the
    definitions element declare their
    names in the targetNamespace
  • Xmlns (Used to denote the default namespace)
  • states that attribute names without
    a namespace qualification are in the
    WSDL namespace.
  • Default Namespace is
    http//schemas.xmlsoap.org/wsdl
  • Xmlnsprefix
  • states the names beginning with the
    prefix prefix belongs to the namespace
    specified by this value.

12
lttypesgt Element
  • Contains schema definitions of the data types
    used in the messages that compose the service.
  • WSDL uses XML Schema syntax to define data types.
  • This element is optional if the service uses the
    primitive data types defined by XML Schema.

13
Example
  • lttypesgt
  • ltxsdschema targetNamespace
    "http//www.roguewave.com/webservices/examples/Wea
    therSummary.xsd"
  • ltxsdcomplexType name"WeatherSummary"gt
  • ltxsdelement maxOccurs"1" minOccurs"1"
    name"zipcode" nillable"true" type"xsdstring"/gt
  • ltxsdelement maxOccurs"1" minOccurs"1"
    name"windSpeed" nillable"true"
    type"xsdunsignedInt"/gt
  • ltxsdelement maxOccurs"1" minOccurs"1"
    name"sky" nillable"true" type"xsdstring"/gt
  • ltxsdelement maxOccurs"1" minOccurs"1"
    name"temp" nillable"true" type"xsdint"/gt
  • lt/xsdcomplexTypegt
  • lt/xsdschemagt
  • lt/typesgt

14
lttypegt Element Continued..
  • This types element contains a complete XML
    Schema. The schema defines a single complexType
    named WeatherSummary.
  • The WeatherSummary type contains a zipcode
    element of type xsdstring, a windSpeed element
    of type xsdunsignedInt, a sky element of type
    xsdstring, and a temp element of type xsdint.

15
ltmessagegt Element
  • Defines the content of a message that the service
    supports.
  • Each message holds one or more part elements.
  • A part reference a parameter in the message.
  • The parts can be compared to the parameters of a
    function call in a traditional programming
    language.

16
ltmessagegt Element Continued..
  • Sample of ltmessagegt element.
  • ltmessage name"MessageName"gt
  • ltpart name"PartName"
    type"TypeRef"/gt
  • lt/messagegt
  • Name Attribute
  • Specify the name of the message and
    name of part in the case of
    respective elements .
  • Other elements in the WSDL
    document use this name to refer to this
    message.

17
Example of a ltmessagegt
  • ltmessage name"getSummary"gt
  • ltpart name"zipcode" type"xsdstring"/gt
  • lt/messagegt
  • ltmessage name"getSummaryResponse"gt
  • ltpart name"return" typewsxWeatherSumma
    ry"/gt
  • lt/messagegt
  • The message named getSummary consists of a string
    named zipcode.
  • The message named getSummaryResponse consists of
    a WeatherSummary named return

18
ltportTypegt Element
  • A port type is a named set of abstract operations
    .
  • An operation is a set of messages.
  • The ltportTypegt element can be compared to a
    function library (or a module, or a class) in a
    traditional programming language.
  • Example
  • ltportType name"nmtoken"gt
  • ltoperation name"nmtoken" .... /gt
  • ltinput messageinput message name"/gt
  • ltoutput messageoutput message name"/gt
  • lt
  • lt/operationgt
  • lt/portTypegt

19
Example
  • ltmessage name"getTermRequest"gt
  • ltpart name"term" type"xsstring"/gt
  • lt/messagegt
  • ltmessage name"getTermResponse"gt
  • ltpart name"value" type"xsstring"/gt
  • lt/messagegt
  • ltportType name"glossaryTerms"gt ltoperation
    name"getTerm"gt ltinput
    message"getTermRequest"/gt ltoutput
    message"getTermResponse"/gt lt/operation
  • lt/portTypegt
  • Compared to traditional programming,
    glossaryTerms is a function library, "getTerm" is
    a function with "getTermRequest" as the input
    parameter and getTermResponse as the return
    parameter.

20
Types of Operations
  • 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.

21
One-Way
  • The outline for a one-way operation is
  • ltportType name"nmtoken"gt
  • ltoperation name"nmtoken" .... /gt
  • ltinput messagemessage name"/gt
  • lt/operationgt
  • lt/portTypegt
  • The input element specifies the abstract message
    format for the request operation.

22
Request-response Operation
  • The outline for a request-response operation is
  • ltportType name"nmtoken"gt
  • ltoperation name"nmtoken" ....
    /gt
  • ltinput messageinput message
    name"/gt
  • ltoutput messageoutput message
    name"/gt
  • ltfault message fault message
    name/gt
  • lt/operationgt
  • lt/portTypegt
  • The input element specifies the abstract message
    format for the request operation.
  • The output element specifies the abstract message
    format for the response operation.
  • The fault element specifies the message format
    for the error messages

23
Solicit-response Operation
  • The outline for a solicit-response operation is
  • ltportType name"nmtoken"gt
  • ltoperation name"nmtoken" .... /gt
  • ltoutput messageoutput message name"/gt
  • ltinput messageinput message name"/gt
  • ltfault message fault message name/gt
  • lt/operationgt
  • lt/portTypegt

24
Notification Operation
  • The outline for a notification operation is
  • ltportType name"nmtoken"gt
  • ltoperation name"nmtoken" .... /gt
  • ltoutput messageoutput message
    name"/gt
  • lt/operationgt
  • lt/portTypegt

25
ltbindinggt Element
  • A binding element describes a specific
    communication protocol for a portType element.
  • Each binding corresponds to a portType in the
    WSDL document.
  • The binding element describes the specific
    protocol for each message in each operation of
    the portType element.

26
ltbindinggt Element Continued
  • ltbinding name"nmtoken" type"qname"gt
  • lt-- extensibility element--gt
  • ltoperation name"nmtoken"gt
  • ltinput name"nmtoken"? gt
  • lt-- extensibility element--gt
  • lt/inputgt
  • ltoutput name"nmtoken"? gt
  • lt-- extensibility element--gt
  • ltoutputgt
  • ltfault name"nmtoken"gt
  • lt-- extensibility element--gt
  • ltfaultgt
  • lt/operationgt
  • lt/bindinggt

27
Extensibility Elements
  • ltsoapbindinggt
  • The soapbinding element specifies
    that the binding protocol is
    SOAP.
  • style attribute specifies
    whether the operation is RPC- oriented
    (messages containing parameters and return
    values) or document-oriented (message
    containing document).
  • ltsoapbodygt
  • The soapbody binding element provides
    information on how to assemble the
    different message parts.

28
ltservicegt Element
  • A service element describes a Web service as a
    collection of port elements.
  • A port element defines a specific network address
    for a binding.

29
ltservicegt Element Continued
  • Outline of Service Element
  • ltservice name"ServiceName"gt
  • ltport name"PortName"
    binding"BindingRef"gt
    ltsoapaddress location"URL"/gt
  • lt/portgt
  • lt/servicegt
  • Name attribute specifies a unique name for the
    service and port.
  • Binding attribute of ltportgt specifies the binding
    reference to which the network address is
    asscociated.
  • The network address of the ServiceName is
  • specified by the ltsoapaddressgt elementss
    location attribute.

30
References
  • Links
  • http//www.w3.org/TR/wsdl.html
  • http//msdn.microsoft.com/archive/default.asp
    ?url/archive/en-us/dnarxml/html/wsdlexplained.asp
  • http//www.systinet.com/doc/ssj60/primerj/pri
    merj.wsprimer.wsdl.htm
  • http//www.roguewave.com/support/docs/leif/le
    if/html/leifug/B-1.html
  • Books
  • Author Newcomer, Eric.
  • Title Understanding Web services
    XML, WSDL, SOAP, and UDDI / Eric Newcomer.
Write a Comment
User Comments (0)
About PowerShow.com