Sie sind auf Seite 1von 8

A QUERY BASED SYSTEM FOR OPTIMIZING WEB SERVICES THROUGH

PROGRAM SLICING
Jitender Tanwar, Ravindra Kumar, Balkaran Singh Sidhu, Amit Kumar, Sudip Akura
CSE & IT Department, Amity School of Engineering & Technology, Bijwasan
New Delhi – India

Abstract
The development of web services and applications based on web services have become
increasingly popular in recent years. However, how to publish, discover and compose them in
open and dynamic network environment has become one of the most important challenges for web-
based technology. This project proposes a method based on program slicing to realize the
optimization of web services. It provide an efficient way to access Web Services using query. This
project abstract away the fundamental complexity of XML based Web services specifications and
toolkits, and provide an elegant, intuitive, simple, and powerful query based invocation system to
end users. Our system uses Program Slicing and Caching technique in the process of automating
Web services invocation and execution. The results of experiments show that our optimization
methods of WS are feasible and flexible.

Keywords: Web Service, Program Slicing, Query Based System, WS Generation, Function
Dependence Graph, C#, ASP.net
1. Introduction can also be divided into forward slicing and
backward slicing. In forward slicing, one is
1.1. Program Slicing
interested in what depends on or is affected
Mark Weiser first defines a program slice S by the entity selected as the slicing criterion.
[7] as a reduced executable program obtained In backward slicing, one is interested in what
from a program P by removing statements, affects the variables in the slicing criterion.
such that S replicates part of the behavior of Figure 1 gives an example of Program
P. In general, a program slice consists of Slicing.
those statements of a program that may
Void Calculate(int void Calculate(int
directly or indirectly affect the variables N) N)
computed at a given program point. The { {
program point p and the variable set V, int I; int i;
denoted by <p, V>, is called a slicing int sum=0; int sum=0;
criterion. Program slicing algorithms can be int product=1;
roughly classified as static slicing and For(i=0;i<N;++i) For(i=0;i<N;++i)
dynamic slicing methods, according to { {
whether they only use statically available sum=sum+i; sum=sum+i;
information or compute those statements that product=product*I;
influence the value of a variable occurrence } }
for a specific program input. Program slicing Write(sum); Write(sum);
Write(product); C# syntax simplifies many of the
} } complexities of C++ and provides powerful
features such as null able value types,
Source Code Slicing for enumerations, delegates, lambda expressions
<10,sum> and direct memory access, which are not
found in Java. C# supports generic methods
Figure 1. Source Code and Slicing Results
and types, which provide increased type
1.2. Web Service safety and performance, and iterators, which
enable implementers of collection classes to
According to the W3C group, a WS (also web define custom iteration behaviors that are
service) is traditionally defined as a software simple to use by client code. Language-
system designed to support interoperable Integrated Query (LINQ) expressions make
machine-to-machine interaction over a the strongly-typed query a first-class
network. It has an interface described in a language construct. As an object-oriented
machine-process able format such as WSDL language, C# supports the concepts of
(web services Description Language). Other encapsulation, inheritance, and
systems interact with the WS in a manner polymorphism. All variables and methods,
prescribed by its description using SOAP including the Main method, the application's
(Simple Object Access Protocol) messages, entry point, are encapsulated within class
typically conveyed through HTTP with an definitions. A class may inherit directly from
XML serialization in conjunction with other one parent class, but it may implement any
web-related standards. Web services today number of interfaces. Methods that override
are frequently just application programming virtual methods in a parent class require the
interfaces (API) or web APIs that can be override keyword as a way to avoid
accessed over a network such as the Internet, accidental redefinition. In C#, a structure is
and be executed on a remote system hosting like a lightweight class; it is a stack-allocated
the requested services. In general, a service type that can implement interfaces but does
depends on other services. Such dependences not support inheritance.
can be described as dependence graphs on
which program slicing algorithms can be 1.4. Web Service Invocation using QBS
applied for WS generation and composition.
Web services are widely expected to simplify
All of the algorithms appeared in this paper
the design of distributed applications that are
are implemented in language C# which will
amenable to automated discovery,
be introduced in next subsection.
composition, and invocation. The use of
1.3. C# XML facilitates in moving towards loosely
coupled applications that provide greater
C# syntax is highly expressive, yet it is also interoperability in distributed heterogeneous
simple and easy to learn. The curly-brace environments. However, the current XML
syntax of C# will be instantly recognizable to based specifications provide only syntactical
anyone familiar with C, C++ or Java. descriptions of the functionality provided by
Developers who know any of these languages Web services. Even though a wide variety of
are typically able to begin to work tools are available to invoke Web services,
productively in C# within a very short time. the lack of semantics associated with Web
service descriptions requires user the appropriate Web services. Unlike other
intervention in the decision making process Web service implementations, the user does
and understanding of the complex interfaces, not have to fill detailed forms for each
contexts, composition, and invocation. It is service. Our system takes into consideration
currently required for application developers results of past Web service invocations and
to have some knowledge of the intricacies of utilizes it to improve performance for
Web services: know-how about the list of subsequent user queries in the same domain.
available operations, the input and output
1.5. Background and Related Work
parameter types, the set of ports and service
endpoints, apart from usage details of their Many researchers are doing some related
particular Web services toolkit. Though an work about WS generation and composition.
important motivation of Web services is to They give some methods and models to solve
promote ease-of-use for application the problem how to discover and generate a
developers, the requirement that end users WS. The most two common methods used
also be familiar with the design and some recently are based on syntax and semantics.
implementation details makes its usage The method based on syntax is a traditional
difficult for end users. Our work addresses one. Although this method has been
this problem by simplifying the user improved by a large number of researchers, it
interaction with Web services. We have has a known shortcoming when it uses the
developed several algorithms and technology of keyword matching, which
optimization techniques that map user often returns some inaccurate results. Many
queries to relevant operations in domain services discovered by this method are not
specific Web services. Our system presents a wanted for users. The method based on
simple interface, similar to HTML based semantics does a better job than one which is
search engines, which accepts user queries based on syntax. Its results of discovering
and presents the end user with results after services are more accurate. Some researchers
invoking and executing relevant Web have studied on generating and composing
services. We employ several query matching web services by using program slicing
techniques including Semantic Web and technology, but most of them focus on web
ontology technologies such as OWL, as well services only, and haven’t proposed a
as tools such as WordNet, to retrieve feasible method with the whole process of
contextual information from queries and WS generation and composition. Microsoft
determine the set of Web services that need Roslyn CTP helps analyzing the relationship
to be invoked for any user query. The details between all components in C# types/codes. In
of Web services specification and this paper, we will make a detailed method
implementations are hidden from the user. about how to generate web services from
For example, suppose a user wants to check source codes. The technology of program
the weather for a trip from Boston to slicing is used to help us abstract function
Chicago. In our system, the user needs to dependence graph (FDG) and generate
enter a query "weather for travel from Boston corresponding services. Our current
to Chicago". Our system will employ various prototype of WS tool can cope with the
algorithms to understand the query and imperative language C#. The biggest
obtain the required information by invoking difference between our work and others’ is
that the slicing is accomplished on the basis
of methods and not on variables. So there is
no need to describe the function point ‘p’.
And another difference is that we use
program slicing and graph theory to process
services’ dependences. The theory of
function dependence graph is to be discussed
in Section 2, and services identification with
program slicing is to be introduced in Section
3. In Section 4, conclusions are drawn and
future work is listed.
2. Design and Implementation 2.1 Query Based System

 Step 1: User will provide query in  User will provide query in the User
