background image
Prototype Web Services and Instant Messaging Integration
Jan Vincent E. Liwanag
Department of Information Systems and Computer Science
Ateneo De Manila University
Email: jan247@gmail.com
Jan Margaret Y. Ong
Department of Information Systems and Computer Science
Ateneo De Manila University
Email: marge.ong@gmail.com
ABSTRACT
With the modern day Web becoming more oriented to providing services for the
consumption of software applications through semantic web services and with Instant
Messaging technology capable of retrieving data from specific sources, the proposed
system, called the Web-IM Bridge, aims to give the IM client access to various data
sources from the vast network of readily available web services in the Internet.
The Web-IM Bridge will basically be comprised of two integrated modules - one
communicating with the web services called a Web Services Interface and another
communicating with the IM Client called the Instant Messaging Interface. The first
module will interpret the Web Service Description document of each web service and
will relay its content to the second module. After this, the second module will deploy
itself as a virtual IM user and, using the information from the Web Service Description
documents, allow users to input commands to request data from the web services.
Keywords: Web Services, Instant Messaging
INTRODUCTION
The Internet is growing rapidly in all three
dimensions - users, hardware, and software.
Internet users are increasing exponentially with
the number of world wide users pegged at
1,093,529,692
since January 11, 2007 (Miniwatts
Marketing Group, 2007). Meanwhile, CPU
processing power and storage capacity are
doubling every 18 months (Stewart, 2006). As a
result, software applications using Internet
technology are becoming more and more
sophisticated with every release to the extent
that these applications are porting themselves
out of the desktop and into the Web as the new
computing platform.
Not only is the Web emerging as the new
computing platform for software applications, it
is also becoming more oriented to providing
services for the consumption of software
applications themselves and not just individuals
(Gudivada, et. al., 2006). The implementation of
this vision of the Web is the network of
semantic web services. Web services are simply
black boxes with an interface with which other
software applications can access its services.
However, these software applications need to
know what this service provides and how to
access it. As such, web services also implement
the concept of the Semantic Web. Simply put,
web services are marked up with machine
readable
metadata
which
allow
other
applications to automatically interpret their
services and use it to provide their own services.
Figure 1 illustrates the interaction among
semantic web services and the applications that
use them.
Fig. 1 Semantic Web Services
background image
Instant Messaging (IM) has long been a popular
technology since the 1990’s. Initially an
application primarily used by teenagers for
chatting, it is now used as a communication tool
in the corporate world and the navy, among
others (Cherry, 2002). The success of IM is
attributed to its support for presence, real-time
communication, and ease of use (Lawton, 2003).
IM, however, has evolved to more than just a
social tool. With the advent of IM bots, software
applications which act as virtual IM users, IM
clients can become interfaces for retrieving data
(Chan, et. al., 2005).
In concept, data retrieval from IM clients is not
far from data consumption from mobile devices.
In the Philippines, mobile data services account
for
around
40%
of
operator
revenues
(Duremdes, 2005). Among these data services
are Value Added Services (VAS) which allow
operators to differentiate themselves and
strengthen their relationship with their existing
customer base (MobileIn.com, N.D.). Since
most modern mobile devices today support the
OMA IMPS 2.0 protocol for IM and presence
services, the proposed Web-IM Bridge system is
potentially accessible from these mobile
devices. Furthermore, it can also be accessed
through SMS messages. This requires IM
servers to be configured to support SMS through
an SMPP transport. Subsequently, various web
services can leverage the market for mobile
VAS.
MATERIALS AND METHODS
2.1 Web Service
Supposing a provider entity, a person or an
organization, brainstorms an idea which
involves providing resources. To concretize the
idea, the provider entity implements a provider
agent - a software or hardware which provides
those resources by sending and receiving
messages. The idea which is concretized by the
provider agent is what we call a web service. On
the other side, a requester entity, a person or an
organization, wishes to obtain those resources
from that web service. The requester entity uses
a requester agent - a software or hardware which
requests those resources by sending and
receiving messages to and from the provider
agent. So that the requester agent knows how to
communicate with the provider agent, the
provider entity provides a Web Service
Description (WSD) for its web service which
specifies messaging format, network location,
and other information related to communicating
with the provider agent. A Discovery Service
bridges the gap between the requester entity and
the web service by indexing the WSD and
functional description of the web service. The
requester entity finds the desired web service
through the Discovery Service (W3C, 2004).
Figure 2 below illustrates the interaction among
components as described above.
Fig 2 Web Service Operations
2.1.1 HTTP
Hypertext Transfer Protocol (HTTP) is defined
as an application-level protocol for distributed,
collaborative, and hypermedia information
systems. It is layered over a reliable, bi-
directional byte stream such as Transmission
Control Protocol (TCP). An HTTP interaction is
composed of a request message from the client
and a response message from the server. A
request message is primarily composed of the
following: a method, a Universal Resource
Identifier (URI), and request header fields. Once
the server accomplishes the request, it sends
back a response message to the client. A
response message is primarily composed of a
status code and response header fields. Both
request and response messages contain entity
header fields and an entity body (Network WG,
1999).
2.1.2 XML
Extensible Markup Language (XML) version
1.0 was standardized by W3C in October 1998.
In its third recommendation, XML was defined
as a subset of SGML which was to be “served,
received, and processed on the Web in the way
that is now possible with HTML” (XML Core
WG, 2006). XML describes the structure of data
within the document by supporting custom tags.
Its custom tags improve the searching
mechanisms of software applications and its text
format is easily transferable over web protocols
background image
such as HTTP. As a consequence, it is a feasible
data
exchange
format
for
cooperating
applications that run over the Internet or on
other communication links (Ducket, et. al.,
2006). An XML document can be checked if it
is well-formed and if it is valid. It is well-
formed if it follows the XML 1.0 specification
and it is valid if besides that, it follows the
constraints of the Document Type Definition
(DTD) or schema (Ducket, et. al., 2006) that
describes its grammar. This provides parsers
within cooperating applications a way to check
for data integrity in the XML messages they
receive.
2.3 Instant Messaging
Instant Messaging, dubbed as “lag-less e-mail”,
is an online real-time communication tool
between two or more users. Presence refers to
the public broadcast of the availability of a
certain entity to entertain requests. An entity
may be a user, a device, or an application. In its
simplest form, it refers to whether an entity is
online or offline. Some instant messaging
services extend this by providing predefined
statuses or fully customizable ones. In a general-
purpose IM client, each user owns a buddy list
(also known as a roster or a contact list) of
subscribers to the user’s services such as being
able to view that user’s presence.
To date, almost all instant messaging services
carry their own protocol. Majority of these
protocols are proprietary. Interoperability is
achieved by means of transports or gateways. A
user registers his IM account from a foreign
network into the transport. This enables him to
exchange messages with users from the other
network.
The XMPP/Jabber protocol is an attempt to
make current instant messaging services
interoperable. The protocol is a foundation for a
general purpose instant messaging and presence
system based on streaming XML. Most
implementations of the protocol are open-
source, such as Jive Software’s Wildfire Server
and its Smack Java Library.
METHODOLOGY
3.1 Architecture
The Web-IM Bridge is comprised of deployed
bots
and
a
supplementary
client.
The
supplementary client is designed to interact
directly with a single instance of the bot. It
provides a graphical user interface and extended
functionalities.
Figure
3
illustrates
the
architecture of the Web-IM Bridge.
Fig 3 Project Architecture
The Web-IM Bridge is comprised of two
modules which are deployed independently. The
first module, called the Web Services Interface,
stands as the system’s Requestor Agent. It is the
module which exchanges requests and responses
with the actual web services. Ideally, an instance
of a Web Services Interface is deployed per
group of web services. For instance, there is
Yahoo Web Services Interface which utilizes the
web services of Yahoo such as Yahoo Search
and Yahoo News. Another instance of a Web
Services Interface will be assigned for Google
and another one for Amazon. The second
module, called the Instant Messaging Interface
exchanges requests and responses with the
actual IM user. This is primarily in charge for
converting
user
commands
to
machine
understandable
commands
and
machine
responses to user understandable ones. This is
the part of the system directly visible to the
users. An instance of the IM Interface stands as
the virtual user in the IM network which other
users may see online in their contact list and
interact with. Ideally, a single instance of the
Instant Messaging Interface resides on a single
network. For example, one instance is designed
to reside within Gtalk’s network and another for
Jabber.org’s network. An instance of an Instant
Messaging Interface is designed to communicate
with more than one instance of the Web
Services Interface. For example, an instance of
an Instant Messaging Interface residing in
GTalk’s network may connect and exchange
queries with the the Web Services Interface
instances of Yahoo!, Google and Amazon. This
makes several web services available to GTalk
users. Moreover, an instance of a Web Services
Interface is designed to accommodate more than
background image
one instance of an Instant Messaging Interface.
This eliminates the need to deploy multiple
instances of the Web Services Interface for
every Instant Messaging Interface instance that
will use the web services that Web Services
Interface stands for. Already usable, the two
modules together serve as a lightweight bridge
connecting
Web
Services
and
Instant
Messaging. By logging in to an IM network
where an instance of Instant Messaging
Interface is active, and by chatting with that
instance, the user may already be able to use the
various web services.
3.1.1 Web Services Interface
The Web Services interface accomplishes three
specific tasks. First, it acquires a Web Service
Description (WSD) for each of the web services
it will support through a web address in its input
settings. The WSD comes in an XML format
adhering to WADL specifications. This is
parsed and stored as object instances and fields.
The stored object instances and fields are then
used to form a simplified WSD. The Instant
Messenger requests for this simplified WSD
from first module through a GET request with
the parameter get having a value of simplified
WSD. Second, it receives POST requests with
the parameter service having the value of the
name of the desired service, while other
parameters are mapped to the actual parameters
needed to execute the web service. Third, it
relays the result from the web service, in XML
format, to the requesting Instant Messaging
Interface.
3.1.2 Instant Messaging Interface
The Instant Messaging Interface has three
specific roles. First, it connects to one or more
instances of the Web Services Interface
instances based on settings provided. It then
requests a simplified WSD from each of these
Web Services Interface instances and parses
them accordingly. Web services, or simply
Services, belonging from a single Web Services
Interface are classified into one Service Library.
The Instant Messaging Interface stores this into
what is called a Service Directory.
The Instant Messaging Interface maintains a
session for each participating client. Through
this session, a client may send commands
requesting for a particular service. The Instant
Messaging Interface parses this command,
searches for the particular Service requested in
the Service Directory, and forms a Query. This
Query is processed by the Instant Messaging
Interface’s Query Processor. The
Query
Processor maintains a schedule for processing
the Query instances. Once a Query is processed,
a result is returned to the client’s session, which
is then passed on to the actual client in the form
of an Instant Message. Moreover, the Instant
Messaging Interface supports other commands
as well, such as a request for libraries and
services available.
3.2 Use Case
The user must be able to contact the bot of the
Web-IM Bridge prior to any service requests.
This means that the user must be able to log on
to the IM network to which an instance of the
IM interface is assigned. Upon a successful log-
on, the user may then engage in a conversation
with the virtual user. At this point, the client
may request a list of services. The virtual user
replies with a list of web services available
categorized into libraries. In order to use a
service, the user enters a command with a
predefined syntax, indicating the service library
and service to be used, along with the input
parameters. The syntax table may be found in
the appendix section. Figure 4 shows the Use
Case Diagram for this.
Figure 4 Use Case
RESULTS AND DISCUSSION
The final implementation of the Web-IM Bridge
makes various web services available to Instant
background image
Messaging users. Listed at Table 1 are the
commands available to the user.
Command
Description
?
Displays Generic Help
? [command]
Specific Help Command
list libraries
Lists Available Libraries
list services
Lists Available Services
for the current Library
list services
[library]
Lists Available Services
for the specified Library
list inputs
[library]:[service]
Lists Parameters for a
given web service. If
library name is not
specified, the current
library is used.
[library]:[service]
[parameter name
1]=[parameter
value 1] [parameter
name
2]=[parameter
value 2] …
Perform selected service.
If library is omitted,
current library is used. If
parameter name is
omitted, the next
parameter name in the
input list is used.
Lib [library]
Sets the current library
Table 1 User Commands via IM Interface
Of the commands listed at Table 1, the first six
commands are used to guide the user on which
web services available, along with instructions
on how to use them. The seventh command is
the actual request command, while the eighth is
a convenience command.
The test was conducted on a single server,
running Apache HTTP Server and Apache
Tomcat, two interfaces, and an IM network. The
server runs on an Intel Core Duo 1.83Ghz
processor with 1024Mb RAM under Ubuntu
Linux 6.10. The server connects to the internet
through an 802.11b connection. The Web
Service Description documents were located on
the Apache HTTP Server 2.0.55 running on the
server. The Web Services Interface was tested
on an Apache Tomcat 5.5.20 with Java 5 Update
9. The Instant Messaging network is managed
by the server’s Jive Software Wildfire 3.1.1.
Wildfire was installed with a transport plug-in
set to be able to connect to Yahoo!, AOL, IRC
and MSN networks. The Instant Messaging
Interface made use of the Jive Software Smack
2.1.1 library under Java 5 Update 9 as well.
The servers and the client were connected by a
wired LAN to a single switch. The client ran
under Windows XP Professional. The Instant
Messaging application used was Jive Software
Spark 2.0.7. Multiple web services were made
available to the user. These are listed in Table 2.
Library Service
Description
Yahoo
webSearch
Searches the web
for a specified term
using the Yahoo
Search Engine.
Amazon itemSearch
Searches the
Amazon database
for a particular
item.
Inq7
headlines
An RSS feed
displaying the
latest news
headlines from
INQ7.
30Boxes getAllInfo
Gets all calendar
events from
30Boxes.
30Boxes eventSearch
Searches calendar
events from
30Boxes.
30Boxes eventGet
Gets calendar
events from
30Boxes.
30Boxes eventAdd
Adds a new event
to 30Boxes.
Esvbible passageQuery Searches the Bible
for a particular
chapter or passage.
Table 2 Initial Web Services Supported
CONCLUSION
With the proposed Web-IM Bridge, readily
available web services can be accessed through
different devices by Instant Messaging such as
PCs, laptops, Pocket PCs, cellular phones to
name a few. The proposed Specialized Client,
compatible with the Web-IM Bridge, can
potentially aid blind users to access web
services as well, by using its dictation feature.
Furthermore, Mobile Value Added Services
providers can utilize the Web-IM Bridge to
create and provide new services by reusing and
combining resources from web services.
4.1 Further Work
The implementation in the project aims to
demonstrate only a portion of the possibilities in
using a Web-IM bridge. Improvements listed
below aims to enhance the current system and
add new features.
background image
4.1.1 SOAP and WSDL support
The current system uses a protocol called REST
for exchanging XML-based messages over a
computer network. Another popular protocol
which other web services such as Google use is
SOAP. Supporting this would widen the array of
supported web services. Moreover, the current
system uses WADL as its standard for WSD.
The current standard for WSD is the WSDL
(Web Service Description Language) and is
almost always readily available for most web
services. WSDL is more complex than WADL
and is usually used for SOAP services.
However, support for the SOAP protocol and
WSDL will make the system even much easier
to adapt to new web services.
4.1.2 New Transports
One of the primary purposes of XMPP/Jabber is
multiple Instant Messaging protocol service. By
installing or creating new transports, the system
that uses this protocol may extend its scope to
other IM networks. An SMPP transport allows
mobile phone users to exchange IM messages
simply through SMS. This eliminates the need
of having to install an IM client for the phone.
4.1.3 Manager Interface
The addition of a Manager Interface for the Web
Services Interface and another for Instant
Messaging interface will greatly aid in the
administration of the system. The Manager
Interfaces aims to give the administrator an
portal, either through command-line, web, or
both to change the settings of the interface
involved either prior deployment or during
runtime.
4.1.4 Voice over Internet Protocol Interface
The system comprises of two individual
interfaces: the Web Service Interface and the
Instant Messaging Interface. Adding another
one, a VoIP interface will open web services to
telephone users as well. The VoIP interface is to
work side by side with the Instant Messaging
interface through which the users accesses the
system. Both the VoIP interface and Instant
Messaging interface will communicate with one
or more instances of the Web Service Interface.
In both options, voice recognition would be
necessary. Such system will be fully interactive
without key or visual input.
ACKNOWLEDGEMENT
William Emmanuel S. Yu
Ateneo De Manila University
Thesis Adviser, Contributor
REFERENCES
Chan, S., Hill, B., and Yardi, S., (2005).
Instant Messaging Bots: Accountability
and Peripheral Participation for Textual
User Interfaces
. Proceedings of the 2005
International
ACM
SIGGROUP
Conference on Supporting Group Work,
New York, USA, ACM Press, pp 113-115.
Cherry, S., (2002). Communications: IM Means
Business. IEEE Spectrum, November
Issue, pp 28–32.
Ducket, J., Ozu N., and Watt, A., (2001). Peer
Information Inc.
Duremdes, R.G., (2005). Mobile Value Added
Services
Deployment
in
2.5G.
http://www.veranda.com.ph/aarubio/APT03
G
Gudivada, V., Kalavala M., and Nandigam J.,
(2005). Semantic Web Services. J. Comput.
Small Coll. 21, 1, pp 50–63.
Lawton, G., (2003). Industry Trends: Instant
Messaging Puts on a Business Suit.
Computer-IEEE Computer Society.
Miniwatts Marketing Group. Internet World
Stats - Usage and Population Statistics.
http://www.internetworldstats.com/stats.htm
Mobile VAS.
http://www.mobilein.com/mobile_VAS.ht
m
Network Working Group, (1999). RFC 2616:
Hypertext Transfer Protocol HTTP/1.1.
http://www.faqs.org/rfcs/rfc2616.html.
W3C Web Services Architecture Working
Group,
(2004).
Web
Services
Architecture.
http://www.w3.org/TR/ws-arch/.
XML Core Working Group, (2006).
Extensible Markup Language (XML) 1.0.
http://www.w3.org/TR/2006/REC-xml-
20060816/.