A Probe-based Observability Mechanism for ...

6 downloads 20409 Views 318KB Size Report
to check for its availability and correctness, and to detect ... service, consumer of the web service, the availability ... service can be checked using the URL-.
SHORT PAPER International Journal of Recent Trends in Engineering, Vol. 1, No. 1, May 2009

A Probe-based Observability Mechanism for Monitoring of Web Services Neeraj Saxena 1, Anita Goel 2 1

Dyal Singh College, University of Delhi, India Email: [email protected] 2 Dyal Singh College, University of Delhi, India Email: [email protected]

level of the service, the day and time when the service is invoked or consumed. To show the experimental results of observability through probe mechanism, we have created a web service having three external visible methods. The embedded probe records information during web service invocation and consumption. In this paper, Section 2 describes the related work. Section 3 describes an example of Web service with the operational view of this Web service. Section 4 describes the probe-base observability mechanism. Section 5 highlights the observations made using our proposed mechanism. Section 6 states the conclusion.

Abstract— Web services facilitate integration and interoperability of distributed heterogeneous application and components. It is a standard representation for information resource that can be used by other programs, regardless of the development platform, middleware, operating system and the hardware. During execution of a web service, there is a need to monitor its internal behavior to check for its availability and correctness, and to detect performance bottlenecks. This paper presents a Probebased Observability Mechanism required for the monitoring of the web services. Our mechanism facilitates observation of internal execution details of the web services during testing and execution. The mechanism defines the structure of log which is required to be inserted into the web service. During execution of the web service, our mechanism uses XML to create a log file. A reporting interface is provided for observing the internal execution details of the log file. We illustrate the mechanism with an example written using ASP.NET and C#.

II. RELATED WORK Several papers discuss the need to monitor web service and have proposed frameworks for doing so. However, these papers discuss the frameworks conceptually and do not discuss about its design and implementation. Galatenko et al. [7] propose a Manager-Agent architecture that consists of manager on the development platform and debugging agents on the target platform. The paper does not explain practical implementation and logging facility. Dong and Yue [3] propose a framework for log and analyze the web services i.e. Service Manager-based Web Services (SMWS). However they do not discuss the structure of stored information and implementation of the architecture. Manuel et al. [6] present a log-based architecture, WSLogA, which captures web services usage. This framework is a network and SOAP intermediary dependent and faces challenges in scalability, performance hit and multiple point of failure. Barbir et al. [1] describe various challenges of testing a web service and define a tool having components like user authentication, logging of request and response, event and session information, monitoring component, analyze the log and security. They do not discuss its practical implementation. Ying Li at al. [8] design a testing tool AWSTT having components like recorder, script generator, system configurator, monitor, and runtime engine, for testing and monitoring. They do not give any details of AWSTT’s. Benharref et al. [2] propose web service based architecture for detecting faults in web services. Rouached and Godart [4] propose an algebric specification of the discrete event calculus (DEC) to check behavioral properties of composite web services.

Index Terms—Web Services, Probe, Observability

I. INTRODUCTION Observing distributed software is an essential element in terms of software functional behavior, performance, quality, availability, and finding errors [7]. Web services are a form of distributed information system. As web service is available through the Internet, there may be hundreds of users using a web service. Thus collecting the feed back on the availability of the system, its performance or to know about the errors in the web service, becomes difficult as it is deployed and is being used by many heterogeneous computing nodes. There is a need to have a proper monitoring mechanism within the web service which can collect and store information about execution behavior of the service. Here, we present a probe-based observability mechanism for observing the execution details of the web service. Our mechanism consists of three parts – it defines the structure of the probe and requires insertion of the probe in the web service. During execution of the web service, the execution details are logged in an XML format. A reporting interface is provided to view the logged information details. The reporting interface also provides query facility, which requires the XML file to be parsed to extract the desired information. An analytical report is also generated that provides information about the performance of the web service, invoking of the web service, consumer of the web service, the availability 600 © 2009 ACADEMY PUBLISHER

