A simple SOAP based web service has been developed that uses a android platform as an user interface from which a user access a database residing in the other server. the web service exposes web methods over the internet so that any other application can use those methods for own requirements.
2. Introduction
In present days, the ability to seamlessly exchange information between internal
business units, customers, and partners is vital for success
Yet most organizations employ a variety of disparate applications that store and
exchange data in dissimilar ways and therefore cannot "talk" to one another
productively
Web services have evolved as a practical, cost-effective solution for uniting
information distributed between critical applications over operating system, and
language barriers that were previously impossible
2
3. In last few years the use of smartphones and tablets has been increased
enormously, changing the scenario of mobile phone usage
The applications associated with this smartphones and tablets are the most
attractive tools which provides a touch and click interface to the users
According to Nielsen Media Research
• In 2014, the mobile users spent 89% of their time on media through the mobile
Application
Contd… 3
4. Now-a-days Android operating system has become a predominant platform in the
market of application development. (Shanmugapriya et al., 2011)
Several companies as part of OHA (Open Handset Alliances) developing millions
of Android applications
e-learning to m-learning, e-commerce to m-commerce
In this shifting from web-based application to mobile application, web services
act as the intermediate interface
Contd… 4
5. Web service overview
Web service is a standardized technology that
• Exposes information, functionalities and business logic of a existing web-
server/web page application over the Internet
• Allows other system/application to access these information, functionalities
and business logic by calling the web methods
• provides program-to-program interface between the systems/application
• Uses some open standards or protocols like SOAP, WSDL and UDDI
5
6. o Device A request some data from
other system B over the network
o System B exposes the data using a
web service through the network
o System A gets the response data as
a result
Web services communicate between different systems/applications
Contd…
WEB SERVICE
6
7. Web services are independent of programming language and platform (Kao,
2001)
Contd… 7
8. Architecture of web services
Web services Architecture is defined by SOA (Service Oriented
Architecture)
• SOA concept refers to a architecture based on some distinct services
• Interaction between these services exist
According to SOA there are three components in a web services-
• Service roles/actors
• Service operations
• Standards/Protocols
8
10. Standards/protocols of web service
SOAP (Simple Object Access Protocol)
• It is XML-based messaging protocol, where XML (eXtensible Markup Language)
provides tags to each element of the message
• The basic communication between the systems are served by SOAP Request and SOAP
Response
• Also known as Communication Protocol
Contd… 10
11. Contd…
• Framework of SOAP-
o Has components like
envelop, header, body
o The message elements are
encapsulated in the SOAP
envelop
11
12. Contd…
WSDL(Web Services Description Language)-
• The service description is specified in the WSDL file
• XML-document format
• Provides location (URL) of the service and description of the service to a client
application
12
13. Contd…
UDDI (Universal Description, Discovery and Integration)
• XML-based standard for publishing, finding and registering web services
• It acts as a centralised registry that enables the clients to locate the web services.
• Closely resembles online “Phone Directory” (Dustdar, et al., 2005)
• Provide two basic information
o Service description along with the way to encode it
o Query and update APIs of the registry
13
14. Introducing the Android Application
Android Platform
• Open source software stack for mobile application development
• Google initiated android project with Open Handset Alliance including 30 companies
(Knutsen, 2009)
• Linux based kernel and runs its application on Dalvik Virtual Machine
• Several version has released till today, the latest version released is Lollipop
(Android 5.0) and Android M is the upcoming release.
14
15. Contd…
Advantages of Android Platform
• Open source software
• Android integration in any device
• Devices can be easily customizable
• No external review required
15
17. Importance of web services in android
Applications
Using and implementing functionalities of existing web-based systems/applications
Access data from remote database server easily
Client users can access the web service in an emergency situation if health related web
services are available
User get information on touch and click using a web service through the application
17
18. Developing a web service in java
Programming language
Creating a web service that will access a remote database server
Creating a web service class and web methods
Creating Database Source Name (DSN)
Accessing database in java
Deploy and Testing the web service
18
19. Contd…
Creating web service class and web methods
• A web service consists of a set of web service class and web methods
• Web service classes encapsulate all the web methods used in the service
• Web methods are the actual implementation of exposing the functionality of a
system over the network
19
21. Contd…
Creating Database Source Name (DSN)
• Database source name provides connectivity to a database through an
ODBC driver
• DSN contains database name, database
driver, directory and other information
• Once a DSN is created, one can use the
DSN in an web service to invoke
information from the database
21
22. Contd…
Accessing the database in Java
• Java provides a set of classes that connects the database by loading the ODBC
driver
22
23. Contd…
Deploying and Testing web service
• To make the web service available to any client application, the service have to be
deployed
• The web service has been deployed to the Glassfish server so that the service can
be available over the Internet
• The web service can be tested by tester in the browser
23
28. Consuming the web service in Android
applications
An android application can be developed as client application for consuming the
web service
Android application creates a
request to the web service,
the web service responses to
the application with desired
result
28
29. Contd…
Key points of Android Application for consuming a web service are-
Creating layout files in XML
Creating activity class files in JAVA
Accessing the web service inside the application
Internet Permission in the manifest file
29
30. Contd...
Creating Layout file in XML-
• Framework of each activity of an application is defined in the layout file
• Just a XML file with tags
• It can define different elements such as
o Form widgets- Buttons, Progress Bar, TextView etc
o Text fields- EditText, Password, Date, E-mail etc
o Layout- Linear, Relative etc
30
32. Contd…
Creating the activity class file in java
• most important files in the application written in java programming language
• ultimately converted in Dalvik executable file and runs the application
• Inherits the base classes of android like Activity Class, ActionBarActivity Class etc
• Implements and overrides the necessary methods such as onCreate(), onClick() etc
32
33. Contd…
• performing the following functionality-
o Defines the XML-layout elements and provide reference of the XML elements
into java
o sets the content view of the application as per the XML-layout file
33
35. Contd…
Accessing the web service inside the application
• Most important part of the application that actually calls the web method
• Add a third party library KSOAP2 (http://ksoap2.sourceforge.net) to the library
of Android project that is optimized for Android
35
36. Contd…
• Firstly defines the namespace of the web service, name of the web method, SOAP-
Action and the URL of the web service description
36
37. Contd…
• SOAP request is fired based upon the specified web method of the web service
and properties are added as per the requirement
• SOAP envelop is created and version of the SOAP is declared
37
38. Contd…
• Passing the request to the envelop
• Connecting to the web service using the URL and invoking the web method with
request
• The response of the request is stored as String
38
39. Contd…
Internet permission in the manifest file
• the application needs a permission for accessing the Internet
39
40. Current Technology
RESTful-based web service
• has gained wide acceptance across worldwide in last few years
• It is being used as a simpler alternative to SOAP and WSDL-based web services
(Zur et. al, 2005)
• REST stands for Representational State Transfer, defines a set of architectural
principles for developing web services
• It typically communicate over HTTP with the same HTTP principle CRUD
(create, Read, update, Delete)
40
41. Conclusions-
Companies/organisations are developing web services to integrate the existing
functionalities and resources of multiple systems/applications
e-commerce companies like Flikart, Amazon, Snapdeal, Myntra, Paytm expanding
themselves through mobile application version
Web services can be developed for the agricultural information system so that any
client application can access those facilities easily
Further studies on RESTful web services for Android application can be done
41
Notes de l'éditeur
Kernal-fundament part of os manages i/o request, sytem calls to translate them into data processing instruction
Linux kernel- handle wide array of device drivers, basic system functionalities powermanagement, process management, memory management
Libraries- a set of libraries sqlite database that data
openGL- grahics library,
Dalvik virtual machine-like JVM runs its own process
Appl. Framework- provide high level
Fuctionalities of existing web based application used in android application
Glass fish server is a application server for java. It woks middle-tier of a server oriented architecture
The ksoap2-android project provides a lightweight and efficient SOAP client library for the Android platform
JAR (Java Archive) aggregate of many Java class files and associated metadata and resources (text, images, etc.) into one file to distribute application software or libraries on the Java platform.