Transcription

1 JOURNAL OF SOFTWARE, VOL. 9, NO. 8, AUGUST The Design and Implementation of Unified Invoking Component Based on Web s Framework Wenpeng Su a, Zhonghua Yan a,b, Chenghui Liang a a School of Mechanical, Electrical and Information Engineering, Shandong University, Weihai , China b Integrated Electronic Systems Lab Co. Ltd., Jinan 25000, China Abstract Web s is a platform which enables the applications interoperate on the Internet. It is widely used in designing and building systems in open and dynamic distributed environments such as EAI (Enterprise Application Integration) and B2B (Business to Business). As the development of framework technology, it is convenient and standardized to use framework to develop web applications. For Web s, the frameworks Axis, Axis2, XFire and CXF are widely used. By the performance testing of the four frameworks, this paper not only introduces the four framework but also analyzes the differences of the four frameworks, and then makes some suggestions for developers to choose the appropriate one. The framework can simplify the development process and decrease the development time. However, because of the differences of the frameworks, the interoperation between different web service s server and client may cause incompatible problems. This paper analyzes the reasons of this incompatible problems and finally presents a mechanism based on unified invoking component to solve this problems. By parsing and repacking the messages, the incompatible problems between client and server can be solved successfully. Index Terms Web s, WSDL, SOA, performance testing, unified invoking component, framework I. INTRODUCTION AS the information technology develops constantly and the capability of the Internet improves gradually, more and more application systems are established on Internet. Web s is a software component independent from platform and realization, which enables the applications interoperate on the Internet and publish, discover and invoke services through Web. Web s is an implementation of SOA ( Oriented Architecture) and can compose different units of application programs through neutral interfaces in order to realize loose coupling between different applications []. By using the standard protocols such as XML,, UDDI, and WSDL, Web s has good encapsulation and strong integration capabilities and is widely used in the area of EAI (Enterprise Application Integration) and B2B (Business to Business). In order to simplify and standardize the development process, frameworks are widely used in all field of software. For example, it s very convenient to use Hibernate *Corresponding author, and Spring for web application developers. In the field of Web s, there are four famous frameworks called Axis, Axis2, XFire and CXF. All of the frameworks encapsulate the low-level information and provide powerful development APIs for developers, which can really reduce the development difficulty and save development time. The QoS (Quality of ) refers to resource reservation control mechanisms, and it is an ability to provide different priority to different applications, or to guarantee a certain level of performance to a data flow [2]. QoS can be objective (encompassing reliability, availability, and request-to-response time) or subjective (focusing on user experience) [3]. For web service, it s necessary to evaluate the performance of the service [4]. Performance testing is a generic term that can refer to many different types of performance-related testing such as performance test, load test, stress test and capacity test. All of them are executed to determine how a system performs in terms of responsiveness and stability under a particular workload [5] [6]. All the four Web s frameworks provide high quality of service and reliable message transmission. Besides, Axis2 and CXF support standards such as WS- Policy, WS-Security and WS-Reliable Messaging. This paper will analyze the performance of service based on the four frameworks in order to test the performance of the framework. Finally, the result of the performance testing will be given and suggestions will be provided for developers in order to help them to choose the appropriate framework. However, the interoperation between different service s server and client may cause incompatible problems. For example, the client developed by Axis2 can not always invoke the web service based on CXF directly. This incompatible problems decrease the generality of the web service. WSDL is used to describe web service [7] [8]. By some targeted test, this paper analyzes the WSDL files produced by different frameworks on the same service, and finally gets the conclusions that the reasons of the incompatible problems are the differences of WSDL file. For the same service, different frameworks generate different WSDL files. The differences will be introduced in this paper. Like in [9], by analyzing the WSDL file s differences and repackaging the messages, this 204 ACADEMY PUBLISHER doi:0.4304/jsw