SHORT PAPER International Journal of Recent Trends in Engineering, Vol. 1, No. 1, May 2009 III. AN EXAMPLE To illustrate our mechanism, we use an example of a web service named “ET's Astrology” shown in figure 1. This web service provides astrological predictions and offers three methods to the user- daily-astro, weekly-astro and yearly-astro. Daily-astro allows the user to see his forecast for that day, weekly-astro provides weekly forecast, and yearly-astro retrieves forecast for a full year. We have created this web service using ASP.NET with the back-end code written in C#. The web service is hosted at IIS server on the local machine to give the environment; as it has been implemented on the server over the Internet. The URL of the “ET’s Astrology” Web service is http://localhost:1150/EtWsAstro.asmx. The WSDL document and the Discovery document of the web service can be checked using the URLhttp://localhost:1150/EtWsAstro.asmx?wsdl and http://localhost:1150/EtWsAstro.asmx?disco respectively.

Figure 2. View of probe base architecture

method, the user is authenticated based on the locally saved user information and then appropriate predication report is furnished based on the requester’s zodiac sign. Table I shows algorithm of embedded probe for log() and ChkAuthentication() methods. In Table I, steps 1 to 10 explain the logical flow of embedded log() and ChkAuthentication() methods used in our approach. The log() and ChkAuthentication() are triggered only if an interaction occurs with the web service. As and when a external visible method of web service gets executed by any remote client, the embedded log() method inside the web service is triggered to log the required information into a XML log file. TABLE I. ALOGORITHM OF LOG() AND CHKAUTHENTICATION() 1. Log(“Date and Time of invocation of WebService”) 2. Log(" Capture the Invoker’s IP Address”) 3. Log("The Input Parameters received – Userid : " + userid + ", Password : ********** , Sign : " + sign) 4. ChkAuthentication(userid, password) 5. Log("The value returned by ChkAuthentication') 6. if (_ChkAutho == "N") { Log("The value returned to caller-'Authentication Failed'") 7. Log("Webservice Terminated due to Authentication Failure"); 8. Return "Authentication Failed" 9. If Log("Invalid Zodic Sign -"+sign +" - Webservice Terminated") Else 10. Log("Webservice Successfully Executed.")

Figure 1. Snapshot of ET’s Astrology

IV. PROBE-BASED OBSERVABILITY MECHANISM The probe-based observability mechanism consists of three components: a) Creation of XML-Log file with our own defined structure, b) Insertion of probe by log() method in web service, and c) An interface called “ReportFromLog” developed to generate an analytical report from log file of example. When an external visible method of our example is invoked or consumed, the logging mechanism records the remote IP address, name of the method invoked, user-id and password, date and time. All information is recorded in XML format. The other advantage of this mechanism is the interface used for generating analytical report which helps service provider in decision making. The higher level view of “ET’s Astrology Web service” with embedded probe mechanism is shown in Figure 2. The types of user who use or consume this web service are categorized like direct subscribers, telecom operator, and mobile users of telecom operator. There are two invisible probes inside the web servicelog() and ChkAuthentication(). The method log() records path of execution of web service for observability purpose. The method ChkAuthentication() authenticates user-id and password of the users. The visible methods in the web service accept three inputs from the end user i.e. username, password and the zodiac sign. In every visible

