Web Services Interview Questions and Answers for Freshers and Experience Part-3
13. How can you ensure that only authorized users access your Web service?
You should use the <authorization> element to ensure that only authorized users access your Web service. This element allows or denies access to your Web service according to their role.
14. Describe the EventLog class.
The EventLog class is used to access the Windows event logs from Windows services. Using EventLog, you can also customize Windows event logs that record information about important software and hardware events, such as the events of the .NET controls, keyboard, or other hardware devices.
The EventLog class allows you to read or write to event logs, delete logs, and create as well as delete event sources. You can use the EventLog class to create event logs while creating an event source. An event source can be used to write to only one event log at a particular time. However, it is possible to associate one event log to multiple sources.
15. How can you prevent your Web services from unauthorized access?
The following are the ways to prevent your Web service from unauthorized access:
Using encryption and message-based security.
Using authentication and access controls for the Web service.
16. Explain the concept of Web services in brief.
A Web service may be defined as an independent and self-sustained unit of a software application that is hosted on the Web and implement specific functionalities to execute the business logic. A Web service provides so many functionalities, such as generating pay slips for employees, computing tax, broadcasting weather report, and providing updated news. The Web service allows application to share information or exchange data with other applications across different operating systems and hardware.
Therefore, the work of a Web service is to unite software by exchanging data irrespective of their operating systems, supported hardware, and programming language used in their development. The Web services transfer data in the XML format and use Simple Object Access Protocol (SOAP) to communicate. It is an XML based protocol. The Web services use Web Services Description Language (WSDL) and Universal Description, Discovery, and Integration (UDDI) to describe itself.
17. What advantages have Web services over Component Object Model (COM) and Distributed Component Object Model (DCOM)?
The advantages of Web services over COM and DCOM are as follows:
Web services are simple to use and can be implemented on varied platforms.
Web services are loosely coupled; as a result, their interfaces and methods can be extended.
Web services do not carry any state information with them so that multiple requests can be processed simultaneously.
18. Mention the namespace that you must import in code to build a Web service.
System.Web.Services is the elementary namespace, which must be imported to develop code of a Web service.