Query Interface.
the User Query Interface.
 Spell checking has been done to
 Step 2: Query will be processed in the
rectify any mistakes in the query.
Query Based System to check
Lexicon contains the dictionary from
whether the Web Service is present or which spell checker will check.
not.  Query will pass to the query
 Step 3: If the web service is found processor to normalize the query
then it first checks the cache memory. which includes Stop Word removal,
 Step 4: If there is a Cache hit then Non- Alphanumeric replacer and
output will be directly showed to the abbreviation extender.
user.  After stripping words from the query,
 Step 5: If there is a Cache miss then the match processor matches the
the Web Service will be sliced on the stripped words with its repository.
basis of slicing criterion which in this  If match is found then web service is
case are methods. chosen for further process.
 Step 6: Then the sliced code is  If match is not found then user
prompted to rectify the provided
invoked and the output is stored in a
query.
cache memory.
 Step 7: Output is prepared and shown
to user
2.2 Service Identification with Program
Slicing
When a server receives some source codes
from users, its important work is to identify
components/services from the source codes.
Non-strictly speaking, each top-level
function (or a class in object-oriented
languages such as Java) in source codes can
be abstracted as a component/service. For
simplicity, a global variable or a point
variable in C is treated as the special function
whose parameter and return are both itself.
2.3 Invocation and Caching
For WS identification, source codes will be
parsed to build a FDG on which some slicing Web Service Invocation relates to identifying
operations are applied, and then the sliced the right web service according to the user
codes for each service can be easily query and the executing it after implementing
generated. The main functions of the slicing program slicing on its source code. Our
process will be listed below before describing system also takes into consideration results of
the algorithm of slicing in details. past Web service invocations and utilizes it to
improve performance for subsequent user
code begins:
queries in the same domain.
file→ create web service;
 ASMX Web Service is taken and