2 2074 JOURNAL OF SOFTWARE, VOL. 9, NO. 8, AUGUST 204 paper presents a mechanism based on unified invoking component. By deploying a unified invoking component between the client and server, the incompatible problems can be solved successfully. The rest of this paper is organized as follows. Section II provides an overview of Web s technology and summarizes the main technology used in Web s. In section III, the architecture and use method of the four frameworks will be introduced. Then, the performance testing of the four frameworks will be introduced in section IV and the WSDL differences of different frameworks will be presented in section V. In section VI, this paper will introduce the design and implementation of the unified invoking component. Finally, conclusions are made in section VII. II. WEB SERVICES TECHNOLOGY Software delivery models are changing constantly: from standalone applications to client-server architecture, then from browser-server architecture to service oriented architecture. SOA is a software design architecture which connects different units of application programs through good defined interfaces. Interfaces are defined in neutral ways in order to realize loose coupling between services.the SOA architecture makes sure the software can select and invoke components dynamically. The architecture of SOA and the interoperation of each components are shown in Fig.. Web s is an implementation of SOA and it aims to simplify the interoperation among different systems by defining a standardized mechanism to describe, locate, and communicate with applications on the web. In [0], the authors divided the Web s architecture into three areas - communication protocols, service descriptions, and service discovery. A. Communication protocols In order to communicate with applications in different platform, the communication mechanism must be platform-independent, secure and as lightweight as possible. (Simple Object Access Protocol) is a protocol specification for exchanging structured information in the implementation of Web s. It relies on XML for its message format, HTTP or SMTP for its Application Layer protocols and RPC for its call method []. is independent from hardware, platform and programming language. messages are composed by envelope and attachments. Envelope is made up by header, body and fault. The body contains the request and response messages. Publish WSDL Register Provider Find UDDI Bind Consumer Consumer Provider Register 3.Find services. 5.Bind services..publish service. 2.Register service. 4.Set up proxy. Figure. SOA architecture and component interoperation. Port -binding Binding -porttype WSDL Definition Port Type Message..* Operation -message Figure 2. The Structure of WSDL document. Types Data Type -simpletype -complextype Part -name -element what Web s do, where it is and how to access it [2]. A WSDL document is defined by a service provider and used by service consumers. The structure of WSDL document is shown in Fig. 2. It is divided by two parts: the interface document and the implementation document. The interface document is a container which is used to describe the abstract service. It is independent of implementation. The implementation document describes the details of the concrete service and deployment information such as part, operation and binding. C. discovery UDDI (Universal Descriptions, Discovery, and Integration) is a platform-independent, XML-based registry. It provides a mechanism to register and find web service applications [3]. By UDDI, the services can be resisted and the consumer can find and invoke services [4]. The transmission process of the UDDI message is shown in Fig. 3. By this process, the client can obtain the service methods and invoke the service. B. descriptions WSDL (Web s Description Language) is a XML-based interface description language which is used for describing the functionality ordered by Web s. WSDL defines a service s abstract description in terms of messages exchanged in a service interaction. It explains III. WEB SERVICES FRAMEWORK Web s frameworks such as Axis, Axis2, XFire and CXF are widely used in the development of web service. All of them provide well-defined framework and easy-use methods in order to make the development of web service easy and normalized. 204 ACADEMY PUBLISHER

