Remote Batch Invocation for Web Services Document-Oriented Web Services with Object-Oriented Interfaces Ali Ibrahim, William R. Cook Dept. of Computer Science University of Texas at Austin {aibrahim,wcook}@cs.utexas.edu Marc Fisher II, Eli Tilevich Dept. of Computer Science Virginia Tech {fisherii,tilevich}@cs.vt.edu Abstract—The Web Service Description Language defines a service as a procedure whose inputs and outputs are structured XML data values, sometimes called documents. In this paper we argue that document-oriented interfaces can be viewed as batches of calls to finer-grained procedural interfaces. Turning this correspondence around, we show that flexible documents can be specified by converting a block of fine-grained invocations into a batch document. Batch blocks can also include conditionals and loops. Our system, Remote Batch Invocation for Web Services, translates object-oriented interfaces into a WSDL describing batches of calls. The WSDL can be used by standard web service clients, but by providing a language extension to support remote batches, our approach features a fully integrated client environment. The result is a powerful infrastructure for web services that directly connects to standard object- oriented interfaces, with tool support to automatically create and decode documents. We have used our infrastructure to create a Web server wrapper for the Amazon Associates Web service, which shows that remote batches can support a clean object-oriented programming model over a stateless web service. I. I NTRODUCTION A web service is a remote invocation in which the world wide web is used as the transport protocol. Although some web services resemble traditional remote procedure calls (RPC) [1], document-oriented services [2], [3] and representation state transfer (REST) [4] are becoming more prevalent. In this paper, we focus on document- oriented web services that use the Simple Object Access Protocol (SOAP) to send and receive structured XML documents [5]. The document-oriented approach is flexible; documents can represent complex objects (e.g., purchase orders, med- ical information), complex actions (e.g., creation, multiple updates, bulk removal, or specialized operations), queries, or combinations of these forms. Despite this complexity, there is no standard methodology for detailed design of service documents or specification of their semantics. Remote Batch Invocation for Web Services (RBI-WS) is a new approach to document-oriented web services supporting object-oriented interfaces. We show how fine- grained object interfaces can be translated into a web ser- vice interface (WSDL) whose instances describe batches of fine-grained calls. The translation is bi-directional, the web service interface can be translated back into fine- grained object interfaces for use by the client. RBI-WS is supported by several tools. At design time, tools translate between WSDL interfaces and collections of object interfaces. A runtime server library supports automatic interpretation of batch web service documents, by executing each of the primitive object calls specified in the batch. A batch can contain conditionals and iterations, in addition to sequences of basic calls. A client library can be used to create batches. Finally, an extension of java with a batch statement is compiled by a source-to-source translator that replaces batch statements with appropriate calls to the client library. Standard SOAP/WSDL tools, for example Apache Axis [6], can also be used to access batch services. We evaluate RBI-WS by redefining an existing web ser- vice, in this case part of the Amazon Wed Service (AWS) suite. Our demonstration highlights the expressiveness and flexibility of using RBI-WS to build web services, while indicating that it could also provide performance and code size reduction advantages. RBI-WS is an extension of our previous work [7] on batches for Java Remote Method Invocation (RMI). The contributions of this paper are the design of a mapping between batches and web service documents (WSDL), and a demonstration that batches are a natural generalization of an existing document-oriented service. This work is a first step toward a more systematic approach to design of web service documents. II. DOCUMENTS AND I NTERFACES It is well known that code can be represented as a docu- ment; code in most languages can be expressed as abstract syntax trees. Conversely, one might wonder whether it is reasonable for documents to be understood as batches of operations? To address these questions, we first consider what a “document” is and how it is used. The interface of a web service defines a language of legal inputs. A sentence in this language is a document. A document can be viewed as having a mix of data and operations to perform on the data. If the operations can be composed in different ways such as batching, sequencing, and branching, then it makes sense to think of the document as representing code. We argue this is often the case in large services. Because performance and flexibility are important, the web service allows clients to compose multiple operations in a single document. We will think of each individual operation in a docu- ment as a method in the server API. How to divide the document into data and operations is subjective; it depends on how the programmer would like to think about the document. A. Documents as Collections of Calls To illustrate the correspondence between documents and calls on an API, we will examine a couple of real-world input documents. The code listing in Figure 1 shows a