codes→ readFile (file); registered in the server (local host or
AST →generateAST (codes); others).
 Create a blank soap envelope.
FDG → generateFDG (AST);  Add soap body which contains the
SN →chooseSlicingNode (methods); web method. After adding the soap
body, the soap envelope is ready to
SN’→ SN+ methods dependent on SN; communicate with the server.
slicedCodes→ delete ~ SN’  Create web request by sending the
soap envelope to the server.
Generate→ Web Service
 Get soap response from server. The
code ends soap response is in XML format.
 Parse the response and get result.
 Prepared output for user.
3 Experimental Results
Output Screens

Home Page:
 User can enter the query in the
textbox.
Output:
 Click ‘Search’ to fetch the result.
 Showing weather report of entered
city.

Example:
 User enter the query to see weather
report in a city
Example: Output:
 User enters another query  User fill the form and press ‘Submit’
to get the result.
 The result is shown to the user.

4. Future Scope
 N-gram algorithm can be
implemented to predict next letter in
user query interface.
 Ontology can be incorporated.
 Self-learning mechanism that utilizes
the knowledge of previously made
queries and enhances the efficiency of
the system by a range of 20% - 82%.
 Compression techniques can be
incorporated in SOAP messages.

Fallback Behavior:
 Query is processed by the system and
found that all the parameters that 5. Conclusions
needed are not given by the user.
This paper introduces a Query Based System
 User will fill this form to get the that matches user queries with corresponding
result. methods in Web services, invoke the
operations with the correct set of parameters,
and present the results to the end user. It also
incorporates technique of Program slicing
and caching in the process if automating Web
Services invocation and execution

6. References
[1] Chaitali Gupta, Rajdeep Bhowmik,
Michael R. Head, Madhusudhan Govindaraju
and Weiyi Meng, “A Query-based System for
Automatic Invocation of Web Services”.

[2] Yingzhou Zhang , Wei Fu, Geng Yang,


Lei Chen and Weifeng Zhang, “Web Service
Generation Through Program Slicing” , Int.
J. Communications, Network and System
Sciences,2010, 3, 877-887.

[3] Julio Fernandez Vilas, Ana Fernandez


Vilas and Jose Pazos Arias, “Optimizing Web
Services Performance using Cache”,
International Conference on Next Generation
Web Services Practices, 2005

[4] M. F. Porter, “An Algorithm for Suffix


Stripping”, Computer Laboratory, Corn
Exchange Street, Cambridge

[5] Andrea De Lucia, “Program Slicing:


Methods and Applications” Engineering
University of Sanio Palazzo Bosco
Benevento, Italy

[6] Mahmoud Barhamgi, Pierre-Antoine


Champin, and Djamal Benslimane, “A
Framework for Web Services-Based Query
Rewriting and Resolution in Loosely Coupled
Information Systems”, LIRIS Laboratory,
Claude Bernard Lyon1 University 69622
Villeurbanne, France

[7] M. Weiser, “Program Slicing,” IEEE


Transactions on Software Engineering, Vol.
16, No. 5, 1984, pp. 498-509.

[8] F. Tip, “A Survey of Program Slicing


Techniques,” Journal of Programming
Languages, Vol. 3, No. 3, 1995, pp. 121-189.

[9] V. Agarwal et al., "Synthy. A System for


End to End Composition of Web Services" in
Journal of Web Semantics, Vol. 3, Issue 4,
2005

Das könnte Ihnen auch gefallen