The Study on Mobile Phone-oriented Application ... - CiteSeerX

8 downloads 129 Views 45KB Size Report
Application integration technology of Web Services is a challenge .... developing no-standard protocol for Java mobile phone can also make Java phone.
The Study on Mobile Phone-oriented Application Integration Technology of Web Services 1 Li Luqun1, 2

Li Minglu1

Cui Xianguo 2

1.

Department of Computer Science of Shanghai Jiaotong University, 1954 Huashan Road, Shanghai, China 200030

2.

Shandong university of Science and Technology, Daizong Street 223, Taian, Shandong ,China [email protected]

Abstract. Application integration technology of Web Services is a challenge research area in web application area. Till now, many research works on web service have been done on the platform of desktop PC, however little work is done on the hardware platform of Java phone. By analysis on web services architecture and exploring Java mobile phone, this paper puts forward the realization architecture for mobile phone-oriented application integration technology of web services. Key Words: Java,J2ME,Web Service,KSOAP,XML

1 Preface Web Service has become an integral part of many web applications in nowadays. Platform-independent, ubiquitous and easy access web services using common standardized protocol SOAP, Web Services Description Language (WSDL), Universal Description as well as Discovery and Integration (UDDI), has been one of the principal drivers behind this success[1]. For desktop computer, there are near mature software develop SDK and models to build, or access the web service. However, things are not the same for mobile phone, due to resource constraints of mobile phone, such as memory and bandwidth[2], web service specification on these devices is still in the procession of Java Community Process (JSR-172) version[3]. By exploring the engine of web service realization and identify the performance of existing technologies, this article puts forward the realization architecture for mobile phone-oriented application integration technology of web services.

1

This paper is supported by 973 project (No.2002CB312002) of China, grand project (No.03dz15027) and key project (No.025115033) of the Science and Technology Commission of Shanghai Municipality.

2 Analysis on Web services architecture A web service is a software module performing a discrete task or set of tasks that can be found and invoked over a network including and especially the World Wide Web. The developer can create a client application that invokes a series of web services through remote procedure calls (RPC) or a messaging service to provide some or most of the application's logic. A published web service describes itself so that developers can locate the web service and evaluate its suitability for their needs [4]. The web services architecture has three distinct roles (See Fig.1): a provider, a requestor, and a broker. The provider creates the web service and makes it available to clients who want to use it. A requestor is a client application that consumes the web service. The requested web service can also be a client of other web services. The broker, such as a service registry, provides a way for the provider and the requestor of a web service to interact. Service Registry

find

publish SOAP HTTP XML Bind

Service Requster

Service Provider

Fig. 1. Service-oriented architecture

Web services use SOAP (Simple Object Access Protocol) for the XML payload and uses a transport such as HTTP to carry the SOAP messages back and forth. SOAP messages are actually XML documents that are sent between a web service and the calling application. The web services architecture permits the development of web services that encapsulate all levels of business functionality. The three roles of provider, requestor, and broker interact with each other through the operations of publish, find, and bind. A provider informs the broker about the existence of the web service by using the broker's publish interface to make the service accessible to clients. The information published describes the service and specifies where the service is located. The requestor consults the broker to locate a published web service. With the information it gained from the broker about the web service, the requestor is able to bind, or invoke, the web service. In the common model of web service above, XML with SOAP protocol is shared among the three roles in Web Service. XML-based messaging is at the heart of the current Web Services technology. XML's self-describing nature has significant advantages, especially in platform-independent web application, however XML-based messages are larger and require more processing than existing protocols such as RMI, RMI/IIOP or CORBA/IIOP: data is represented inefficiently, and binding requires

more computation. processing and sending XML messages can not avoid coming at the price of bandwidth and performance5.Under the environment of desktop computer and wired wide internet network, the defects of XML mentioned above are not in evidence, almost the three roles in web services accept the fact that if worth of sacrificing some efficiency to get better web application architecture. However the things are different to wireless mobile intelligent terminals, see Java mobile phone.

