Presentation is loading. Please wait.

Presentation is loading. Please wait.

ICT 1 INF5120 Modellbasert systemutvikling Web Services XML Schema WSDL BPEL Forelesning 26.03.2007 Roy Grønmo

Similar presentations


Presentation on theme: "ICT 1 INF5120 Modellbasert systemutvikling Web Services XML Schema WSDL BPEL Forelesning 26.03.2007 Roy Grønmo"— Presentation transcript:

1 ICT 1 INF5120 Modellbasert systemutvikling Web Services XML Schema WSDL BPEL Forelesning 26.03.2007 Roy Grønmo roy.gronmo@sintef.no

2 ICT 2 Outline Web Services – Infrastructure and Architecture XML Introduction XML Schema Web Service Description Language (WSDL) Business Process Execution Language (BPEL)

3 ICT 3 Web Services – Infrastructure and Architecture

4 ICT 4 What is a Web service? The term “Web services” is confusing. There are many things that are referred to as “Web services”. Adding to the confusion is the term “services” which is interpreted differently by different people.

5 ICT 5 Webservice Web is short for World Wide Web. Work performed or offered by a software system (possibly including human resources as well.) Software services performed or offered on the Web, using open Internet standards and technologies. What is a Web service?

6 ICT 6 Definition (W3C): Web service “A Web service is a software system designed to support interoperable machine-to-machine interaction over a network. It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP-messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.” - W3C Web Services Glossary, http://www.w3.org/TR/ws-gloss/http://www.w3.org/TR/ws-gloss/

7 ICT 7 Characteristics of a basic Web service Fundamental requirements: It receives service requests and sends service replies over HTTP Service requests – input data/parameters Service responses – output data/parameters Data is normally formatted as an XML document SOAP (Simple Object Access Protocol) Interface w/ operations and associated bindings and protocols are described using WSDL Additionally, a Web service may: Be registered with a discovery agent through which it can be located, typically UDDI.

8 ICT 8 Web services stack Technology stack Conceptual stack This part of the tutorial focuses on understanding the Web service technologies for messaging, description and composition such as XSD, WSDL and WS-BPEL.

9 ICT 9 Web services – a conceptual view Underlying Protocols Messaging Encoding Business Entities Web Service Interfaces HTTP/WEB VANs FTP SMTP/EMAIL MQ-Series SOAP EDI “Binary” Raw XML ebXML BPEL ___________ ___________ ___________ ___________ ___________ _____ EGO-Centric Workflow Process Description WSDL ___________ ___________ ___________ ___________ ___________ _____ (Syntactic) Web Service Interface Description Bindings and Endpoint Descriptions WS-CHOR ___________ ___________ ___________ ___________ ___________ _____ Interaction Sequencing (Co)Constraints XSD ___________ ___________ ___________ ___________ ___________ _____ XML Message Schema Definition

10 ICT 10 Web Services Architecture BPEL

11 ICT 11 Relationship between Architecture model and Web Services BPEL WSDL XML Schema UML Activity UML Interface UML Class

12 ICT 12 Model-driven Web Services – Two alternatives Web Service (XML, Textual) Model-to-model PIM (COMET models) transformation PSM (WS UML Profile) Model-to-text 1 2 1 1. Transformation in two steps via UML profile ATL MOFScript 2. Transformation in one step Transformation choices: fixed config file user is prompted

13 ICT 13 XML Introduction

14 ICT 14 XML - a Metameta Language Metameta/How to define schema Meta/Schema Instances/Documents XMLSGML MathMLXSLSMILOFXHTML XSL DocHTML DocXML Doc

15 ICT 15 Document Type Definition ( DTD ) XML Document XSL(T) to rearrange/restructure an XML document … and to prepare a document for rendering based on an XSL document XPointer to position a cursor in an XML document XLink to create complex links XML Schema to represent the DTD in XML syntax and express additional constraints XML Query to query sets of XML documents RDF Resource Description Framework - to add metadata

16 OGI DISC - modified and extended by SINTEF Slide 16 Example XML Document Brian Smith Mary Brown March 3, 1998 excessive overtime The Flame Project team has been working overtime for weeks and weeks. Let’s take the group to lunch on Friday.

17 OGI DISC - modified and extended by SINTEF Slide 17 Example XML Document Start- and end-tags come in pairs Brian Smith Mary Brown March 3, 1998 excessive overtime The Flame Project team has been working overtime for weeks and weeks. Let’s take the group to lunch on Friday.

18 OGI DISC - modified and extended by SINTEF Slide 18 the content of simple elements: appears between start tag and end tag Text content Brian Smith Mary Brown March 3, 1998 excessive overtime The Flame Project team has been working overtime for weeks and weeks. Let’s buy pizza for the group on Friday.

19 OGI DISC - modified and extended by SINTEF Slide 19 the content of compound elements: appears between start tag and end tag Brian Smith Mary Brown March 3, 1998 excessive overtime The Flame Project team has been working overtime for weeks and weeks. Let’s buy pizza for the group on Friday. a compound element includes all of the complete subelements: the tags and content of the subelements

