Download presentation
Presentation is loading. Please wait.
Published byDouglas Bell Modified over 9 years ago
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 ( http://schemas.xmlsoap.org/soap/encoding)
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: <operation name =“xs:NCNAME” pattern=“xs:anyURI” ? [ | | [ | | | ]+ ]*
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 <operation name="listFlights “ parameterOrder="depart origin destination"> <input message= "tns:listFlightsRequest" name= "listFlightsRequest"/> <output message= "tns:listFlightsResponse “ name= "listFlightsResponse"/>
18
Example of interface(cont1) <operation name = "reserveFlight “ parameterOrder= "depart origin destination flight"> <input message= "tns:reserveFlightRequest “ name= "reserveFlightRequest"/> <output message= "tns:reserveFlightResponse “ name="reserveFlightResponse"/>
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 <soap:binding style=“document” Transport=http://schemas.xmlsoap.org/soap/http/>http://schemas.xmlsoap.org/soap/http <soap:operation soapAction =“http://example.com/get_id”>
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: <service name= "xs:NCName" interface="xs:QName" targetResource="xs:anyURI"? > ? *
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 <definitions name="StockQuote “ targetNamespace=http://example.com/stockquote.w sdlhttp://example.com/stockquote.w sdl xmlns:tns=http://example.com/stockquote.wsdlhttp://example.com/stockquote.wsdl xmlns:xsd1=http://example.com/stockquote.xsdhttp://example.com/stockquote.xsd xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/http://schemas.xmlsoap.org/wsdl/soap/ xmlns="http://schemas.xmlsoap.org/wsdl/">
26
Example of WSDL SOAP binding of one-way operation over SMTP using a SOAP Header <part name="body “ element="xsd1:SubscribeToQuotes"/> <part name="subscribeheader “ element="xsd1:SubscriptionHeader"/>
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 <binding name="StockQuoteSoap “ type="tns:StockQuoteInterface"> <soap:binding style="document “ transport="http://example.com/smtp"/> <soap:header message="tns:SubscribeToQuotes “ part="subscribeheader" use="literal"/>
29
Example of WSDL SOAP binding of one-way operation over SMTP using a SOAP Header <endpoints name="StockQuoteEndpoint “ binding="tns:StockQuoteSoap">
30
Example of WSDL SOAP binding of one-way operation over SMTP using a SOAP Header <schema targetNamespace=http://example.com/stockquote.xsdhttp://example.com/stockquote.xsd xmlns="http://www.w3.org/2000/10/XMLSchema">
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 http://api.google.com/GoogleSearch.wsdl http://api.google.com/GoogleSearch.wsdl 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 1.0.3705.0), and Apache Axis Beta 1.
34
How to use wsdl? Use Google with Perl Example : use SOAP::Lite; my $key='000000000000000000000000'; 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( ‘ http://api.google.com/GoogleSearch.wsdl'); 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 => ’ http://api.google.com/GoogleSearch.wsdl ', #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 : http://www.soaplite.com/
38
References Web Services Description Language (WSDL) 1.1 W3C Note 15 March 2001 : [http://www.w3.org/TR/2001/NOTE-wsdl-20010315 ]http://www.w3.org/TR/2001/NOTE-wsdl-20010315 Web Services Description Language (WSDL) Version 1.2 Part 1: Core Language W3C Working Draft 11 June 2003 [http://www.w3.org/TR/2003/WD-wsdl12-20030611 ]http://www.w3.org/TR/2003/WD-wsdl12-20030611 Web service : [http://ru.sun.com/win/developers/std02/presentations/ritter3.pdf] WSDL overview: [http://www.intl-interfaces.com/servicemodel/WSDLOverview1.pdf] Web Service Web Service Description Language [www.ti5.tu-harburg.de/Lecture/03ss/SEM/030505/ 030505MariuszChechelski_slides.pdf ] SOAP::Lite for Perl [ http://www.soaplite.com/ ] http://www.soaplite.com/ Google API package readme.txt [http://www.google.com/apis/download.html]
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.