TDDD05 Component-Based Software Web Services Many slides by courtesy of Welf Löwe, Stig Berild, Uwe Aßmann, C. Kessler Content: * SOAP * WSDL * UDDI * BPEL, BPMN * Web services and Java * Evaluation and Wrap-up Ola Leifler, IDA, Linköpings universitet Recommended Reading Szyperski, Chapter 12.4 + 10.5.3 W.M.P. Van der Aalst. Don't go with the flow: Web services composition standards exposed. IEEE Intelligent Systems, Jan/Feb 2003. http://tmitwww.tm.tue.nl/research/patterns/download/ieeewebflow.pdf O. Leifler, IDA, Linköpings universitet. 2 TDDD05 Component-Based Software Service = deployed components + provider with infrastructure Keyword: Service Accounts Coop. Amazon.com Billing Servicearchitecture Citybank UPS Delivery O. Leifler, IDA, Linköpings universitet. Order processing Creditability check 3 Payment TDDD05 Component-Based Software Reuse of (some) Services Account s Web Aggregate Order acceptance Amazon.com Billing Storage Billing Order processing Packing Parcel service Checking Delivery O. Leifler, IDA, Linköpings universitet. 4 Bank Payment Creditability check TDDD05 Component-Based Software Web Services: basic concept Data Operation/Process Standards required! O. Leifler, IDA, Linköpings universitet. 5 TDDD05 Component-Based Software Service-Oriented Architectures (SOA) All software components are modeled as services to be consumed over the network The focus of design is on the service’s interface Applications are integrated at the interface (contract) level, not at the implementation level Services will be published (or withdrawn) dynamically Registry Services will be searched and discovered Discovery facility SOA are based on traders CORBA with O. Leifler, IDA, Linköpings universitet. trader service is a SOA, albeit platform-specific 6 TDDD05 Component-Based Software Description Framework Revolution Vision Judgments Evolution Exists Judgment O. Leifler, IDA, Linköpings universitet. Approaches 7 Components of Web Services TDDD05 Component-Based Software XML Data Exchange + W3C Recommendation (standard) + Easy syntax for hierarchical, structured documents + Widely spread, accepted Data: XML-document - No semantics - Not compact / low performance - Ongoing standardizations Approach Exists O. Leifler, IDA, Linköpings universitet. XML 8 Components of Web Services Message Description TDDD05 Component-Based Software XML Example <treatment> <patient insurer=“1577500” nr=‘7503100815’/> <doctor city=“SB” nr=‘4321’/> <service> <mkey>1234-A</mkey> <date>2001-01-30</date> <diagnosis>No complications. </diagnosis> </service> </treatment> O. Leifler, IDA, Linköpings universitet. 9 TDDD05 Component-Based Software Example: Simple XML Schema types <simpletype name=‘mkey’ base=‘string’> <pattern value=‘[0-9]+(-[A-Z]+)?’/> </simpletype> <simpletype name=‘insurer’ base=‘integer’> <precision value=‘7’/> </simpletype> <simpletype name=‘myDate’ base=‘date’> <minInclusive value=‘2007-01-01’/> <maxExclusive value=‘2007-04-01’/> </simpletype> O. Leifler, IDA, Linköpings universitet. 10 TDDD05 Component-Based Software Example: Complex XML Schema types <complextype name=‘treatment’> <element name=‘patient’ type=‘patient’/> <choice> <element ref=‘doctor’/> <element ref=‘hospital’/> </choice> <element ref=‘service’ maxOccurs=‘unbounded’/> </complextype> O. Leifler, IDA, Linköpings universitet. 11 TDDD05 Component-Based Software Example: XML Schema Attributes <complextype name=‘patient’ content=‘empty’> <attribute ref =‘insurer’ use=‘required’/> <attribute name=‘nr’ use=‘required’> <simpletype base=‘integer’> <precision value=‘10’/> </simpletype> </attribute> <attribute name=‘since’ type=‘myDate’/> </complextype> O. Leifler, IDA, Linköpings universitet. 12 TDDD05 Component-Based Software Question Why do people like XML? It is wordy Slow Ugly .... Remark: Binary XML variants are under development... See e.g. IEEE Computer 38(4): 16-18, April 2005 + compression - portability - many competing standards (although W3C has adopted EXI) O. Leifler, IDA, Linköpings universitet. 13 TDDD05 Component-Based Software SOAP, An XML-based Interaction Protocol Body Header Envelope Simple Object Access Protocol (SOAP) defines the message format O. Leifler, IDA, Linköpings universitet. 14 TDDD05 Component-Based Software SOAP – An XML-Based RPC Message contains target address and an envelope with name space, encoding attributes and Header (fixed format), contains Authentication (Sender, Receiver), Transactions, Error handling information, Routing Body information … contains user data (free format) Transport is transparent, uses predefined channels: HTTP (with back channel, de facto standard) SMTP (Simple Mail Transport Protocol) TCP (with back channel) O. Leifler, IDA, Linköpings universitet. 15 TDDD05 Component-Based Software Example: SOAP Header Message Header HTTP POST /TreatmentAdmin HTTP/1.1 HOST: www.hospital-admin.com Content-Type: text/xml Charset=“utf-8” Content-Length: nnnn SOAPaction: http://localhost/TreatmentAdmin Each SOAP message is an XML document with Envelope as root element <SOAP-ENV:Envelope xmlns:SOAP-ENV=”http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header> <a:Authentication xmlns:a=”http://localhost/TreatmentAdmin … “> … </a:Authentication> SOAP Envelope body </SOAP-ENV:Header> <SOAP-ENV:Body> … </SOAP-ENV:Body> </SOAP-ENV:Envelope> O. Leifler, IDA, Linköpings universitet. 16 TDDD05 Component-Based Software Example: SOAP Body <SOAP-ENV:Body> <m:AddTreatment xmlns:a=http://localhost/TreatmentAdmin> <treatment> <patient insurer=“1577500” nr=‘7503100815’/> <doctor city=“SB” nr=‘4321’/> <service> <mkey>1234-A</mkey> <date>2001-01-30</date> <diagnosis>No complications. </diagnosis> </service> XML Data </treatment> </SOAP-ENV:Body> O. Leifler, IDA, Linköpings universitet. 17 TDDD05 Component-Based Software SOAP Interaction Protocol + W3C Recommendation (standard) + Implements RPC - Untyped user data, types to encode in the message - Interpretation of SOAP messages required - High overhead / low performance - Ongoing standardizations Approach Components of Web Services Exists SOAP Messaging Exists XML Message Description Exists HTTP, FTP, IIOP, MQ... Network O. Leifler, IDA, Linköpings universitet. 18 TDDD05 Component-Based Software TDDD05 Component-Based Software The Interface Concept of Web Services Ola Leifler, IDA, Linköpings universitet Service Interface XML input / output Operation Web Service Interface Web Services Description Language (WSDL) defines a web service's interface * to describe a service for its clients * to describe a standard service for WS implementors O. Leifler, IDA, Linköpings universitet. 20 TDDD05 Component-Based Software WSDL Interfaces Interface WSDL Ports describe Port input and output messages out-port in-port A WSDL Interface is a set of ports Functions with types of parameter and results in XML Schema Event ports Port types and their operations: Event or message based: Notification: One-way: data-out port. data-in port. Call-based Request-Response: Solicit-Response: O. Leifler, IDA, Linköpings universitet. receive, then reply (callee port) send, then receive (caller port) 21 TDDD05 Component-Based Software WDSL Specification Structure Types In XML schema or another typing language <wsdl:definitions Messages xmlns:wsdl = “http://w3.org/...”> <wsdl:documentation ... /> The data that is communicated <wsdl:types> Schema imports </wsdl:types> Port types and Operations <wsdl:message> Messages An interface of the service, </wsdl:message> grouping sets of messages into operations, <wsdl:portType> Operations </wsdl:portType> with input, output, fault parameters <wsdl:binding> ProtocolsFormats </wsdl:binding> Binding <wsdl:service> Service definition </wsdl:service> A mapping of the port to underlying </wsdl:definitions> messaging layer, e.g., HTTP, SOAP, or MIME Service A set of related ports, with service name and location O. Leifler, IDA, Linköpings universitet. 22 TDDD05 Component-Based Software WSDL Interface, Message Types (XSD Types) <wsdl:types> <XMLSchema:schema … [target name space definitions]> <XMLSchema:element name=“addTreatment”> <XMLSchema:complextype> <XMLSchema:sequence> <s:element minOccurs="1" maxOccurs="1" name="parameter" nillable="true" type="a:treatment"/> </XMLSchema:sequence> </XMLSchema:complextype> </XMLSchema:element> <XMLSchema:element name=“addTreatmentResponse”> <XMLSchema:complextype> <XMLSchema:sequence> <s:element minOccurs="1" maxOccurs="1" name=“result" nillable="true" type="XMLSchema:bool"/> </XMLSchema:sequence> </XMLSchema:complextype> </XMLSchema:element> <XMLSchema:complextype name=‘treatment’> … TDDD05 Component-Based Software </XMLSchema:complextype> O. Leifler, IDA, Linköpings universitet. 23 Example (cont.): WSDL Interface Definition <wsdl:definitions [name space definitions]> <wsdl:types> … </wsdl:types> <wsdl:message name=“addTreatmentSOAPIn”> <part name=“parameters” element=“addTreatment”/> </wsdl:message> <wsdl:message name=“addTreatmentSOAPOut”> <part name=“parameters” element=“addTreatmentResponse”/> </wsdl:message> <wsdl:porttype name=“TreatmentAdminSOAP“> Actual interface <wsdl:operation name=“addTreatment“> <wsdl:input message=“addTreatmentSoapIn“/> <wsdl:output message=“addTreatmentSoapOut“/> </wsdl:operation> </wsdl:porttype> <binding [binding to SOAP / HTTP Protocols] …> <wsdl:service name=”TreatmentAdminSOAP”> ... <wsdl:port binding=”...” name=”...”> <soap:address location=”http://localhost:8080/soap/servlet/rpcrouter”/> </wsdl:port> </wsdl:definitions> O. Leifler, IDA, Linköpings universitet. 24 TDDD05 Component-Based Software Binding Binding maps WSDL messages (as defined in portType) to a messaging layer: • encoding (e.g. SOAP, RPC) and • protocol (e.g. HTTP, SMTP, FTP) <wsdl:binding name=”livetoken” type=”Token”> <soap:binding style=”document” SOAP messages will be bound to HTTP transport=”http://schemas.xmlsoap.org/soap/http”/> <operation name=”GetLastPrice”> <soap:operation soapAction=”http://www.stocktrade.com/GetPrice”/> <input> <soap:body use=”literal”> </input> <output> <soap:body use=”literal”> </output> </operation> <wsdl:binding> O. Leifler, IDA, Linköpings universitet. 25 TDDD05 Component-Based Software WSDL Advantages WSDL abstracts from underlying Protocol Binding to HTTP, SOAP, MIME, IIOP, etc. Component model Mappings to CORBA, EJB, DCOM, .NET are available Advantages: Contrary to all component models seen so far, WSDL unifies call and event ports And abstracts from the underlying component model, introducing the component model as a secret O. Leifler, IDA, Linköpings universitet. 26 TDDD05 Component-Based Software WSDL Service Interface + W3C Standard (WSDL 2.0 May 2007, www.w3.org/TR/2007) + Imitates Interface Definition Languages e.g. CORBA IDL + Part of BPEL (see later) - No inheritance on WSDL - Not recursively composable Approach Components of Web Services Exists WSDL Service Description Exists SOAP Messaging Exists XML Message Description Exists HTTP, FTP, IIOP,... Network O. Leifler, IDA, Linköpings universitet. 27 TDDD05 Component-Based Software Web service catalogization and discovery UDDI Server “Where is a webservice for XY?” “register my web service for XY” Web Service Provider O. Leifler, IDA, Linköpings universitet. Client 28 TDDD05 Component-Based Software Offer and Find Web Services Standardized registry, publishing, advertisement … Extended name server, describing interface and properties XML Descriptor White Page: Yellow Page: Green Page: Address Semantics (based on standard taxonomy) Technical specification of service Logically central, physically distributed data base A web service itself Universal Description, Discovery and Integration (UDDI) O. Leifler, IDA, Linköpings universitet. 29 TDDD05 Component-Based Software UDDI White Page Registered (and other) names Service Description Contact person (name, e-mails, …) Telephone/fax number Web site … Yellow Pages Service category Type of industry Type av products/services Geographic localization … Green Pages O. Leifler, IDA, Linköpings universitet. Offered service (WSDL interfaces) Documentation, description Principles cooperation realization … 30 WSDL WSDL TDDD05 Component-Based Software UDDI, WSDL, and SOAP in a Web Service Interaction UDDI Registry WSDL Document 2 2 4 Web Service 4. WSDL document provides metadata to interact with Web service 5. Client sends SOAP message request 5 Client 6 O. Leifler, IDA, Linköpings universitet. 2. Registry refers client to WSDL document 3. Client accesses WSDL document 3 1 1. Client queries registry to locate service 31 6. Web service returns SOAP message TDDD05 Component-Based Software response UDDI, coming features Current OASIS standard is UDDI v3.02 (2005, working group closed 2010) www.uddi.org O. Leifler, IDA, Linköpings universitet. 32 TDDD05 Component-Based Software Offer and Find Services - Required and approached. UDDI v.3 (2003) by OASIS UDDI TC - made part of the Web Services Interoperability consortium (WS-I) - Public registries for test existed until 2006. - Microsoft has abandoned UDDI in favor of BizTalk. Approach Components of Web Services ?? UDDI Service Discovery ?? UDDI Service Publication Exists WSDL Service Description Exists SOAP Messaging Exists XML Message Description Exists HTTP, FTP, IIOP,... Network O. Leifler, IDA, Linköpings universitet. 33 TDDD05 Component-Based Software TDDD05 Component-Based Software Business Processes on the Web with BPEL BPEL = WS-BPEL = BPEL4WS = Business Process Execution Language for Web Services Ola Leifler, IDA, Linköpings universitet Business Process How to define a business process on the web? There are many languages proposed today: WSFL, WSCL, WSCI, XLANG, WSEL, UML2, WSUI, WSXL, BPML, BPMN, … IBM & Microsoft: BPEL, BPEL4WS, WS-BPEL OASIS: WS BPEL www.oasis-open.org WS-BPEL 2.0 Jan. 2007 Business Process (common task) O. Leifler, IDA, Linköpings universitet. 35 TDDD05 Component-Based Software Ingredients... BPEL is an architectural language for web services Based on workflow languages Orchestration of business processes Invoke web services Mixing control and data flow operators BPEL is a composition language Composing Relying new web services from existing ones, using their ports on messages (events) and calls BPEL builds on WSDL For service interface descriptions BPEL adds connections (partner link types) O. Leifler, IDA, Linköpings universitet. 36 TDDD05 Component-Based Software Side Stepping: Which Operational Specifications Exist? Data flow graphs Data flows through operations Activity diagrams: data flows through actions Control-flow graphs Nodes are control-flow operations that start other operations on a state Mixed approaches Program dependence graph; Static-single-assignment graphs, SSA Cycles are marked by phi-nodes that contain control-flow guards Statecharts: Petri Events trigger state transitions nets, UML2 activity diagrams: tokens mark control and data-flow Workflow languages: mix control and data-flow, similar to activity diagr. O. Leifler, IDA, Linköpings universitet. 37 TDDD05 Component-Based Software Background: UML Activity Diagrams Based on Petri Nets Dual to State Machines In UML 2.0 O. Leifler, IDA, Linköpings universitet. 38 TDDD05 Component-Based Software Workflow Languages A workflow language specifies control and data flow over a set of operations The operations need not be executed automatically, but can be performed by humans The workflow allows concurrency, because it must model the business process of a company Workflows are closely related to Colored Petri Nets and dual to statecharts Examples: ARIS system for SAP [IDS Scheer, Saarbrücken] FlowMark Lotus YAWL [IBM] Domino [IBM] [van der Aalst, Eindhoven]: based on Colored Petri Nets UML2 Activity O. Leifler, IDA, Linköpings universitet. Diagrams 39 TDDD05 Component-Based Software Typical Operations in Workflow Languages AND-split: all Activity Token Example: AND-split XOR-split: 1 of n OR-split: m of n AND-join: all of n XOR-join: 1 of n Example: OR-join: m of n AND-join O. Leifler, IDA, Linköpings universitet. 40 TDDD05 Component-Based Software Workflow Engines Workflow engines are interpreters of workflows They manage the concurrency in a workflow and synchronize all processes Usually, they also support interactive applications Undo Transactions with rollback and commit Compensation (in case of error) They are, for web services and component systems, composition engines that execute a composition program O. Leifler, IDA, Linköpings universitet. 41 TDDD05 Component-Based Software BPEL Made Simple BPEL is an activity-diagram like language, with concurrency and transactions with different kind of join and split operators with ports and connections BPEL can be edited graphically, and has an XML abstract syntax Creating a web service becomes a similar activity to editing an UML activity diagram O. Leifler, IDA, Linköpings universitet. 42 TDDD05 Component-Based Software BPEL Specification Structure Process definition Header with namespace declarations Variables: global variables of the process PartnerLink declarations: interface declaration with whom is the process connected? Partners: actual partners of the communication Correlation sets: Which instance of a process is talking to which other instance? Fault handler: What happens in the case of an exception? Compensation handler: compensation actions Event handler: what happens in case of a certain event? A (structured) main operation: e.g., sequence or flow O. Leifler, IDA, Linköpings universitet. 43 TDDD05 Component-Based Software WSDL Definitions as a Basis BPEL uses WSDL definitions to define types, message types, and port types WSDL definitions Bindings deployed – can be without binding can be added when the BPEL process is Statically / at deployment time / dynamically (lookup) / dynamically (callback) That increases reuse of the process This achieves component model transparency (independence of the underlying component model) BPEL adds partner link types (connector types) which are typed connections O. Leifler, IDA, Linköpings universitet. 44 TDDD05 Component-Based Software A Simple Pizza Order in BPEL <!-- Process definition --> <process name=”OrderPizza” suppressJoinFailure=”yes” xmlns=”http://schema.xmlsoap.org/ws/2003/03/business-process” pns=”http://www.pizza.org/schema”> <partnerLinks> <partnerLink name=”PizzaService” partnerLinkType=”pns:OrderChannel” myRole=”PizzaOrderer”> Connector </partnerLinks> <!-- Global Variables --> <variables> <variable name=”input” messageType=”PizzaOrder”/> <variable name=”output” messageType=”PizzaDelivery”/> </variables> <faultHandlers> ... </faultHandlers> <sequence name=”body”> <invoke name=”order” partnerLink=”PizzaService” portType=”PizzaOrderPort“ operation=”body” variable=”output”> <receive name=”acknowledgement” partnerLink=”PizzaService” portType=”PizzaServicePort“ operation=”body” variable=”input”> </sequence> O. Leifler, IDA, Linköpings universitet. 45 TDDD05 Component-Based Software BPEL composes services in abstract services at the port type level, not at the port/instance level. To execute, we must bind each partnerLink along which a partner is invoked to a concrete endpoint. Partner links BPEL BPEL Process ”OrderPizza” PartnerLink ”PizzaOrder” Process ”DeliverPizza” partnerLinkType ”OrderChannel” PartnerLink ”PizzaOrder” Role Role ”PizzaOrderer” ”PizzaService” PLType=”OrderChannel” myRole=”PizzaOrderer” PLType=”OrderChannel” myRole=”PizzaService” receive invoke WSDL WSDL sequence portType portType ”PizzaServicePort” ”PizzaOrderPort” Operation Operation ”order” ”acknowledgement” receive invoke Figure partly adapted from S. Weerawarana et al.: Web Services Platform Architecture, 2005. O. Leifler, IDA, Linköpings universitet. 46 TDDD05 Component-Based Software Flow Operations are Workflow Graphs The <flow> operation is structured as a workflow graph The names of messages, ports, partner links help to span up the graph <flow> executes its sequences in parallel <links> denote dependences between tasks <flow> <links><link name=”A”> </link> <link name=”B”> </link> A </links> <sequence>..<invoke> <source name=”A”>..</sequence> B <sequence>....<target name =”B”>...........</sequence> </flow> O. Leifler, IDA, Linköpings universitet. 47 TDDD05 Component-Based Software Other BPEL Operations Primitive activities Structured control-flow invoke ... a WSDL-described operation sequence – serial composition receive – wait for message switch wait ... for some time while flow assign – copy data from one data container to another – parallel composition pick (XOR join) – nondet. choice terminate reply ... to external source throw scope – group activities for ... an exception O. Leifler, IDA, Linköpings universitet. (can be nested) common exception handler 48 TDDD05 Component-Based Software BPEL Tools Oracle BPEL Process Manager (formerly Collaxa designer) www.oracle.com BPMN graphical frontend modeling language for BPEL Looks similar to UML2 Activity Diagram notation (more symbols for transactions, specific events, …) Tools: Orchestra designer WebSphere Studio, … (open source, Eclipse plugin), IBM www.omg.org/docs/formal/08-01-17.pdf People work on the translation of Colored Petri Nets and UML activity diagrams from and to BPEL Colored Petri Nets have good formal features and can be used for deadlock checking, etc. E.g., YAWL [van der Aalst] O. Leifler, IDA, Linköpings universitet. 49 TDDD05 Component-Based Software BPMN Business Process Modeling Notation [OMG 2006] www.bpmn.org UML Activity diagram like modeling language for business processes Based on Petri Nets Nodes 1: Activities, Events, Gateways (branch/fork/join) Nodes 2: Data objects (e.g. messages), Start state, End state, … Edges: Sequence (control flow), Message flow, Association Grouping/Scoping: Swimlanes, Group Zoom-in/-out to subprocess view Special support for transactions, undo, exception flow, … De-facto standard for process modeling Good tool support Too few ”service interaction patterns” pre-defined needs extensions Not entirely equivalent to BPEL O. Leifler, IDA, Linköpings universitet. 50 TDDD05 Component-Based Software Receive Invoice + Order + Receive Pizza Send Invoice + + O. Leifler, IDA, Linköpings universitet. Send Pizza PIZZABAKER Place Pizza Request Place Invoice Request PAYMENT ORG. PIZZA-SERVICE ORDERPIZZA BPMN Example Figure adapted from G. Decker: Choreografiemodellierung – Eine Übersicht, Informatik Spektrum 31(2), April 2008 TDDD05 Component-Based Software 51 Model Verification Check for structural incompatibility e.g., mismatch in message types Check for behavioral incompatibility Deadlock Transfer money PIZZABAKER example: PAYMENT ORG e.g., deadlock risk O. Leifler, IDA, Linköpings universitet. Send pizza 52 I do not pay for the pizza before it has been sent to the pizza orderer I do not send the pizza before the money has arrived TDDD05 Component-Based Software Business Process Approach Components of Web Services Evolution BPEL BPMN WSCI Workflow ?? UDDI Service Discovery ?? UDDI Service Publication Exists WSDL Service Description Exists SOAP Messaging Exists XML Message Description Exists HTTP, FTP, IIOP,... Network O. Leifler, IDA, Linköpings universitet. 53 TDDD05 Component-Based Software Trust and Security Integrity: intact, unchanged Confidentiality: encryption policy Authentication: proof of identity Authorization: access to execute certain services Non-Repudiation: warranty on failure Legal Rights: copyrights, reselling rights, ... Privacy: handling personal data ... O. Leifler, IDA, Linköpings universitet. 54 TDDD05 Component-Based Software Trust and Security OASIS standard (2003, 2006) v1.1 Converging BPEL BPMN WSCI Work Flow UDDI Service Discovery ?? UDDI Service Publication Exists WSDL Service Description Exists SOAP Messaging Exists XML Message Description Exists HTTP, FTP, IIOP,... Network 55 Security ?? O. Leifler, IDA, Linköpings universitet. Exists WS-Security Components of Web Services TDDD05 Component-Based Software Technical Conclusion Defined with XML Web Services minimum WS-Security BPEL BPMN WSCI UDDI UDDI WSDL SOAP XML HTTP, FTP, IIOP,... O. Leifler, IDA, Linköpings universitet. 56 TDDD05 Component-Based Software Limitations of Classical Component Systems Different basic communication of the systems, CORBA components cannot talk directly with COM components etc. Adaptation on technical level necessary Not full remote transparency Dependence on the component model O. Leifler, IDA, Linköpings universitet. 57 TDDD05 Component-Based Software Web Services – Component Model Transparency Language adaptation: XML Schema + WSDL Location transparency: SOAP (+ HTTP) Component model transparency (EJB, COM+, CCM, ...) Remote Client Java Local Client C Server C++ EJB CCM COM+ WSDL WSDL WSDL SOAP (HTTP) Local SOAP (HTTP) Remote O. Leifler, IDA, Linköpings universitet. 58 TDDD05 Component-Based Software TDDD05 Component-Based Software Web Services and Java Ola Leifler, IDA, Linköpings universitet Java and Web Services Java offers APIs and tools for manipulating XML files and for generating SOAP messages to interface with web services JAXP, JAXB, JAXRPC, JAXM, JAXR, ... Technical requirements: Java JDK Apache Axis (plug-in for Tomcat application server) Framework for constructing SOAP processors for clients and servers Generation of WSDL via a Java API (or automatic creation from class file) Generation of Java stubs and skeletons from WSDL (or using POJO) Tomcat application server tomcat.apache.org Apache HTTP server httpd.apache.org O. Leifler, IDA, Linköpings universitet. 61 TDDD05 Component-Based Software Java and Web Services Necessary Java APIs: JAXP (XML processing), JAXB (XML binding), JAX-RPC (XML-based RPC), JAXM (XML messaging), JAXR (XML registries) O. Leifler, IDA, Linköpings universitet. 62 TDDD05 Component-Based Software TDDD05 Component-Based Software Evaluation of Web Services as composition system Ola Leifler, IDA, Linköpings universitet Component Model Mechanisms for secrets and transparency: very good Location, language, component model transparency Communication protocol transparency Generic BPEL Web Services (without bound WSDL ports) O. Leifler, IDA, Linköpings universitet. 64 TDDD05 Component-Based Software Composition Technique Mechanisms for connection Protocol WSDL transparency allows for flexible connections binding is flexible Mechanisms for aspect separation Mechanisms for Meta-modeling Used Scalability: Better Changes of protocol possible Changes of distribution easy Changes of workflow easy O. Leifler, IDA, Linköpings universitet. 65 TDDD05 Component-Based Software Composition Language BPEL workflows are a nice composition language Not yet full exchangeability of connector types But graphic support for workflow specifications Metacomposition is possible... The generation of a BPEL script is easy, because it is XML based BPMN modeling language as frontend to BPEL Environments such as Oracle/Collaxa BPEL server will generate workflow from other specifications Generic workflow architectures will be possible O. Leifler, IDA, Linköpings universitet. 66 TDDD05 Component-Based Software Web Services as Composition Systems Component Model Composition Technique Contents: Completely hidden Adaptation: well supported Binding points: WSDL ports Automatic transactions, recovery Several types of connectors Composition Language BPEL is a workflow language for orchestrating web services Implicit connectors for architecture O. Leifler, IDA, Linköpings universitet. 67 TDDD05 Component-Based Software Wrap-up The Ladder of Component and Composition Systems Aspect Systems View Systems Aspect Separation Composition Operators Aspect/J Architecture Systems Software Composition Systems Composition Language Invasive Composition Static Metaprogramming Darwin Skeletons Architecture as Aspect CoSy Web Services BPEL SOP Web services (excl. BPEL) Global Interoperability .NET CORBA Beans EJB COM Classical Component Systems Standard Components Object-Oriented Systems Objects as Run-Time Components C++ Modular Systems Modules as CompileTime Components Modula O. Leifler, IDA, Linköpings universitet. 68 Java Ada-85 TDDD05 Component-Based Software