511faac5c58f8dcf6dc27c7c15256987.ppt
- Количество слайдов: 42
Fortified Web Services Contracts for Trusted Components Avi Jencmen Amiram Yehudai 13/12/2005 Fortified Web Services Contracts for Trusted Components
Contents n n Web Services – An Introduction Software Contracts Problem Description Web Services Contracts ¨ ¨ ¨ n n n A Simple Example Basic Level Contracts Behavioral Level Contracts Synchronization Level Contracts Qo. S Level Contracts Proof Of Concept Outline Related Work Future Work 13/12/2005 Fortified Web Services Contracts for Trusted Components 2
Web Services Defined 1 a software system designed to support interoperable machine-to-machine interaction over a network Other systems interact with Web Service using SOAP messages n Web Service interfaces are described using WSDL n 1 from Web services Architecture; World Wide Web Consortium, February 2004 13/12/2005 Fortified Web Services Contracts for Trusted Components 3
Web Services Architecture 1. Parties Discover Each Other Requestor Entity Provider Entity Sem Requestor Human Sem + + WSD 2. Parties Agree on Semantics & WSD 3. Input Semantics & WSD Sem 3. Input Semantics & WSD + WSD Requester Agent 13/12/2005 Provider Human 4. Parties Interact Fortified Web Services Contracts for Trusted Components Provider Agent 4
Actors n Provider Entity ¨ n Provider Agent ¨ n A person or organization that provides an appropriate agent to implement a particular service A software agent that is capable of and empowered to perform the actions associated with a service on behalf of its owner Requester Entity A person or organization that wishes to make use of a provider entity’s Web Service ¨ Uses a requester agent to exchange messages with the provider entity’s provider agent ¨ n Requester Agent ¨ A software agent that wishes to interact with a provider agent in order to request that a task be performed on behalf of its owner 13/12/2005 Fortified Web Services Contracts for Trusted Components 5
Vocabulary n WSD ¨ ¨ Machine-processable specification of the Web Service interface Defines: n n ¨ n Message formats Datatypes Transport protocols Transport serialization formats Written in WSDL SEM Shared expectation about the behavior of the service The "agreement" regarding the purpose and consequences of the interaction ¨ No standard language ¨ ¨ 13/12/2005 Fortified Web Services Contracts for Trusted Components 6
Process Phases n Discover ¨ The requester entity somehow obtains both the Web Service description (WSD) and the associated semantics (SEM) of the service n Agree ¨ The requester and provider entities agree on the semantics and Web service description of the desired interaction n Interact ¨ The requester agent and provider agent exchange SOAP messages on behalf of their owners 13/12/2005 Fortified Web Services Contracts for Trusted Components 7
Web Services Standards n SOAP ¨An 1. 2 XML envelope n Headers ¨An + Body HTTP binding n SOAP is “transport independent” ¨A convention for doing RPC ¨An XML serialization format for structured data 13/12/2005 Fortified Web Services Contracts for Trusted Components 8
The SOAP Envelope <SOAP-ENV: Envelope xmlns="http: //schemas. xmlsoap. org/soap/envelope/"> < SOAP-ENV: Header>. . . </ SOAP-ENV: Header> < SOAP-ENV: Body>. . . </ SOAP-ENV: Body> Header: • A collection of zero or more SOAP header blocks • Extension mechanism </ SOAP-ENV: Envelope> Body: Contains the messages to be passed between the agents 13/12/2005 Fortified Web Services Contracts for Trusted Components 9
Software Contracts n n n Relationship between a class and its clients as a formal agreement Expresses each party's rights and obligations Contract information can describe four different levels of interaction: Basic level – Basic or syntactic contracts are required simply to make a system work ¨ Behavioral level – Behavioral contracts, improve the level of confidence in a sequential context ¨ Synchronization level – Synchronization contracts, improves confidence in distributed or concurrency contexts ¨ Qo. S level – quality-of-service contracts, quantifies quality of service and are usually negotiable ¨ 13/12/2005 Fortified Web Services Contracts for Trusted Components 10
The Four Levels of Contracts 13/12/2005 Fortified Web Services Contracts for Trusted Components 11
Problem Description Web Services are a standard means to support interoperable machine-to-machine interaction n They do not solve the problem of trust between service requesters and providers n Thesis Goal: To provide a formal contract description language between the requester entity and the provider entity n 13/12/2005 Fortified Web Services Contracts for Trusted Components 12
A Simple Example n n n A company (travel agent) wants to offer the ability to book complete vacation packages: plane/train/bus tickets, hotels, car rental, excursions, etc Service providers (airlines, bus companies, hotel chains, etc) are providing Web services to query their offerings and perform reservations Credit card companies are providing services to guarantee payments made by consumers 13/12/2005 Fortified Web Services Contracts for Trusted Components 13
Basic Level Contracts n n Specify the methods, in/out parameters of the service as messages the service can receive Basic level contracts are typically implemented as the Web Service’s underlying object interface Interface Travel. Agent { void enter. Destination(in City destination. City, in Date. Time destination. Date); void set. Destination. City(in City destination. City); void set. Destination. Date(in Date. Time destination. Date); Flight. List get. Filghts(); void choose. Flight(in Flight choosen. Flight); } 13/12/2005 Fortified Web Services Contracts for Trusted Components 14
WSDL 1. 1 n n Definitions element at the root, and a collection of definitions inside The definitions structure includes six major elements: ¨ ¨ ¨ types – provides data type definitions used to describe the messages exchanged message – represents an abstract definition of the data being transmitted. A message consists of logical parts, each of which is associated with a definition within some type system port. Type – is a set of abstract operations. Each operation refers to an input message and output messages binding – specifies concrete protocol and data format specifications for the operations and messages defined by a particular port. Type port – specifies an address for a binding, thus defining a single communication endpoint service – is used to aggregate a set of related ports 13/12/2005 Fortified Web Services Contracts for Trusted Components 15
WSDL 1. 1 Structure <wsdl: definitions name="nmtoken"? target. Namespace="uri"? > <wsdl: types> </wsdl: types> <wsdl: message name="nmtoken"> * </wsdl: message> <wsdl: port. Type name="nmtoken">* </wsdl: port. Type> <wsdl: binding name="nmtoken" type="qname"> * <-- extensibility element (1) --> * <wsdl: operation name="nmtoken"> * <-- extensibility element (2) --> * <wsdl: input name="nmtoken"? > ? <-- extensibility element (3) --> </wsdl: input> <wsdl: output name="nmtoken"? > ? <-- extensibility element (4) --> * </wsdl: output> <wsdl: fault name="nmtoken"> * <-- extensibility element (5) --> * </wsdl: fault> </wsdl: operation> </wsdl: binding> <wsdl: service name="nmtoken"> * <wsdl: documentation. . />? <wsdl: port name="nmtoken" binding="qname"> * <wsdl: documentation. . /> ? <-- extensibility element --> </wsdl: port> <-- extensibility element --> </wsdl: service> <-- extensibility element --> * </wsdl: definitions> 13/12/2005 Per-operation extensibility elements (2) as well as per-binding extensibility elements (1) Binding extensibility elements are used to specify the concrete grammar for the input (3), output (4), and fault messages (5) Fortified Web Services Contracts for Trusted Components 16
Travel Agent Example <? xml version="1. 0" encoding="utf-8" ? > <definitions> <types> <message name="choose. Flight. Soap. In"> <message name="choose. Flight. Soap. Out"> <message name="get. Filghts. Soap. In"> <message name="get. Filghts. Soap. Out"> <message name="set. Destination. Date. Soap. In"> <message name="set. Destination. Date. Soap. Out"> <message name="set. Destination. City. Soap. In"> <message name="set. Destination. City. Soap. Out"> <message name="enter. Destination. Soap. In"> <message name="enter. Destination. Soap. Out"> <port. Type name="Travel. Agent. Service. Soap"> <operation name="choose. Flight"> <operation name="get. Filghts"> <operation name="set. Destination. Date"> <operation name="set. Destination. City"> <operation name="enter. Destination"> </port. Type> <binding name="Travel. Agent. Service. Soap" type="s 0: Travel. Agent. Service. Soap"> <soap: binding transport="http: //schemas. xmlsoap. org/soap/http" style="document" /> <operation name="choose. Flight"> <operation name="get. Filghts"> <operation name="set. Destination. Date"> <operation name="set. Destination. City"> <operation name="enter. Destination"> </binding> <service name="Travel. Agent. Service"> <port name="Travel. Agent. Service. Soap" binding="s 0: Travel. Agent. Service. Soap"> </service> </definitions> Messages to be used in the Travel. Agent Web service Travel. Agent. Service Binding to SOAP The service element definition 13/12/2005 Fortified Web Services Contracts for Trusted Components 17
Basic Level Contracts Architecture WSD 1. Agree on WSD Requester Agent Provider Agent WSD 13/12/2005 SOAP 2. Interact according to WSD Fortified Web Services Contracts for Trusted Components 18
Behavioral Level Contracts n Specify an operation’s behavior by using Boolean assertions, called pre- and postconditions, for each service offered, as well as for class invariants Interface Ticket. Booking { Confirmation reserve. Seats(in Flight choosen. Flight, in int num. Of. Seats) { Require Correct. Number: num. Of. Seats > 0 and num. Of. Seats < reservation. Limit(); Ensure Seats. Reserved: available. Seats() = available. Seats()@pre – num. Of. Seats; } int available. Seats(in Flight choosen. Flight); int reservation. Limit(); } 13/12/2005 Fortified Web Services Contracts for Trusted Components 19
WS-Policy Framework n WS-Policy ¨A general-purpose model and corresponding syntax to describe and communicate the policies of a Web service n WS-Policy. Attachment ¨ An addendum to WS-Policy indicating how to attach policy assertions to an XML document (specifically to an WSDL document) 13/12/2005 Fortified Web Services Contracts for Trusted Components 20
WS-Policy Structure <? xml version="1. 0" encoding="utf-8" ? > <wsp: Policy> <wsp: Exactly. One> <wsse: Security. Token> An Example Using Assertions from the WS-Security. Policy Language <wsse: Token. Type>wsse: Kerberosv 5 TGT</wsse: Token. Type> </wsse: Security. Token> <wsse: Token. Type>wsse: X 509 v 3</wsse: Token. Type> </wsse: Security. Token> </wsp: Exactly. One> </wsp: Policy> 13/12/2005 Fortified Web Services Contracts for Trusted Components 21
WS-Behavioral. Contract. Policy Syntax <? xml version="1. 0" encoding="UTF-8"? > <wsp: Policy> <wsbc: Behavioral. Contract> <wsbc: Pre. Condition wsp: optional="true"> <exp: Expression>. . . </exp: Expression> </wsbc: Pre. Condition> <wsbc: Post. Condition wsp: optional="true"> <exp: Expression>. . . </exp: Expression> </wsbc: Post. Condition> <wsbc: Invariant wsp: optional="true"> <exp: Expression>. . . </exp: Expression> </wsbc: Invariant> </wsbc: Behavioral. Contract> </wsp: Policy> 13/12/2005 Fortified Web Services Contracts for Trusted Components 22
WS-Behavioral. Contract. Policy Example Precondition: num. Of. Seats > 0 <? xml version="1. 0" encoding="UTF-8"? > <wsp: Policy> <wsbc: Behavioral. Contract> <wsbc: Pre. Condition wsp: optional="true"> <exp: Expression> <Greater. Then> <Prop. Call name="self" type="Object"> <Prop. Call name="num. Of. Seats" type="Attribute"/> </Prop. Call> <exp: Expression> <Literal value="0"/> </exp: Expression> </Greater. Then> </exp: Expression> </wsbc: Pre. Condition> </wsbc: Behavioral. Contract> </wsp: Policy> 13/12/2005 Fortified Web Services Contracts for Trusted Components 23
Travel Agent Example Attaching Behavioral Policy to the WSDL file <? xml version="1. 0" encoding="utf-8" ? > <definitions> <types> <message name="reservation. Limit. Soap. In"> <message name="reservation. Limit. Soap. Out"> <message name="available. Seats. Soap. In"> <message name="available. Seats. Soap. Out"> <message name="reserve. Seats. Soap. In"> <message name="reserve. Seats. Soap. Out"> <port. Type name="Ticket. Booking. Service. Soap"> <operation name=“reserve. Seats”> <input message=“reserve. Seats. Soap. In”> <wsp: Policy. Reference URI="#RSPRE" wsdl: required="true"/> </input> <output message=“reserve. Seats. Soap. Out” > <wsp: Policy. Reference URI="#RSPOST" wsdl: required="true"/> </output> </definitions> 13/12/2005 Fortified Web Services Contracts for Trusted Components 24
Behavioral Level Contracts Architecture 1. b. Supply WSD & Behavioral Contract Criteria Discovery Service BEH + WSD CON 1. c. BEH + WSD CON 13/12/2005 BEH + WSD CON Return WSD and Behavioral Contract Info Requester Agent 1. a. Obtain WSD and Behavioral Contract Info BEH + WSD CON 2. Agree on WSD & Behavioral Contract 3. Interact according to WSD & Behavioral Contract Fortified Web Services Contracts for Trusted Components Provider Agent BEH + WSD CON 25
Synchronization Level Contracts n Specify the service behavior in a concurrent environment by indicating the coordination protocols it supports Interface Ticket. Booking { Confirmation reserve. Seats(in Flight choosen. Flight, in int num. Of. Seats) Synchronization Atomic; int available. Seats(in Flight choosen. Flight) Synchronization Atomic; int reservation. Limit(); } 13/12/2005 Fortified Web Services Contracts for Trusted Components 26
WS-Coordination Framework n WS-Coordination ¨ Describes an extensible framework for providing protocols that coordinate the actions of distributed applications n WS-Atomic. Transaction ¨ Provides the definition of the atomic transaction coordination type n WS-Business. Activity ¨ Provides the definition of a business activity coordination type 13/12/2005 Fortified Web Services Contracts for Trusted Components 27
WS-Coordination Framework Architecture 13/12/2005 Fortified Web Services Contracts for Trusted Components 28
WS-Synchronization. Contract. Policy Syntax <? xml version="1. 0" encoding="UTF-8"? > <wsp: Policy> <wssc: Synchronization. Contract> <wssc: Supported. Protocol wsp: optional="true"> <wssc: Atomic. Transaction. Protocol/> </wssc: Supported. Protocol> <wssc: Supported. Protocol wsp: optional="true"> <wssc: Business. Process. Protocol/> </wssc: Supported. Protocol> </wssc: Synchronization. Contract> </wsp: Policy> 13/12/2005 Fortified Web Services Contracts for Trusted Components 29
WS-Synchronization. Contract. Policy Example Operation supporting only Atomic. Transaction Protocol: <? xml version="1. 0" encoding="UTF-8"? > <wsp: Policy> <wssc: Synchronization. Contract> <wssc: Supported. Protocol wsp: optional="true"> <wssc: Atomic. Transaction. Protocol/> </wssc: Supported. Protocol> </wssc: Synchronization. Contract> </wsp: Policy> 13/12/2005 Fortified Web Services Contracts for Trusted Components 30
Travel Agent Example Adding Synchronization Policy to the WSDL file <? xml version="1. 0" encoding="utf-8" ? > <definitions> <types> <wsp: Policy wsu: Id="Synchronization. Contarct. Policy"> <wsat: ATAlways. Capability /> </wsp: Policy> <message name="reservation. Limit. Soap. In"> <message name="reservation. Limit. Soap. Out"> <message name="available. Seats. Soap. In"> <message name="available. Seats. Soap. Out"> <message name="reserve. Seats. Soap. In"> <message name="reserve. Seats. Soap. Out"> </types> <port. Type name="Ticket. Booking. Service. Soap"> <service name="Ticket. Booking. Service"> <operation name=“reserve. Seats” > <wsp: Policy. Reference URI="# Synchronization. Contarct. Policy" wsdl: required="true"/> </service> </definitions> 13/12/2005 Fortified Web Services Contracts for Trusted Components 31
Synchronization Level Contracts Architecture 1. Discover Service Discovery Service SYN + WSD CON 2. Agree on WSD & Synchronization Contract Cxt Requester Agent SYN + WSD CON 13/12/2005 Coordination Service 3. Share Coordination Context Cxt 4. Interact according to Contract Fortified Web Services Contracts for Trusted Components Provider Agent SYN + WSD CON 32
Qo. S Level Contracts n Specifies the obligation of a service provider to perform a service according to agreed-upon guarantees for IT-level service parameters (such as availability, response time and throughput) Interface Ticket. Booking { Confirmation reserve. Seats(in Flight choosen. Flight, in int num. Of. Seats) SLAParameter Transaction. Rate; } 13/12/2005 Fortified Web Services Contracts for Trusted Components 33
WSLA Framework n A framework for specifying and monitoring Service Level Agreements for Web Services 13/12/2005 Fortified Web Services Contracts for Trusted Components 34
WSLA Structure 13/12/2005 Fortified Web Services Contracts for Trusted Components 35
WS-Qo. SContract. Policy Example <? xml version="1. 0" encoding="UTF-8"? > <wsp: Policy> <wsqc: Qo. SContract> <wsqc: SLAParameter name="Transaction. Rate" type="float" unit="transaction/sec"> <wsqc: Metric> Transaction </wsqc: Metric> </wsqc: SLAParameter> </wsqc: Qo. SContract> </wsp: Policy> 13/12/2005 Fortified Web Services Contracts for Trusted Components 36
Travel Agent Example Adding Qo. S Policy to the WSDL file <? xml version="1. 0" encoding="utf-8" ? > <definitions> <types> <message name="reservation. Limit. Soap. In"> <message name="reservation. Limit. Soap. Out"> <message name="available. Seats. Soap. In"> <message name="available. Seats. Soap. Out"> <message name="reserve. Seats. Soap. In"> <message name="reserve. Seats. Soap. Out"> <port. Type name="Ticket. Booking. Service. Soap"> <service name="Ticket. Booking. Service"> <operation name=“reserve. Seats” > <wsp: Policy. Reference URI="#Qo. SContract. Policy" wsdl: required="true"/> </service> </definitions> 13/12/2005 Fortified Web Services Contracts for Trusted Components 37
Qo. S Level Contracts Architecture 1. Discover Service Discovery Service QOS + WSD CON 2. Agree on Semantics & Qo. S Contact Coordination Service Requester Agent QOS + WSD CON 4. Interact according to Contract Provider Agent 3. Share Coordination Context SLA 5. Measure, Manage and Evaluate the Contract Measurement Service SLA QOS + WSD CON 5. Measure, Manage and Evaluate the Contract Condition Management Evaluation Service SLA Services 13/12/2005 Fortified Web Services Contracts for Trusted Components 38
Discovery Service POC Outline 1. b. Supply Contract Criteria CON + Contract Service Behavioral Contract Service Directory Service Synchronization Contract Service Qo. S Contract Service 1. a. Obtain Contract Info WSD CON + CON 1. c. Return Contract Info WSD 2. Agree on Contract Cxt Coordination Service Cxt 3. a. Share Coordination Context Requester Agent 3. b. Interact according to Contract CON 4. Measure, Manage and Evaluate the Contract Measurement Service Condition Evaluation Service Provider Agent CON 4. Measure, Manage and Evaluate the Contract Management Service SLA Service 13/12/2005 Fortified Web Services Contracts for Trusted Components 39
POC Outline 13/12/2005 Fortified Web Services Contracts for Trusted Components 40
Related Work n WSOL (work from Carleton University, Ontario, Canada) Web Service Offerings Language Formal specification of multiple classes of service for one Web Service ¨ Focus on Qo. S (a. k. a. , non-functional) constraints ¨ ¨ n OWL-S (w 3 c Member Submission by SRI International) ¨ ¨ n Semantic Markup for Web Services Ontology for Web Services WSDL-S (w 3 c Member Submission by IBM) ¨ ¨ Web Service Semantics A mechanism to associate semantic annotations with Web services that are described using Web Service Description Language 13/12/2005 Fortified Web Services Contracts for Trusted Components 41
Future Work Enforcement mechanism n UDDI Contract Attachment n Ontology for Web Service Contracts n 13/12/2005 Fortified Web Services Contracts for Trusted Components 42
511faac5c58f8dcf6dc27c7c15256987.ppt