A.. Format and Structure of Log file The log file is created in XML format. An XML file can be easily parsed to extract and query the recorded information. Designing data structure is very flexible and easy with XML, any user-defined data structure can be created in XML format. Table II shows the algorithm used to create XML log file. The log file captures the date and time of invocation of the service and the log message of the service response. Table III shows the XML format of the created log file. TABLE II ALGORITHM FOR CREATING XML LOG FILE 1. Create file EtWebServiceLog.txt if it does not exits 2. Else Append the EtWebServiceLog.txt 3. WriteLine("") 4. WriteLine("{0}", "") 5. WriteLine("{0}", "" + DateTime.Now.ToLongDateString() + "") 6. WriteLine("{0}", "" + _LogMessage + "); 7. WriteLine("")

601 © 2009 ACADEMY PUBLISHER

SHORT PAPER International Journal of Recent Trends in Engineering, Vol. 1, No. 1, May 2009 Name of Web method called – Based on this, it may be identified that which method is more popular among the users of the web service. Efforts can be directed to improve a lagging behind method. IP Address of the machine that has invoked the web service – The captured IP address helps in identifying the user’s geographical location. Targeting contents for specific users is an important marketing advantage. Parameters i.e. user-id, password – This allows us to make any kind of loyalty programs, for example, discount and bonus for a regular user. The value returned by check authentication – The most failed login users metrics provide detailed information about each failed login attempt, including the time when the failure happened and the IP address of the machine where the user attempted to login. Whether web service successfully executed – This information is used to find out the stability and availability of the system. No. of interactions – This is used to protect the endless ping.

TABLE III XML FORMAT OF LOG FILE Date Message related to events

The message body stores the following information – • Name of the web Method being called • Who called the web method – Caller IP Address • Values of the input parameter of the called web method - User ID, Password, Zodiac sign • Output of internal method ‘ChkdAthentication’ being called Authentication successful (‘Y’) and Authentication failed (‘N’) • Status of the sign received as input parameterValid sign (‘V’) and Invalid sign (‘I’) • Status of web method being called- Successful (‘S’) and Error (‘E’)

B. Report Interface The report interface extracts meaningful and interesting patterns from XML log file and generates an analytical report, which is used in determining the future trends and also useful for taking management level decisions with respect to security, availability and scalability. The interface is user friendly, and generates report from XML format to user-readable format. The internal information generated during execution of the web service is logged by internal probe ‘Log()’ which creates ‘EtWebServiceLog.txt’ file at the first time of invocation and then it appends the information in XML format on every subsequent invocation. The analysis and the reporting of the log file is done at the server side through an interface ‘ReportFromLog’. This interface is executed at the server side to analyze the data stored inside the log file of the web service. The log file is read using class DataSet using the method Object.ReadXml. The interface generates a grid view of the log file on the screen. Figure 3 shows the output generated by the report interface.

VI.

Monitoring of Web Service is required to verify its correctness and performance, and to assure its quality, availability and functional behavior. The probe-based observability mechanism requires probes to be inserted in the web service. Monitoring of web service using our mechanism generates information about the initiation of connection, requested services, location of requester, authentication information, invoker of service, consumer of service etc. The information is logged in an XML log file. The XML log file is further analyzed to generate reports. Our mechanism provides an interface for extracting analytical information. REFERENCES [1] Abbie Barbir, Chris hobbs, Elisa Bertino, Frederick Lorenzo Martino, “Challenges of testing Web Services and Security in SOA Implementations”, pp 395-440, 2007 © Springer [2] Abdelghani Benharref, Roch Glitho, Rachida Dssouli, “Mobile Agents for testing Web Services in Next Generation Networks”, Mata 2005, pp. 182-191 [3] Jichang Dong, Wuyi Yue, “Application of Integrated Web Services-Based E-Business and Web Services-Based Business Process Monitoring”, WINE 2005, LNCS 3828, pp 375-384, 2005 © Springer-Verlag Berlin Heidelberg [4] Mohsen Rouached, Claude Godart, “Analysis of Composite Web Services Using Logging Facilities”, Springer-Verlag Berlin Heidelberg 2007,pp 74-85. [5] Neeraj Saxena, Anita Goel, ”Using Web Services for Distributed Computing”, INDIACOM 2008, pp 263-268, ISSN 0973-7529, ISBN-978-81-904526-2-5 [6] Sergio Manuel Serra da Cruz, Maria Luiza M. Campos, Paulo F. Pires, L. M. Campos, “Mointoring E-Business Web Services Usage through a Log Based Architecture”, IEEE Conference ICWS 2004 [7] V.A. Galatenko and K.A. Kostryukhin, “Debugging and Monitoring Distributed Heterogeneous Systems”, copyright MAIK “Nauka/Interperiodica” 2002. [8] Ying Li, Minglu Li, Jiadi Yu, “Web Services Testing, the Methodology, and the implementation of the AutomationTesting Tool”, GCC 2003, LNCS 3032, pp 940-947, 2004 Springer-Verlag Berlin Heidelberg.

Figure 3. Logging Report V.

USING THE LOG INFORMATION

The information recorded in the log file while monitoring of the web service is used for making several observations, like Date and Time of invoking the event of web service – It allows us to gather load, time at which the service is being used extensively and the relaxed hours for maintenance/upgrade window for the system. 602 © 2009 ACADEMY PUBLISHER

CONCLUSION

Suggest Documents