3 Exploring the Java Mobile Phone Now the computer science and technology have come into the era of Pervasive Computing. A distinct character of pervasive computing is some distributed works which have been done by the desktop PC have separated from PC, and the works will be processed in two ways, the first one is some of distributed works will be finished by the server, usually the server is a part of enterprise in internet or intranet, web service is a trademark of this one, the second on is some of works will be distributed to much portable intelligent devices, the work can be finished by the portable devices or by the inter-operation of portable device and the server in the internet through wireless internet, usually it is called mobile computing. So the mobile phone-oriented application integration technology of web services has much significance, because people owned the device can access the web service anytime, anywhere. As for the mobile intelligent device, here the author will only highlight on Java mobile phone. Java mobile phone is a typical member in Java Micro Edition family. Till now most JVM in Java mobile phone are built at least including MIDP1.0 standard. There are many Java mobile phone can be seen in the market today. Based on CLDC and MIDP, Java phone provide GUI, network (usually Http protocol), data persist storage, etc. support in JVM. Above anything all, all Java phone support Http protocol which is the basic protocol to access web service. Obviously, as for the limited computing ability of Java mobile phone, usually it only acts as the roles of a service consumer in web service. It can be deduced from the web service architecture that besides CLDC and MIDP1.0, Java phone must use some extended API or a web service gateway to access the web service.

4 Access Web Service from Java Mobile Phone Access web service from Java mobile phone is a challenge thing, for till now web service on J2ME is still in the procession of Java Community Process (JSR-172) version[3].However the third party open source solution for Java mobile phone to access web service is available. Ksoap and KXML are the options. Besides these, developing no-standard protocol for Java mobile phone can also make Java phone access the web service indirectly.

4.1 Access Web Service Directly To keep with existing Web Services standards and APIs so that there is minimal impact on the developers. A developer should not have to maintain two code bases with different APIs for the same Web Service, nor should he have to define two different Web Service contracts for any particular service. The right way is keep the web service provider in standard form and the service consumer also in standard form. However, one thing must be noted, neither KSOAP nor J2ME web service (at least in JRS-172) supports the web service finding engine[3], the programmer will act as the roles for finding web service in the system, hence the architecture web service for Java mobile phone will change into Fig.2, the programmer is also an actor.

find

Service Registry

publish programmer Provide Web Service Information(WDSL)

SOAP HTTP XML Bind

Service Requster (Java Mobile phone)

Service Provider

Fig. 2. Service-oriented architecture for Java Mobile Phone

In Section 2, the author pointed that XML-based messages are larger and require more processing, so in the architecture above, due to the limited computing ability of Java mobile phone, additional API and SOAP &XML message parsing will be slow, obviously. To avoid the low efficiency of Java mobile phone parsing SOAP &XML, Java mobile phone can access web service by gateway or service proxy, in short accessing web service indirectly.

4.2 Access Web Service Indirectly Gateway and proxy are common words in nowadays. They act as the role between two networks or different protocols. So web service gateway can also act as the role between Java mobile phone no-standard protocols and standard protocols. Web service gateway is service provider as well as service consumer. It can be depicted by Fig.3. The communication between web service gateway and Java mobile phone can be defined by the programmer in much efficient way, hence KSOAP and KXML is necessary for Java mobile phone. The web service request sent by the Java mobile phone can be in binary code, or in SMS format, the response from the web service gateway

can be in any accepted form, see, binary code, text, SMS, MMS, etc. The Java mobile phone can access web service in much efficient way. The defect of using web service gateway is it needing additional programming work, and the Java mobile phone client side developing will in multi-form. much efficent encode

Service Registry

find response

publish SOAP HTTP XML Bind

Java Mobile phone

Service requester( Act as a service request gateway)

Service Provider

Fig. 3. Service Gateway for Java Mobile Phone in Service-oriented architecture

