Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 WS Technologies II WSDL Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and Orchestration IMT- Institutions.

Similar presentations


Presentation on theme: "1 WS Technologies II WSDL Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and Orchestration IMT- Institutions."— Presentation transcript:

1 1 WS Technologies II WSDL Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and Orchestration IMT- Institutions Markets Technologies - Alti Studi Lucca

2 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 2 Models and Languages for Coordination and Orchestration Contents WSDL Some Java tools

3 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 3 Models and Languages for Coordination and Orchestration Contents WSDL Some Java tools

4 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 4 Models and Languages for Coordination and Orchestration What is the Story so Far? With UDDI (and SOAP) we know how to find and discover new services as if we looked at the yellow pages What can we do with discovered services? should we contact the service provider and ask for technical support in programming the right SOAP calls? No, this would be a waste of time for both us and the provider! Instead, the provider should prepare a unambiguous description of the WS to be exposed automatically downloadable, understandable, and usable for connecting to the specific WS WSDL fixes the standard for such description

5 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 5 Models and Languages for Coordination and Orchestration Web Services Description Language (WSDL) WSDL is an XML-based language for the description of Web Services (and the methods to access them) A WSDL document is just a particular XML document it resides in a file with suffix.wsdl it can be checked for validity against the WSDL SchemaWSDL Schema it describes how to "interface with" and use WS … and also the binding protocol to access WS it is a bit complex for human beings but it is unambiguous for a machine

6 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 6 Models and Languages for Coordination and Orchestration The Seven Elements of WSDL Essentially, WSDL documents consist of 7 key elements message types (data structures) messages basic units of communication between WS and clients typed data to be communicated as a single logical transmission operations sequences of messages related to a single action interfaces (called port types in WSDL v1) logical groups of operations representing abstract services bindings associations between interfaces and concrete protocols / data formats endpoints (called ports in WSDL v1) associations between interface bindings and network addresses services (collections of endpoints)

7 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 7 Models and Languages for Coordination and Orchestration A View at WSDL Hierarchical Structure

8 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 8 Models and Languages for Coordination and Orchestration Types A type is the most basic WSDL element completely analogous to a Schema document (.xsd) XML Schema are in fact used for defining message types a type can correspond to a struct, in C a class with variables but without methods, in Java types are necessary to describe the main elements and parameters in a method call