3 JOURNAL OF SOFTWARE, VOL. 9, NO. 8, AUGUST Client UDDI request UDDI response APIs HTTP server UDDI registry Process UDDI API request server Client Application Request Response Client Engine Transport Request Response Server Engine Handlers Target Registry data Figure 4. Architecture of Web s frameworks. Define service interfaces Generate WSDL files Publish web service Request message Response message Figure 3. Transmission process of UDDI message. A. Axis Axis is the abbreviation of Apache Extensible Interaction System. It is essentially a engine framework for constructing processors [5]. Axis framework achieves the interoperability of messages between server and client. Axis supports standard protocol and offers tools for monitoring TCP/IP packages and convert tool between WSDL and Java code, such as WSDL2Java and Java2WSDL. It provides two approaches to publish web service: Instant Deployment and Custom Deployment. B. Axis2 Axis2 is an engine of Web s, and WSDL. It is not developed on the basis of Axis but is redesigned with new architecture. This new architecture is more flexible, efficient, and configurable in comparison to Axis s architecture. What s more, Axis2 is built on Apache AXIOM, a new high performed, pull-based XML object model [6]. It uses its own object mode and StAX (Streaming API for XML) parsing to achieve significantly greater speed. Compared with Axis, Axis2 is more efficient, more modular and more XML-oriented. Moreover, there are two implementations of the Apache Axis2 Web services engine - Apache Axis2 for Java and Apache Axis2 for C++. C. XFire Codehaus XFire is the next-generation Java framework. The core of XFire is light message processing mode based on StAX which is used to exchange messages with message. XFire supports different types of band mechanism, container and transport protocol. It also supports, WSDL, WS-I Basic Profile, WSAddressing, WS-Security, supports Spring framework and the code generation of server and client [7]. D. CXF CXF is the continuation of XFire project and is regarded as XFire 2.0. CXF helps us build and develop Implement interfaces and add business logic Generate client Figure 5. Development procedure of Web s frameworks. services using frontend programming APIs, like JAX-WS and JAX-RS. CXF supports both contract first development with WSDL and code first development starting from Java [8]. Besides, CXF and Spring have been integrated well, which making the developments of Web s more convenient. Although the implementation and the performance of the four frameworks are different, the architecture and the development procedure of the four frameworks are mainly the same. The architecture is shown in Fig. 4. The whole framework is made by two parts. One is the client engine, the other is server engine. The client engine is used by client application to send requests and receive responses. The function of the server engine is to parse and pack the messages, then invoke the target service and return response messages [9]. The two parts are connected by transport which can be seen as a message dispatcher. The development procedure of the four frameworks is shown in Fig. 5. Firstly, we define service interfaces, including the service name and parameters and so on. Then, the WSDL files can be generated by the tool which is provided by the frameworks. And we should implement the interfaces and add business logic to complete the service on the server. As to the client, it can be autogenerated by the framework or written by developers. Finally, the client can call the service on the server through Internet. The framework is powerful and can really simplify the development procedure. But it is a troublesome thing to choose which frameworks to use. The performance testing of the four frameworks may give some suggestions. IV. THE PERFORMANCE TESTING OF THE FOUR FRAMEWORKS According to the development procedure mentioned above, we develop four web services of the same function based on the four frameworks. The service s class diagram is shown in Fig. 6. It contains two methods: testprimitive 204 ACADEMY PUBLISHER