4.3 Using Fast Web Service Fast web service is a new project for Sun Microsystems, aimed at eliminating the low efficient of SOAP and XML encode, fast web service uses another protocol ASN.1(See Figure.6). Sun Microsystems in conjunction with OSS Nokalva (a leading ASN.1 tools vendor) has initiated a new work item at the joint ITU-T/ISO body, provisionally entitled "ASN.1 Support for SOAP, Web Services and the XML Information Set" and referred to as X.695. This aims to define a number of proposed specifications to ensure that X.694 and X.691 (or other alternative ASN.1 encoding rules) can be used in Web service environments.X.695 consists of the following subspecifications: ASN.1 Schema for SOAP ASN.1 Schema for the XML information set Fast annotations for WSDL(See Fig.4).

application

application new effcient protocol

Protocol and Data Binding

Protocol and Data Binding

WDSL Transport

Transport

Fig. 4. Fast web service principle Using fast web service, the Java phone can access web service in a much efficient way, however fast web service is now a not standard protocol now.

5 Experiment on Accessing Web Service from Java Mobile Phone 5.1 Access Web Service Directly To realize accessing web service from Java mobile phone, Tomcat5.0+AXIS, Java wireless develop kit 1.4 +KSOAP+KXML and Motorola SDK3.1 are used. The following simple service is deployed in AXIS. Hello.jws public class Hello{ public String say(String s){ return "AXIS says: Hello "+s; } } in the Java mobile phone client side, the core code are used: …. SoapObject objResult = (SoapObject) callService(String, " say"); .. result = " AXIS says: Hello " + objResult.getProperty() Object callService(String words, String methodName) { Object result = null; try { transport = new HttpTransport(serviceUrl, methodName); .. transport.setClassMap(classMap); request = new SoapObject(serviceNamespace, methodName); result = transport.call(request); The result can be seen in Fig.5.

Fig. 5. Web Service accessed by Java Mobile phone by Ksoap

5.2 Access Web Service Indirectly To access the same web service (Hello.JWS) above from Java Mobile phone by web Service gateway. As for this method is very easy, the code is omitted. The Java mobile phone use only standard protocol to send the request string and get the response string! As for this work is rather easy the code is omitted!

Table 1. Result of Java Mobile phone ( the Emulator) accessing web Service

Item

Java phone API

Time to access the web Service (Seconds)

Access Web Service MIDP1.0+KSOAP+KXML 22 Directly Access Web Service MIDP1.0 12 Indirectly The time of Java phone to access the web service includes the emulator start time, and application running time, as well as the net web service deploying time on the Axis server. Results above show that Java mobile phone accessing web service by web service gateway is much faster than using KSOAP protocol.

6 Conclusion The Java mobile phone can access web service by KSOAP protocol. To get much efficient use web service, web service gateway technology can be used. However, addition code on both Java mobile phone and the service side is also needed. As for accessing web service from Java phone is still a new research area and web service standards on it is still under JSR172, the efficiency of accessing web service from Java mobile phone must be taken into account. Reference 1. 2. 3.

4. 5.

Steve Graham. Building Web Services with Java [M].China Machine Press, Beijing, China. Jan, 2003, P40~70. Li luqun. The Study on Mobile GIS [PH.D dissertation].Shandong university of Science and technology.2002.6, P46~59. Jon Ellis & Mark Young. J2ME Web Services 1.0, Sun Microsystems. July, 2003,P24~45. Mach Hendricks, Ben Galbraith. Programming Guide on Java Web Service [M].

Publishing Hose of Electronics Industry, Beijing, China. Oct, 2002,P32~67.. Paul Sandoz, Santiago Pericas-Geertsen. Fast Web Services. Sun Microsystems http://developer.java.sun.com/developer/technicalArticles/WebServices/fast WS/index.html, 11, Sep, 2003,

6.

Bill Brogden. Programming Guide on SOAP and Java [M].Publishing House of Electronics Industry. Beijing, China. March, 2002,P59~79.

About the author: Li luqun, associate-professor, post-PhD in Computer Department Shanghai Jiaotong University. His main research interests are Web Service and network application study and development. [email protected] Li Minglu, professor, vice-dean of Computer Department of Shanghai Jiaotong University, His main research area is Griding Computing, Web Service etc. Cui Xianguo, professor, in Shandong University of Science and Technology, his main research interests are GIS and database.

Suggest Documents