20 OGI DISC - modified and extended by SINTEF Slide 20 Attributes in XML In the document, we see: Attributes are associated with elements….and the assignment of values to attributes always appear in the start tag for the element. attribute name tag name attribute value attribute name attribute value

21 OGI DISC - modified and extended by SINTEF Slide 21 Namespaces Example Slightly modified listings document <Recent-Listings Area="Raleigh Hills" Date="March 97” xmlns=“http://www.century21.com/listings.dtd” xmlns:mls="urn:uuid:C2F41010-65B3-11d1-A29F- 00AA00C14882" > 8225 SW Canyon Lane 3 2... Default Namespace “Named” Namespace Prefix

22 ICT 22 XML is extensively used – Examples XML Metadata Interchange (XMI) XSLT – programming language for transformation Web Services: XML Schemas, WSDL, SOAP, BPEL Storage/Exchange formats Configuration files Advantage: Tool support for parsing, validation, editing, visualization, ease of debugging etc. Disadvantage: Poor readability, efficiency (compared to binary)

23 ICT 23 XML Schema

24 ICT 24 XML Schema Definition (XSD) Define the legal building blocks of an XML document: Defines elements that can appear in a document. Defines attributes that can appear in a document. Defines which elements are child elements. Defines the order of child elements. Defines the number of child elements. Defines whether an element is empty or can include text. Defines data types for elements and attributes. Defines default and fixed values for elements and attributes.

25 ICT 25 Simple types Simple types are defined by restricting a built-in-type or another simple type fourteen facets to restrict including: pattern, enumeration, length(3), period and duration

26 ICT 26 Another Example

27 ICT 27 Defining complex types …...

28 ICT 28 Document instance of purchase order Alice Smith 123 Maple Street Mill Valley CA 90952... type="Address" name=“shipTo"

29 ICT 29 or ? When do you use the complexType element and when do you use the simpleType element? Use the complexType element when you want to define child elements and/or attributes of an element Use the simpleType element when you want to create a new type that is a refinement of a built-in type (string, integer, etc)

30 ICT 30 Defining attributes Note: attributes can only have simpleTypes (i.e., attributes cannot have child elements). Anonomous type

31 ICT 31 Notes about Attributes The attribute declarations always come last, after the element declarations. The attributes are always with respect to the element that they are defined (nested) within. … "bar and boo are attributes of foo"

32 ICT 32 Inheritance: Extending complex types <element name="zip" type="xsd:string"/>

33 ICT 33 Elements tag name in instance document type is either built-in types, simpleTypes or complexTypes 90210 XML instance:

34 ICT 34 XSD: XML text editor Can also be built using simple text editors XML editors gives contextual support, e.g. like auto-completion, suggestions for elements, etc., as well as validation of the XML document. Inside here goes: elements complexTypes simpleTypes

35 ICT 35 XSD: UML profile for XSD UML representation of XML schema. Useful in a UML-centric development method if the modelling environment supports generation/import of XSD documents.

36 ICT 36 PIM4SOA main mappings to XSD PIM4SOA element XSD equivalentNotes DocumentSchema EntityComplexType AssociationElement An association between entities is transformed into an element in the containing type with a reference to the complex type generated for the target Entity Attribute Attributes having simple types are mapped to Attributes in complex types. Attributes with complex types in the PIM4SOA model are mapped in the same way as Associations. ElementSimpleTypeIf the ItemType from the PIM4SOA model is not an entity (meaning it is a simple type) a SimpleType definition is created in the schema.

37 ICT 37 Web Service Description Language (WSDL)

38 ICT 38 Making a SOAP function call over HTTP Body XML Data Header HTTP Request Body XML Data Header HTTP Response

39 ICT 39 The SOAP Envelope paramValue1 paramValue2 Optional

40 ICT 40 Web Services Description Language (WSDL) Purpose Web services need to be defined in a consistent manner so that they can be discovered by and interfaced with other services and applications. The Web Services Description Language is a W3C specification providing the foremost language for the description of Web service definitions. W3C, "Web Services Description Language (WSDL) Version 2.0 Part 1: Core Language", World Wide Web Consortium (W3C), W3C Working Draft, 3 August 2004. http://www.w3.org/TR/2004/WD-wsdl20-20040803/http://www.w3.org/TR/2004/WD-wsdl20-20040803/

41 ICT 41 WSDL: Conceptual view Underlying Protocols Messaging Encoding Business Entities Web Service Interfaces HTTP/WEB VANs FTP SMTP/EMAIL MQ-Series SOAP EDI “Binary” Raw XML ebXML WSDL ___________ ___________ ___________ ___________ ___________ _____ (Syntactic) Web Service Interface Description Bindings and Endpoint Descriptions

42 ICT 42 WSDL: Conceptual model WS Provider WS Client WS Interface Ports Operations Name, Abstract Message Parts Schema Message Exchange Pattern Porttype Operation Concrete Message Encoding Concrete Messaging Protocol (Reusable) Binding Concrete Endpoint Address Operations Invoked through Ports