4 2076 JOURNAL OF SOFTWARE, VOL. 9, NO. 8, AUGUST 204 and testreference. The testprimitive method is used to test the primitive types such as byte, double and so on. The testreference method is used to test the reference types such as class, interface and arrays. Next, we publish the service as web service by Axis, Axis2, XFire and CXF, and generate clients separately. We use the client to call the service and test the performance of the four frameworks. The Apache JMeter is open source software which is designed to load test functional behavior and measure performance. It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types. We can use it to make a graphical analysis of the performance of our web services under heavy concurrent load. There are some important indexes than can be used to evaluate the performance testing. ) Average time is the average response time of each request. It is an index which can be used to evaluate the response speed. 2) 90% Line means that 90% of the samples take no more than this time. The remaining samples take at least as long as the value. This is a standard statistical measure. 3) Throughput means the quantity of the successful request per second. It is supposed to represent the load on the server. 4) Error% is equal the value which is calculated by the number of the error requests divided by the total requests. It can be used to measure the stability of the service. The version of the framework is shown in Table I. In JMeter, thread is used to simulate the users who try to assess the server and invoke the service. We test 0 times for each frameworks, with the threads grows from 000 to 5500 in order to simulate the growth of the workload. The result of the performance testing is shown in Fig. 7. The horizontal axis represents the threads and the vertical axis represents average time, 90% line, throughput and error%. The average time shows that the Axis2 and CXF do better than Axis and XFire, which means that they have a quickly response time. 90% line shows that Axis2 and CXF have a high stability. Compare to Axis and XFire, Axis2 and CXF are more powerful in throughput. Finally, the four frameworks do well in dealing with errors in low thread. The performance testing of the four framework shows that Axis2 and CXF are better than Axis and CXF. This is no difficult to understand. Because of Axis2 using the Stax to parse XML, Axis2 is about 2 times faster than Axis. CXF is designed based on XFire and adopt advanced technology. We can also see that CXF performs as well as Axis2. It s really difficult to make a decision from the performance testing result. But in other aspect, Axis2 provide many visual tools and the service is deployed in servlet containers. So, it is easy and convenient to manage and configure the services. Besides, Axis support C++ and Java. CXF supports Spring, developing web service by configure XML, this makes it easy to develop web service and can integrate with other framework. This may TABLE I. TEST ENVIRONMENT Components JDK JRE Version I Impl +testprimitive(byte, char, int, short, long, float, double, boolean) +testreference(integer, List, Map, Integer[ ]) Figure 6. Class diagram of the service. give some suggestions for our developers when choosing web service framework. V. INCOMPATIBLE PROBLEMS BETWEEN DIFFERENT FRAMEWORK S SERVER AND CLIENT There are two ways to generate web service client. First, by using the tools provided by the frameworks to parsing the WSDL files, the client can be auto-generated. It is a fast way and there is no problem when we use tools to parse WSDL generated by the same framework. For example, we publish web service by Axis2 and generate WSDL files. Then we use Axis2 s tools to parse the WSDL files in order to generate client. There is no doubt that the client can call the web service successfully. But, what will happen if we use CXF s client tools to parse WSDL files which is generated by Axis? This may cause problems. Because of the differences of the four frameworks, the WSDL files of the same service are not the same. We compare the WSDL files generated by the four frameworks of the same service and get the differences in Table II. The differences include three parts. ) Target namespace is the concept in XML schema. In Axis s WSDL files, target namespace follows the format of HostName, PortName and sname are produced according to the server s hostname, port and the name of the service. For example, in this test, the target namespace of Axis is Besides, in Axis2 and XFire, the target namespace are while in CXF the target namespace is with a slash added. 2) The WSDL produced by Axis does not use schema files to restrict WSDL files. Data types are defined and used directly in the WSDL files. However, Axis2, XFire and CXF all use schema files to restrict WSDL files and quote schema files by the label wsdl:types. The definition and use of the data types is separated, which have a good flexibility. 204 ACADEMY PUBLISHER

5 JOURNAL OF SOFTWARE, VOL. 9, NO. 8, AUGUST Average Time %90Line ms 5 0 ms Throughput 0.05% Error 0.04% % requests/s % 0.03% 0.02% 0.02% 0.0% 0.0% 0.00% Figure 7. Results of the performance testing of different Web s frameworks. 3) The WSDL labels, as is shown in Fig. 2, vary from framework to framework. Message label is used to define the data type. Axis uses the data types directly by the property Name. However, Axis2, XFire and CXF all quote the data types defined in the external schema files by the label Element. The label porttype is made up by a group of abstract operations and relevant messages. In Axis and CXF, the content of this label is the name of the web service. But in Axis2 and XFire, the contents of this label conform to the rule of Name+PortType. The label is used to describe the interfaces of the Web s. In Axis and CXF, the contents of this label follow the format of Name+. However, in Axis2 and XFire the content of this label is the name of the web service. Because of the differences above, not all the clients generated by the four frameworks can call the service successfully. So, we can use the second way to generate web service client. We write the client manually by using the client APIs provided by the frameworks. In this way, developers should parse the WSDL files and extract parameters like target namespace, method name and so on. It is time-consuming and easy to make mistake. So, we want to deploy an unified invoking component to call the services based on different frameworks in spite of which client we use. By this component, we can use framework s tools to generate client in order to save development time, and at the same time, the incompatibility existed in the web service client can be eliminated. VI. DESIGN OF THE UNIFIED INVOKING COMPONENT Through the analysis above, we know that the WSDL differences produced by different frameworks are the reasons of the incompatibility exist in different web service client. To solve this problem, we can deploy a unified invoking component in the client. The architecture of the component is shown in Fig. 8. It works like a proxy server. The main function of the unified invoking component is to receive request messages from different clients and then repack the messages in order to call the service on the server. After the call processes succeed, the component receives the result messages and transmits the results to client. By this mechanism, the diversity among different frameworks can be eliminated. 204 ACADEMY PUBLISHER

