WSDL - PowerPoint PPT Presentation

1 / 16
About This Presentation
Title:

WSDL

Description:

When using SOAP, a soap:binding sub-element is used to set the style and ... Transport defines the SOAP protocol to use (like HTTP) binding in Action ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 17
Provided by: cber88
Category:
Tags: wsdl | soap

less

Transcript and Presenter's Notes

Title: WSDL


1
WSDL
  • Charles Bernard

2
Roadmap
  • WSDL defined
  • High-level diagram and design
  • Individual primary elements w/examples
  • Final diagram
  • Small demonstration
  • Real-world examples

3
What is WSDL?
  • In brief
  • It stands for Web Services Description Language
  • It is written in XML
  • It is an XML document
  • It is used to describe Web services
  • It is used to locate Web services
  • WDSL helps a client locate a web service and
    invoke any of its publicly available functions
  • Client program connecting to a web service can
    read the WSDL to determine what functions are
    available on the server
  • Current version is 2.0 W3C recommended
  • Version 1.1 is not endorsed by the W3C

4
Where does it fit in?
5
How does it describe Web Services?
  • WSDL uses four major XML elements in its
    description
  • ltportTypegt
  • ltmessagegt
  • ltbindinggt
  • lttypesgt
  • A WSDL document can also contain other elements
  • Extension elements
  • Service elements - make it possible to group
    together the definitions of several web services
    in one single WSDL document

6
What does a WSDL look like?
  • ltdefinitionsgt
  • ltportTypegt
  • lt/portTypegt
  • ltmessagegt
  • lt/messagegt
  • lttypesgt
  • lt/typesgt
  • ltbindinggt
  • lt/bindinggt
  • lt/definitionsgt

7
ltportTypegt Element
  • This is probably the most important element
  • Describes the web service
  • Operations that can be performed
  • Messages that are involved
  • Comparable to a function/method library in a
    programming language
  • A port is defined by associating a network
    address with a reusable binding
  • Types of operations
  • One-way
  • Can receive a message, but will not return a
    message
  • Example use receiving request to insert a new
    value in a database
  • Request-response
  • Can receive a request and will return a response
  • Example use receiving a request for a value from
    a database and sending it back in a response
  • Solicit-response
  • Can send a request and will wait for a response
  • Example use requesting a value from a database
    and having it sent back in the response
  • Notification
  • Can send a message, but will not wait for a
    response
  • Example use inserting a new value in a database

8
ltmessagegt Element
  • Defines the data elements of an operation
  • Each message can have one or more parts
  • Each part is comparable to a function/method call
    in a programming language

9
ltportTypegt and ltmessagegt in Action
  • ltportType name"glossaryTerms"gt
  • ltoperation name"setTerm"gt
  • ltinput name"newTerm" message"newTermValues"/gt
  • lt/operationgt
  • lt/portType gt
  • ltmessage name"newTermValues"gt
  • ltpart name"term" type"xsstring"/gt
  • ltpart name"value" type"xsstring"/gt
  • lt/messagegt

Defines a one-way operation setTerm
10
More Examples
  • ltportType name"glossaryTerms"gtltoperation
    name"getTerm"gt ltinput message"getTermRequest"/gt
    ltoutput message"getTermResponse"/gtlt/operationgt
  • lt/portTypegt
  • ltmessage name"getTermRequest"gt
  • ltpart name"term" type"xsstring"/gt
  • lt/messagegt
  • ltmessage name"getTermResponse"gt
  • ltpart name"value" type"xsstring"/gt
  • lt/messagegt

Lists operations that can be performed
Defines parts of each message and data types
11
ltbindinggt Element
  • Defines the message format and protocol details
    for each port
  • Has two attributes
  • Name Can be set to any value, which represents
    the name of the binding
  • Type Points to the port for the binding
  • When using SOAP, a ltsoapbindinggt sub-element is
    used to set the style and transport values with
    elements
  • Style with value of either rpc or document
  • Transport defines the SOAP protocol to use
  • (like HTTP)

12
ltbindinggt in Action
  • ltbinding type"glossaryTerms" name"b1"gt
  • ltsoapbinding style"document"
    transport"http//schemas.xmlsoap.org/soap/http"
    /gt
  • ltoperationgt
  • ltsoapoperation soapAction"http//exampl
    e.com/getTerm"/gt
  • ltinputgt
  • ltsoapbody use"literal"/gt
  • lt/inputgt
  • ltoutputgt
  • ltsoapbody use"literal"/gt
  • lt/outputgt
  • lt/operationgt
  • lt/bindinggt
  • ltportType name"glossaryTerms"gtltoperation
    name"getTerm"gtltinput message"getTermRequest"/gt
    ltoutput message"getTermResponse"/gtlt/operationgt
  • lt/portTypegt
  • ltmessage name"getTermRequest"gt
  • ltpart name"term" type"xsstring"/gt
  • lt/messagegt
  • ltmessage name"getTermResponse"gt

Encoding technique
13
lttypesgt and ltservicegt Elements
  • lttypesgt
  • Defines the data types that are used by the web
    service
  • XML Schema syntax is used to define data types
  • ltservicegt
  • Provides a physical address at which the service
    can be accessed
  • ltportgt - sub-element of service that contains the
    location information
  • ltservice nameGlossaryTermsService"gt
  • ltport nameGlossaryTermsSoapHttpPort"
    binding"tnsGlossaryTermsSoapBinding"gt
  • ltsoapaddress location"http//localhost
    8080/webservice/GlossaryTermsService"/gt
  • lt/portgt
  • lt/servicegt

14
Final Overview
Web Services Platform
Enterprise System
WSDL
ServiceDeployment
XML Schema Library
Book.xsd
types
binding
operation
Java Method
15
Demo
  • Small Demonstration
  • Travel Reservation Service in NetBeans 6.0
  • Real-world Examples
  • Google Search
  • http//api.google.com/GoogleSearch.wsdl
  • Amazon Search
  • http//soap.amazon.com/schemas2/AmazonWebServices.
    wsdl

16
References
  • W3Schools WSDL - http//www.w3schools.com/wsdl/def
    ault.asp
  • Vijay Gehlot CSC 9010 Introduction Slide-set
  • Hansen, Mark D. SOA Using Java Web Services.
    Prentice HallUpper Saddle River, NJ. 2007.
Write a Comment
User Comments (0)
About PowerShow.com