43 ICT 43 WSDL: Message exchange patterns WS Provider WS Client Time Request-Response Solicit-Response One-Way Notification

44 ICT 44 WSDL 1.1 metamodel A collection of related endpoints A single endpoint defined as a combination of a binding and a network address A concrete protocol and data format specification for a particular port type An abstract set of operations supported by one or more endpoints An abstract, typed definition of the data being communicated An abstract, description of an action supported by the service A container for data type definitions

45 ICT 45 UML profile for WSDL UML representationText representation

46 ICT 46.................. <port name="Payment_Port” binding="PaymentSOAPBinding">... <port name="TransactionWFS_Port” binding="TransactionWFSSOAPBinding">… Class Copy-down Inheritance Interface BusinessService Interface Realize

47 ICT 47 Business Process Execution Language (BPEL)

48 ICT 48 BPEL BPEL is a Web service composition language. It defines how to compose other Web services so to accomplish a more complex task. A BPEL engine is capable of executing the composite service described by BPEL. The outcome will be a composite BPEL-defined Web service which itself can be regarded as a Web service.

49 ICT 49 BPEL language XML notation Interaction with other Web services:. Wait for an incoming message. Typically at the process start. Call another Web service. Send a response message from the entire BPEL service Control flow. Sequential control flow. Parallel control flow. Conditional branching. Loop Data flow. Defines the data objects involved. Copy a data object from one variable to another possibly w/ data transformation

50 ICT 50 BPEL: Simplified view A BPEL process is a composite Web service with a WSDL description.

51 ICT 51 BPEL Foundations

52 ICT 52 BPEL: Details Two Uses –Executable process descriptions –Business protocol descriptions – Abstract processes Partner links –Paired WSDL interfaces –Correlation sets Bind messages to process/activity instances. –Endpoint references Partner –Grouping constraint on partner links to a single business partner. Process Activities –Basic - assign, throw, terminate, wait, empty, compensate –Partner interaction - receive, reply, invoke –Structured - sequence, switch, while, pick, flow, scope Process Partner - Links WSDL PortType

53 ICT 53 BPEL example PO : POMessage Invoice : InvMessage receive reply shippingInfo shippingSchedule flow sequence

54 ICT 54 BPEL Process <process name="purchaseOrderProcess" xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/"> <partnerLink name="purchasing" partnerLinkType="lns:purchasingLT" myRole="purchaseService"/> <partnerLink name="invoicing" partnerLinkType="lns:invoicingLT" myRole="invoiceRequester" partnerRole="invoiceService"/> <partnerLink name="shipping" partnerLinkType="lns:shippingLT" myRole="shippingRequester" partnerRole="shippingService"/> <partnerLink name="scheduling" partnerLinkType="lns:schedulingLT" partnerRole="schedulingService"/>

55 ICT 55 BPEL process <receive partnerLink="purchasing" portType="lns:purchaseOrderPT" operation="sendPurchaseOrder" variable="PO"/>...

56 ICT 56 BPEL process <invoke partnerLink="shipping" portType="lns:shippingPT" operation="requestShipping" inputVariable="shippingRequest" outputVariable="shippingInfo"> <receive partnerLink="shipping" portType="lns:shippingCallbackPT" operation="sendSchedule" variable="shippingSchedule">...

57 ICT 57 UML profile for BPEL

58 ICT 58 PIM4SOA main mappings to BPEL PIM4SOA elementBPEL equivalent Notes ServiceProvider Process Process Task (i) (participating in collaboration) Receive, Invoke, ReplyThe type of communication with other service providers must be deduced from parameters passed to or from the task in question. Task (ii) (no collaboration use) EmptyThis might be a task requiring further implementation or human interaction beyond the scope of the PIM4SOA. FlowSequence, Flow, (…)The structure of flows between Steps must be analysed to deduce the applicable BPEL structure. Interaction, PinAssignInteractions have a role to play both in determining collaboration type (see Task (ii) above), and passing particular parts of messages between tasks (data flow, a BPEL assign). MessageVariableAll messages sent and received must have appropriate variables defined within the BPEL CollaborationUse RoleBinding PartnerLinkThe CollaborationUses defined for the ServiceProvider tell us what PartnerLinks we will need. See CollaborationUsePath. CollaborationUsePathPartnerLink, Role(…)This defines a specific use of a PartnerLink, alongside what role we are playing, and even the PortType being used. See links to the WSDL transformation described below.

59 ICT 59 RSM and UML profile for Web services

60 ICT 60 Referanser, neste forelesning... XML, XML Schema, WSDL: www.w3c.org BPEL: http://en.wikipedia.org/wiki/BPEL www.oasis-open.org NB! Utskrift av foilene fra denne forelesningen blir lagt ut på neste forelesning. Neste forelesning: 16.april, Interoperability and MDI – EIF and EIM (Brian)


Download ppt "ICT 1 INF5120 Modellbasert systemutvikling Web Services XML Schema WSDL BPEL Forelesning 26.03.2007 Roy Grønmo"

Similar presentations


Ads by Google