Presentation is loading. Please wait.

Presentation is loading. Please wait.

WSDL-Web Service Description Language By Shin Chuan, Lin July / 8 /2003.

Similar presentations

Presentation on theme: "WSDL-Web Service Description Language By Shin Chuan, Lin July / 8 /2003."— Presentation transcript:

1 WSDL-Web Service Description Language By Shin Chuan, Lin July / 8 /2003

2 Topic Covered  Introduction  Structure of WSDL document  Example of WSDL  Difference between WSDL 1.2 and WSDL 1.1  How to use WSDL file ?  Reference

3 Introduction  What is WSDL ? Stands for Web Service Description Language It’s an XML document for describing web services Further considers that an interface represents the behavior of a resource on the World Wide Web  What can we know from WSDL ? What kind of message is exchanged ? How are the message related ?(e.q operation input or output) How SOAP messages are exchanged ?

4 What is WSDL ?

5 Structure of WSDL document  Type  Messages  interfaces(Port Types) WSDL1. 2  Bindings Protocol – html, smtp Encoding  Service “Interface” definition “endpoint” definition

6 Structure of WSDL document definition of types definition of message definition of interface definition of biding definition of endpoint

7 Structure of WSDL document :definitions  Definitions Component is just a container for two categories of component: (1)WSDL Component: messages, interface, binding and services (2)Type System Component: element declartions and type definitions drawn from some type system.  Definitions are represented in XML by one or more WSDL information Sets(Infosets). A WSDL InfoSet contains representations of a collection of WSDL components which share a common target namespace.

8 Structure of WSDL document :Types  The types element encloses data type definitions that are relevant for the exchanged messages. WSDL prefers the use of XML Schema.  FROM

