Smart Monitors for Composed Services Luciano Baresi baresi@elet.polimi.it Carlo Ghezzi carlo.ghezzi@polimi.it Sam Guinea guinea@elet.polimi.it Politecnico di Milano Dipartimento di Elettronica e Informazione ABSTRACT Service-based approaches are widely used to integrate het- erogenous systems. Web services allow for the definition of highly dynamic systems where components (services) can be discovered and QoS parameters negotiated at run-time. This justifies the need for monitoring service compositions at run-time. Research on this issue, however, is still in its infancy. We investigate how to monitor dynamic service compositions with respect to contracts expressed via assertions on ser- vices. Dynamic compositions are represented as BPEL pro- cesses which can be monitored at run-time to check whether individual services comply with their contracts. Monitors can be automatically defined as additional services and link- ed to the service composition. We present two alternative implementations of our monitor- ing approach: one based on late-binding and reflection and the other based on a standard assertion system. The two implementations are exemplified on a case study. Keywords Web Services, BPEL, quality of service, functional require- ments, pre- and post-conditions, composition, monitoring, .NET, XlinkIt, exception handling 1. INTRODUCTION Web services allow for the definition of highly dynamic software systems whose components (services) can be dis- covered at run-time and QoS parameters negotiated during enactment. WSDL provides components with a standard in- terface and UDDI registries act as agencies which advertise services and allow clients to select the features needed to ex- ecute their business processes. The freedom and flexibility of such an approach, where components only interact through XML data, still needs to be thoroughly investigated. Web services are composed in order to offer more complex services. Service composition languages include BPEL [4], where a single process orchestrates interacting services, and Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. ICSOC’04, November 15–19, 2004, New York, New York, USA. Copyright 2004 ACM 1-58113-871-7/04/0011 ...$5.00. WSCI [19] which supports a more decentralized composi- tion with the different services that describe their role in the overall choreography. These compositions are often dec- orated with information about the QoS negotiated between the client, i.e., the business process, and the providers. Pro- posals like SLA [12], WSOL [20], and WS-Policy [3] move towards a more semantic composition of services and help the designer embed non-functional requirements (quality pa- rameters) in the cooperation. These approaches mainly concentrate on modeling the busi- ness process in terms of interacting Web services, but do not consider the behavior of such models at run-time. They do not consider how to enforce or simply probe the con- straints on the composition. This is the key problem in our approach. We envision a dynamic situation where compo- sitions are formed by assembling components selected from a serviceful environment at run-time. Selection is accom- plished by matching the specifications of requested opera- tions with the interfaces published by available services. As- sertions are used to specify the behaviors 1 of both required and offered operations. Their matches define the contracts between requestors and providers. In this paper we do not address the problem of establishing the binding between service requests and offers. We con- centrate instead on how to monitor conformance between the specified service behavior and the actual service selected by the matching mechanism that establishes such binding. Such conformance can only be checked dynamically since we assume that actual services can leave or join the envi- ronment in a fully unpredictable fashion. To investigate the monitoring problem we assume that bound compositions are described as BPEL processes. We illus- trate a solution that allows the services invoked by a BPEL process to be dynamically monitored for conformance. As we mentioned, specifications are given in terms of predicate logic as assertions (mainly pre- and post-conditions). Our proposal recalls the use of assertion languages, such as Anna [8] and APP [7], which were proposed to specify constraints via program annotations. The critical difference that makes this approach more interesting in SOA scenar- ios is that we are called to engage ephemeral configurations where reasoning on systems as a whole is more difficult and where, in many cases, no stake-holder has the knowledge to do so. In our case, annotations are stated as comments in the source BPEL program and then translated to generate a target monitored BPEL program. In addition to monitor- 1 Service requests should also specify non functional proper- ties. These are ignored here for simplicity.