6 2078 JOURNAL OF SOFTWARE, VOL. 9, NO. 8, AUGUST 204 TABLE II. THE WSDL DIFFERENCES ON THE SAME SERVICE. WSDL difference Web s framework Target Namespace Schema None XML Schema Message Use directly by the property Name Use schema files by wsdl:types PortType Name Name+PortType Name Name+ Name Name+ The unified invoking component is made up by three modules: Transport, Client-to-Server and Server-to- Client. The functions of each module are as following: ) Transport is an injection point. It used to receive request messages of different framework client and transmit the response messages to server according to the URL of the service. It works like a two-way message pipe which is used to dispatch message. 2) The module Client-to-Server is made up by three parts, parser, WSDL parser and wrapper. The parser is used to parse the request messages and extract the message such as the location of the web service, method name, and request parameters. The function of WSDL parser is to parse the WSDL files of the target web service and generate requests message that meet the requirement. Finally, the wrapper packs the messages with the parameters extracted from the parser and send them to the server. 3) The module Server-to-Client is used to parse the respond messages from the server and transmit the message to client. It is made up by parser and wrapper. Firstly, the parser receives the response message and extracts the result. Then, the wrapper packs the message with this result and sends it to the client. The procedure of the unified invoking component is shown in Fig. 9. The client calls the web service via the unified invoking component which acts like a proxy server. Then the component parses the message and extracts parameters like the location of the web service, method name and parameters and so on. The WSDL parser analyzes the WSDL and packs a correct request messages with the parameters extracted from client request. Then, the service can be invoked successfully and return a response. The component receives the response and extracts the result. Finally, the result will be repacked and transmitted to the client. By the analysis of the WSDL and repackage of messages, the requests raised by different client can satisfy the WSDL requests of different server. Therefore, client can access different server. On the base of the existing web service client, the unified invoking component solves the incompatible problems caused by different client call the service and maintains the unity of the web service. The unified invoking component is implemented by Java language. The WSDL parser, which is the most Axis Client Axis2 Client XFire Client CXF Client Transports Component Unified invoking component Client-to-Server Parser Server-to-Client Wrapper WSDL Parser Parser Wrapper Transports Component Axis Server Axis2 Server XFire Server CXF Server Figure 8. Architecture of the unified invoking component. client unified invoking component server.call the web service. 9.Send the response to client. 2.Parse the message and extract parameters. 3.Fetch the WSDL files from server. 4.Return WSDL files. 5.Generate correct request. 6.Call the web service. 7.Return response. 8.Generate correct response message. Figure 9. The corresponding procedure between server and client. important part of the component, is completed by wsdl4j package. It is mainly used to parse the WSDL files and extract service parameters like method name, endpoint and request parameters and so on. Request messages from the client are catched and parsed to extract the request parameters. After extracting the service parameters, the correct request messages are generated and sent to the server in order to invoke the service by RPC. Finally, the server returns the responses and the client extracts the results from the response messages. VII. CONCLUSIONS After experiencing the stage of procedure oriented, object oriented and component oriented, service oriented is now prevalent in the development of software. And Web s play an important role in SOA. It is platform independent and widely used in EAI and B2B. Web s frameworks such as Axis, Axis2, XFire and CXF support well-designed architecture and easy used APIs which make the development of web service standard 204 ACADEMY PUBLISHER

Java WebService BENEFITS OF ATTENDANCE: PREREQUISITES: Upon completion of this course, students will be able to: Describe the interoperable web services architecture, including the roles of SOAP and WSDL.

Page 1 of 5 Developing Java Web Services Hands On 35 Hours Online 5 Days In-Classroom A comprehensive look at the state of the art in developing interoperable web services on the Java EE platform. Students