9 An Example of WSDL Types Note: (1) Use element form (2) Array types should extend the Array type from SOAP v1.1 encoding schema (

10 Structure of WSDL document :Message  The message component describes the abstract format of a particular message that Web service sends or receives.  Combine with binding to describe how the abstract content is mapped into a concrete format.  From: …

11 An Example of WSDL Message What does this mean ? Int get_id(string firstname, int age)

12 An Example of WSDL Message name : local name of message part component : describes a portion of a particular message that a web service sends or receives. type : describe the format of a part element : carrier information about its type system

13 Structure of WSDL document :interface  The interface element is core WSDL element. It describes a set of messages that a service sends and/or receives, by grouping related messages into operations.  Operations include : One-way transmissionThe 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 correlated message. Notification The endpoint sends a messge

14 Structure of WSDL document :interface  Form:

15 Structure of WSDL document :interface(cont1) Operation : An interface operation component describes an operation that a given interface supports. An operation is a set of message references and an associated message pattern. Message references are references either to messages accepted by this operation(input message),or messages send by this operation(output messages). Such messages could be ordinary messages or fault messages. fault element specify the abstract message format for any error messages that may be output as the result of the operation

16 Structure of WSDL document :interface(cont2) {message pattern} A URI identifying the message pattern used by the operation. {message references}A set of message reference components for the ordinary messages the operation accepts or send. {fault references}A set of fault reference components for the fault messages the operation accepts or sends. {features} A set of named feature definitions used by the operation {properties} A set of named property definitions used by the operation.

17 Example of interface

18 Example of interface(cont1)

19 Structure of WSDL document :Bindings  A binding defines message format and protocol details for operations and messages defined by a particular interface.  WSDL (Version 1.2): Bindings [WSDL 1.2 Bindings] defines such bindings for SOAP 1.1 [SOAP 1.1], SOAP 1.2 [SOAP 1.2 Part 1: Messaging Framework], HTTP [IETF RFC 2616] and MIME [IETF RFC 2045]. Other specifications MAY define additional binding detailsWSDL 1.2 BindingsSOAP 1.1SOAP 1.2 Part 1: Messaging FrameworkIETF RFC 2616IETF RFC 2045

20 Structure of WSDL document :Bindings From Note : A binding MUST specify exactly one protocol

21 Example of binding

22 Structure of WSDL document :Service  A service component describes one and only one interface that a service provides, and the endpoints it is provided over.

23 Structure of WSDL document :Service Forms: ? *

24 Structure of WSDL document :Service  An endpoint component defines the particulars of a specific end-point at which a given service is available. The properties of the Endpoint Component are as follows:  {name} An NCName as defined by [XML Namespaces].XML Namespaces  {binding} A named binding component For each endpoint component in the {endpoints} property of a service component the {name} property must be unique.

25 Example of WSDL SOAP binding of one-way operation over SMTP using a SOAP Header

26 Example of WSDL SOAP binding of one-way operation over SMTP using a SOAP Header

27 Example of WSDL SOAP binding of one-way operation over SMTP using a SOAP Header

28 Example of WSDL SOAP binding of one-way operation over SMTP using a SOAP Header

29 Example of WSDL SOAP binding of one-way operation over SMTP using a SOAP Header

30 Example of WSDL SOAP binding of one-way operation over SMTP using a SOAP Header

31 What does it mean?  In the above example, a SubscribeToQuotes SOAP 1.1 one-way message is sent to a StockQuote service via a SMTP binding. The request takes a ticker symbol of type string, and includes a header defining the subscription URI.

32 Difference between WSDL1.2 and WSDL1.1  Operation Overloading WSDL 1.1 supported operation overloading and WSDL 1.2 removes it. This section will provide some rationale for it and provide hints on how to work around some scenarios.  PortTypes Port types have been renamed to interfaces. We now have interface inheritance.  Ports Ports have been renamed to endpoints.

33 Conclusion(How to use wsdl?)  EX: How to use Google API with WSDL ?  Google provide standard wsdl file   How to use wsdl file? Many programming languages now understand WSDL and can use this file to automatically invoke Google's API. For example, the WSDL can be imported into.NET, converted into Java code using Apache Axis WSDL2Java, or used directly by Perl SOAP::Lite. The WSDL file has been tested with SOAP::Lite 0.52, the.NET Framework, (via "Add Web Reference" or wsdl.exe version ), and Apache Axis Beta 1.

34 How to use wsdl? Use Google with Perl Example : use SOAP::Lite; my $key=' '; my $query="foo"; my $googleSearch = SOAP::Lite -> service("file:GoogleSearch.wsdl"); my $result = $googleSearch -> doGoogleSearch($key, $query, 0, 10, "false", "", "false", "", "latin1", "latin1"); print "About $result->{'estimatedTotalResultsCount'} results.\n";

35 How to use wsdl?  What is SOAP::Lite ?  SOAP::Lite makes the request for service description, parses it, builds the stub (object that make available the same methods as remote service) and returns it to you.

36 How to use wsdl? Example : #!perl -w use SOAP::Lite; my $service = SOAP::Lite -> service( ‘ print ‘ ReturnByMSFT + ReturnByORCL = ', $service->getQuote( ‘ ReturnByMSFT') + $service->getQuote( ‘ ReturnByORCL');

37 How to use wsdl?  You may also use your local computer with multiple wsdl file..  Example : #!perl -w use SOAP::Lite service => ’ ', #service=>'file:/your/local/path/GoogleLocal.wsdl ‘file:/your/local/path/GoogleLocal.wsdl, # service => 'file:./yourOwnService.wsdl', ;file:./yourOwnService.wsdl print getQuote( ‘ RetrunByMSFT'), "\n"; More Detail please check :

38 References Web Services Description Language (WSDL) 1.1 W3C Note 15 March 2001 : [ ] Web Services Description Language (WSDL) Version 1.2 Part 1: Core Language W3C Working Draft 11 June 2003 [ ] Web service : [] WSDL overview: [] Web Service Web Service Description Language [ MariuszChechelski_slides.pdf ] SOAP::Lite for Perl [ ] Google API package readme.txt []

Download ppt "WSDL-Web Service Description Language By Shin Chuan, Lin July / 8 /2003."

Similar presentations

Ads by Google