Presentation is loading. Please wait.

Presentation is loading. Please wait.

Web Services: WSDL. Kas ir WSDL? Pirms izmantot SOAP ar konkrēto servisu ir jāzina kādai jābūt SOAP ziņojuma struktūrai kuru protokolu izmantot (HTTP,

Similar presentations


Presentation on theme: "Web Services: WSDL. Kas ir WSDL? Pirms izmantot SOAP ar konkrēto servisu ir jāzina kādai jābūt SOAP ziņojuma struktūrai kuru protokolu izmantot (HTTP,"— Presentation transcript:

1 Web Services: WSDL

2 Kas ir WSDL? Pirms izmantot SOAP ar konkrēto servisu ir jāzina kādai jābūt SOAP ziņojuma struktūrai kuru protokolu izmantot (HTTP, SMTP u.c.) kāda ir web servisa Internet adrese WSDL (Web Services Description Language) ir XML tipa valoda, kas apraksta Web servisus un to kā tiem piekļūt WSDL 1.1 – 2001.gada 15.marts WSDL 2.0 – 2007.gada 26.jūnijs

3 Ko WSDL definē? WSDL describes four critical pieces of data Interface information describing all publicly available functions Data type information for all message requests and message responses Binding information about the transport protocol to be used Address information for locating the specified service WSDL represents a contract between the service requestor and the service provider

4 WSDL Code Generation WSDL is well suited for code generators, which can read a WSDL document and generate a programmatic interface for accessing a Web service

5 WSDL 1.1 Specification The full specification is divided into six major elements definitions types message portType binding service

6 The definitions Element Root element of all WSDL documents Defines the name of the web service Declares multiple namespaces used throughout the document Contains all other the service elements <definitions name="BookQuoteWS" targetNamespace="http://www.Monson-Haefel.com/jws/BookQuote" xmlns:mh="http://www.Monson-Haefel.com/jws/BookQuote" xmlns:soapbind="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/">...

7 The types Element Describes all the data types used between the client and server Uses the XML schema language to declare complex data types and elements WSDL adopts, as its basic type system, the W3C XML schema built-in types If the service uses only W3C XML Schema built-in simple types, such as strings and integers, the types element is not required

8 Example: types element <xsd:schema targetNamespace="http://www.Monson- Haefel.com/jwsbook/BookQuote">

9 The message Element Describes a one-way message, whether it is a single message request or a single message response Defines the name of the message Contains zero or more message part elements, which can refer to message parameters or message return values

10 Example: message element......

11 The portType Element <input name="isbn" message="mh:GetBookPriceRequest"/> <output name="price" message="mh:GetBookPriceResponse"/> Combines multiple message elements to form a complete one-way or round-trip operation Defines the abstract interface of a Web service

12 Messaging Exchange Patterns There are four basic message exchange patterns used in Web services Request/Response The service receives a message One-Way The service receives a message and sends a response Notification The service sends a message Solicit/Response The service sends a message and receives a response

13 The binding Element Describes the concrete specifics of how the service will be implemented on the wire Maps an abstract portType to a set of concrete protocols such as SOAP and HTTP messaging styles (RPC or document) encoding styles (Literal or SOAP Encoding)

14 Example: binding element <soapbind:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <soapbind:operation style="rpc" soapAction="http://… /BookQuote /GetBookPrice"/> <soapbind:body use="literal" namespace="http://…/BookQuote" /> <soapbind:body use="literal" namespace="http://…/BookQuote" />

15 The service Element Specifies the location of the service Contains one or more port elements, each of which represents a different Web service The port element assigns the URL to a specific binding <soapbind:address location= "http://www.Monson-Haefel.com/jwsbook/BookQuote" />

16 WSDL 2.0 Now there are 3 separate specifications Part 1: Core Abstract interfaces, independent of protocol and encoding Part 2: Message Exchange Patterns Predefined types of interactions Part 3: Bindings SOAP and HTTP/MIME binding

17 Summary WSDL provides a precise, structured, and standard format for describing Web services Code generators can create convenient language- specific call interfaces for invoking Web services So, in many cases you will not deal directly with WSDL documents You have to understand WSDL to construct and exchange SOAP messages properly when using SOAP APIs

18 References WSDL Essentials http://www.oreilly.com/catalog/webservess/chap ter/ch06.html WSDL Version 2.0 Part 0: Primer http://www.w3.org/2002/ws/desc/wsdl20-primer Google Search WSDL example http://api.google.com/GoogleSearch.wsdl


Download ppt "Web Services: WSDL. Kas ir WSDL? Pirms izmantot SOAP ar konkrēto servisu ir jāzina kādai jābūt SOAP ziņojuma struktūrai kuru protokolu izmantot (HTTP,"

Similar presentations


Ads by Google