JVA-561. Developing SOAP Web Services in Java Version 2.2 A comprehensive look at the state of the art in developing interoperable web services on the Java EE 6 platform. Students learn the key standards

Java Web Services Training Duration: 5 days Class Overview A comprehensive look at the state of the art in developing interoperable web services on the Java EE 6 platform. Students learn the key standards

Part I EAI: Foundations, Concepts, and Architectures 5 Example: Mail-order Company Mail order Company IS Invoicing Windows, standard software IS Order Processing Linux, C++, Oracle IS Accounts Receivable

Architectures Computing & 2009-11-06 Architectures Computing & SERVICE-ORIENTED COMPUTING (SOC) A new computing paradigm revolving around the concept of software as a service Assumes that entire systems

Middleware and the Internet Example: Shopping Middleware today Designed for special purposes (e.g. DCOM) or with overloaded specification (e.g. CORBA) Specifying own protocols integration in real world

-Oriented Architecture and Software Engineering T-86.5165 Seminar on Enterprise Information Systems (2008) 1.4.2008 Characteristics of SOA The software resources in a SOA are represented as services based

An introduction to creating Web services applications in Rational Application Developer Version 8.0 September 2010 Copyright IBM Corporation 2010. 1 Overview A Web service is a set of related application

Distributed systems Distributed Systems Architectures Virtually all large computer-based systems are now distributed systems. Information processing is distributed over several computers rather than confined

Research on the Model of Enterprise Integration with Web Services XIN JIN School of Information, Central University of Finance& Economics, Beijing, 100081 China Abstract: - In order to improve business

Web Service Development Using CXF - Praveen Kumar Jayaram Introduction to WS Web Service define a standard way of integrating systems using XML, SOAP, WSDL and UDDI open standards over an internet protocol

Middleware and the Internet Middleware today Designed for special purposes (e.g. DCOM) or with overloaded specification (e.g. CORBA) Specifying own protocols integration in real world network? Non-performant

Service Oriented Architecture for Law Firms: SOA is inevitable, are you ready? David Pilling Director of Applications and Development "Things should be made as simple as possible, but no simpler. -- Albert

SOA REFERENCE ARCHITECTURE August 15, 2007 Prepared by Robert Woolley, Chief Technologist and Strategic Planner INTRODUCTION This document is a derivative work of current documentation and presentations

Introduction to Testing Webservices Author: Vinod R Patil Abstract Internet revolutionized the way information/data is made available to general public or business partners. Web services complement this

Design and Implement Large Mobile-Commerce System Based on WEB Services Wenjun Liu 1 College of Management, South-Central University For Nationalities, Wuhan, 430060, China Abstract: Many enterprises hope

SERVICE ORIENTED ARCHITECTURE Introduction SOA provides an enterprise architecture that supports building connected enterprise applications to provide solutions to business problems. SOA facilitates the

Introduction to WebSphere Process Server and WebSphere Enterprise Service Bus Course materials may not be reproduced in whole or in part without the prior written permission of IBM. 4.0.3 Unit objectives

FUSE-ESB4 An open-source OSGi based platform for EAI and SOA Introduction to FUSE-ESB4 It's a powerful OSGi based multi component container based on ServiceMix4 http://servicemix.apache.org/smx4/index.html

1 Lecture #10 2008 (SOA) Service: A software component accessed over a network that provides functionality to a service requester Service: A service which publishes a service interface in and uses a message-driven

Integration of Hotel Property Management Systems (HPMS) with Global Internet Reservation Systems If company want to be competitive on global market nowadays, it have to be persistent on Internet. If we

A Survey Study on Monitoring Service for Grid Erkang You erkyou@indiana.edu ABSTRACT Grid is a distributed system that integrates heterogeneous systems into a single transparent computer, aiming to provide

Developing Ja Web Services to Expose the WorkTrak RMI Server to the Web and XML-Based Clients Roochi Sahni Abstract-- One development on the Internet involves a group of open standard technologies referred