9 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 9 Models and Languages for Coordination and Orchestration Example: the Class Address.java public class Address { public String name; public String address1; public String address2; public String city; public String state; public String zip; } public class MyClass{ public void myMethod(Address myAddress){ //do something }

10 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 10 Models and Languages for Coordination and Orchestration the elements must appear in the specified order The Schema address.xsd URI of the Schema current namespace <xsd:schema targetNamespace="…/address.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:addr="…/address.xsd">

11 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 11 Models and Languages for Coordination and Orchestration Example: address.xsd with Anonymous Types URI of Schema Only if addressType is not used elsewhere <xsd:schema targetNamespace="…/address.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

12 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 12 Models and Languages for Coordination and Orchestration Example: valid XML document for address.xsd Arthur Fonzarelli 123 W. Wisconsin Apt. 4 Milwaukee WI 53222

13 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 13 Models and Languages for Coordination and Orchestration disregards the order of elements The Type address in WSDL I <wsdl:definitions name=“AddressType” targetNamespace=“…/addressType.wsdl” xmlns:tns=“…/addressType.wsdl” xmlns:wsdl=“http://schemas.xmlsoap.org/wsdl/”> <xsd:schema targetNamespace=“…/addressType.wsdl” xmlns:xsd=“http://www.w3.org/2001/XMLSchema”>

14 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 14 Models and Languages for Coordination and Orchestration The Type address in WSDL II

15 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 15 Models and Languages for Coordination and Orchestration Messages On the contrary of types, messages do not have an immediate analogy with Java... so we will push it... Imagine a setting where any method can have three parameters at most WSDL relies on such assumption (input, output and a third one, fault, for exception handling) Thus we must group the parameters of methods this is what messages are for! they have a sub-component part for each parameter

16 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 16 Models and Languages for Coordination and Orchestration Example: a Message public void order(Address shipTo, Address billTO){ //do something } + type="tns:addressType" alternatively

17 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 17 Models and Languages for Coordination and Orchestration Operations wsdl:operation is probably the simplest WSDL element it correspond to an abstract method in Java but, as said, it has some limitation three parameters at most: input, output, fault essentially there are four main different kinds of operations one-way (from the client to the service) request/response (request from the client and response back from the service) notification (from the service to the client) solicit/response (message from the service and response from the client)

18 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 18 Models and Languages for Coordination and Orchestration One-way Operations In general, operations are described by the element wsdl:operation that can contain one or more messages (wsdl:input, wsdl:output, wsdl:fault) In one-way operations, only the input element is allowed ex. + …

19 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 19 Models and Languages for Coordination and Orchestration Request/Response Operations Both input and output are defined optionally, an additional fault element ex. …

20 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 20 Models and Languages for Coordination and Orchestration … Notification Operations Converse of one-way operations only output message is allowed example: for notifying the client about the current status of the order

21 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 21 Models and Languages for Coordination and Orchestration … Solicit/Response Operations Useful when a service needs some information from the client example: construction of a site with variable bandwidth

22 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 22 Models and Languages for Coordination and Orchestration Interfaces (Port Types) For the moment we have only surveyed standalone operations but all the operations make sense only when considered within a port type What is a “port type”? W3C: “it defines a group of abstract operations and their corresponding abstract messages” it is equivalent to a Java interface (in WSDL v2, port types are called interfaces) Syntactically, it is defined by an element wsdl:interface (wsdl:portType in WSDL v1) which contains one or more wsdl:operation elements

23 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 23 Models and Languages for Coordination and Orchestration Example: Interface …

24 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 24 Models and Languages for Coordination and Orchestration Binding For the moment we have just considered "abstract" elements upon receiving a we have all the information on how to use it but we cannot create a direct instance To instantiate the interface we must provide the information that are necessary to interact with it in particular: which transport method will the interface use? which communication format are we going to use? The binding defines all details that are needed

25 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 25 Models and Languages for Coordination and Orchestration SOAP Binding on HTTP I <wsdl:definitions name="purchaseExample" targetNamespace="…/purchaseExample.wsdl" xmlns:tns="…/purchaseExample.wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> … …

26 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 26 Models and Languages for Coordination and Orchestration They are different! SOAP Binding on HTTP II HTTP ex. SOAP, HTTP e SMTPSOAP, HTTP e SMTP <wsdl:binding name="purchaseBinding" type="tns:purchaseType"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />

27 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 27 Models and Languages for Coordination and Orchestration Endpoints (Ports) Once defined the binding to the transport protocol we can link the method call to a specific IP address the binding defined the communication protocol, but not the address of the machine hosting the service sych information is given by the element wsdl:endpoint (called wsdl:port in WSDL v1) An endpoint contains a name a binding a network address

28 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 28 Models and Languages for Coordination and Orchestration <wsdl:port name=“Purchase_ServicePort” binding=“tns:purchaseBinding”> <soap:address location=“http://www.fluidimagination.com:8080/soap/servlet/rpcrouter” /> Example: Going Further on Previous Example

29 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 29 Models and Languages for Coordination and Orchestration Services Now we have all ingredients the only thing left is to combine them in a single offert analogous to a whole Java class The element wsdl:service is the very first element exposed to the interest of users who get the.wsdl document it groups all endpoints it allows the server to check if the services really supports all the required operations

30 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 30 Models and Languages for Coordination and Orchestration … blah blah blah <wsdl:port binding=“tns:purchaseBinding” name=“Purchase_ServicePort”> Example: for the Last Time full example

31 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 31 Models and Languages for Coordination and Orchestration Summary WSDL v1Java typesclasses without methods messagesparameters, return value, errors port types and operationsinterfaces bindingsremote communication protocol services and portsremote classes

32 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 32 Models and Languages for Coordination and Orchestration A WSDL v2 Example: GreatH Hotel Reservation I Hotel GreatH is located in a remote island for years it has been relying on fax/phone reservations now, even though the facilities and prices at GreatH are better than what its competitor offers, GreatH notices that its competitor is getting more customers than GreatH after research, GreatH realizes that this is because the competitor offers a Web service that permits travel agent reservation systems to reserve rooms directly over the Internet

33 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 33 Models and Languages for Coordination and Orchestration A WSDL v2 Example: GreatH Hotel Reservation II GreatH then wants to build a reservation Web service with the following functionalities: CheckAvailability the client must specify a check-in date, a check-out date, and room type the Web service will provide the room rate if such a room is available If any input data is invalid, the service should return an error The service will accept a checkAvailability message and return a checkAvailabilityResponse or invalidDataFault message MakeReservation the client must provide a name, address, and credit card information the service will return a confirmation number if the reservation is successful the service will return an error message if the credit card number or any other data field is invalid The service will accept a makeReservation message and return a makeReservationResponse or invalidCreditCardFault message.

34 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 34 Models and Languages for Coordination and Orchestration A WSDL v2 Example: GreatH Hotel Reservation III GreatH knows that later the WS will need to support transactions and secured transmission but initially we consider the implementation of only minimal functionality to simplify the example, we will consider only the CheckAvailability operation GreatH.wsdl

35 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 35 Models and Languages for Coordination and Orchestration Using WSDL in a UDDI Registry WSDL complements the UDDI standard by providing a uniform way of describing the abstract interface and protocol bindings of arbitrary network services Next, we try to clarify the relationship between the two describe how WSDL can be used in UDDI business service descriptions WSDL service descriptions can be structured in multiple ways if the reusable information is separated from the information that is specific to a given service instance, the use of WSDL and UDDI together becomes particularly simple

36 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 36 Models and Languages for Coordination and Orchestration Authoring UDDI Service Descriptions I The first step is to create the WSDL service interface definition Typically, industry groups will define a set of service types, and describe them with one or more service interface definition WSDL documents The service interface definition will include service interfaces and protocol bindings, and will be made publicly available The WSDL service interface definitions are then registered as a special kind of UDDI tModels, called “wsdlSpec tModels” the overviewDoc field in each new tModel will point to the corresponding WSDL document

37 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 37 Models and Languages for Coordination and Orchestration Authoring UDDI Service Descriptions II Next, programmers will build services that conform to the industry standard service definitions either manually or using appropriate UDDI-aware tooling, programmers will retrieve the tModel description of the industry standard definition following the overviewDoc link they will obtain the corresponding WSDL document WSDL-aware tooling, in turn, can help generate an implementation (that supports the standard interfaces and bindings)

38 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 38 Models and Languages for Coordination and Orchestration Authoring UDDI Service Descriptions III Finally, the new service must be deployed and registered in the UDDI repository either manually or using WSDL/UDDI-aware tooling, a UDDI businessService data structure is created, and then registered Typically when using WSDL/UDDI-aware tools, some type of “deployment descriptor” document will be generated at that same time

39 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 39 Models and Languages for Coordination and Orchestration Import Element The element in WSDL allows the separation of elements of service description into two parts service interface definition (SInt) service implementation definition (SImp) Typically, information common to a certain category of business services, such as message formats, portTypes (abstract interfaces), and protocol bindings, are included in the reusable portion (SInt), while information pertaining to a particular service endpoint (i.e., port definition) is included in the other portion (SImp) Within the context of UDDI, we will be concerned only with the reusable portion

40 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 40 Models and Languages for Coordination and Orchestration WSDL and UDDI: Monolithic Approach Relevant UDDI Structures: businessService bindingTemplate how and where the service is accessed it specifies a network endpoint address (in the accessPoint element) and a stack of tModels describing the service one tModelInstanceInfo inside the tModelInstanceDetails element for each relevant tModel tModel, aka service type definition one for each interface/portType classified using uddi-org:types taxonomy, as being of type "wsdlSpec" must have an overviewDoc whose overviewURL points to the WSDL document defining the interface/portType

41 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 41 Models and Languages for Coordination and Orchestration Sketch of businessService Structure (...) (...) http://www.etc.com/ (...) (...)

42 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 42 Models and Languages for Coordination and Orchestration WSDL document containing the definition of the interface classified with type "wsdlSpec" according to the uddi-org:types taxonomy Example: tModel StockQuote Service WSDL description of a standard stock quote service interface WSDL source document. http://stockquote-definitions/stq.wsdl <keyedReference tModelKey="uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4" keyName="uddi-org:types" keyValue="wsdlSpec"/>

43 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 43 Models and Languages for Coordination and Orchestration network endpoint address reference to the tModel in the previous slide Example: businessService StockQuoteService (...) (...) http://example.com/stockquote

44 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 44 Models and Languages for Coordination and Orchestration WSDL and UDDI: Modular Approach The Monolithic approach can be replaced by an expanded modelling that encompasses the flexibility and reusability of WSDL fine grain "taxonomy-zation" of WSDL artefacts portType/interface binding service port/endpoint

45 Roberto Bruni @ IMT Lucca 16 March 2005 Institutions Markets Technologies IMT 45 Models and Languages for Coordination and Orchestration Modular Mapping: Overview Institutions Markets Technologies IMT


Download ppt "1 WS Technologies II WSDL Roberto Bruni Dipartimento di Informatica Università di Pisa Models and Languages for Coordination and Orchestration IMT- Institutions."

Similar presentations


Ads by Google