Asp.Net Web API Interview Questions and Answers Pdf - 1

Question: 1

Can you share a process between Windows services?

Yes, you can share a process between windows services.

Question: 2

Which namespace must be included in a code that enables a XML Web service to write events in an event log file?

The system. Diagnostics is the namespace, which must be included in a code to enable a web service for writing events in an event log file.

Question: 3

Which attribute is used to create the Web method?

The Web service consists of one or more public methods, which are preceded by the Web Method attribute. This attribute explains the functionality of a Web service to client applications.

You can declare a Web method in .NET by using the following code snippets:

In C#:

       [Web Method]

 In VB:

       < Web Method ()>

Question: 4

Describe the Event Log class?

The Event Log class is used to access the Windows event logs from Windows services.

Using Event Log, 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 Event Log class allows you to read or write to event logs, delete logs, and create as well as delete event sources. You can use the Event Log 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.

Question: 5

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.

Related Questions