Welcome to www.programmer2programmer.net tips for IT Interview Questions of .NET Server Components


 Microsoft Certification
 Final Year Project Idea
 Connection Strings
 Password Recovery
 SQL Injection
 Encryption & Decryption
 LIVE Academic Project
 Project #1 - VB6, Access
  Project #2 - VB.Net, SQL
 Project #3 - ASP, Access
 Project #4 - ASP.NET, C#
 Project #5 - VB6, SQL
 Project #6 - Stegano
 Project #7 - C
 Project #8 - C++
 Project #9 - JAVA, MySQL
 Project #10- PHP, MySQL
 Project #11- JSP, Oracle
 Project #12- C# Face Exp
 Project #13- Mobile Bank
 Download MBA Project
 MBA Project Topic
 Project Viva Question
  2018 New Projects
 Project Synopsis Download
 University Question Paper, Assignment and Projects
 SMU - Question Paper
 SMU - Assignment
 SMU - Synopsis Projects
 SCDL - Assignment
 IGNOU - Synopsis Projects
 Welingkar - Projects
 Project Report Formats
 Interview Question Answer
 General & HR Round
 Visual Basic 6
 VB.Net & C#
 SQL Server
  Oracle and DBA

100% Tested
Ready Academic IT Projects


 Interview questions and Answers for .NET Server Components, Windows Service, COM+ and XML Web Service

Home Personal Member Forum Source Project Tips Contact

Interview Question - VB.NET and C# - Windows Service, COM+ and XML Web Services interview questions and answers

Interview questions and answers Server Components, Windows Service, COM+ and XML Web Services interview questions and answers

NET Framework Server Componentes, Windows Services, COM+, XML Web Services, Service Application, Event Logs, Service Control manager, Windows DNA, EnterpriseServices, remoting boundaries, channels, remoting applications, XML Documents, XPathNavigator, XML Web service, Web configuration

Advanced .NET Framework C#, VB.NET Interview Question and Answers for .NET Framework Version 2.0, 3.0, 3.5, 4.0

Interview Question, Answer
1.  Programming General
2.  Web General
3.  Database General
4.  Visual Basic 6
5.  ASP
6.  Visual Basic .NET and C#
7.  ASP .NET
9.  MS SqlServer
10. MySql


What are the states of a service application?

The states in which a service application can remain are running, paused, stopped, and pending.


What are the different types of Windows services?

Windows services are of two types: Win32OwnProcess and Win32ShareProcess services. Each Win32OwnProcess runs in its own process space, whereas Win32ShareProcess services share a process space with other services.


What are the tasks that you perform to create a Windows service?


These tasks are performed when creating a Windows service:
o Create a blank Windows service by using the Windows Service template for Visual Studio .NET.
o Change the default properties of the Windows Service template according to your requirements.
o Write code in the service application project to handle various events.
o Add installers to your service application.
o Install your service application by using the installation tools.


How do you add functionality to a service application?

To add functionality to a service application, you override the OnStart and OnStop methods of the ServiceBase class. You can also override the OnPause, OnContinue, and OnCustomCommand methods of the ServiceBase class to increase the functionality of a service application.


How do you log custom information in the default event logs?


To enable your service application to access the default event logs and write information in them, set the AutoLog property of a service application to False. You then use the WriteEntry method of the EventLog class log to write information in the default event logs.


Why do you need to include installers in your service application?

The installers enable you to install a Windows service and resources, such as custom logs and performance counters, that a service application uses on a computer. The installers automatically install these resources when you install a service application using the Installutil tool.


Why do you need to add instances of both the ServiceProcessInstaller and ?ServiceInstaller classes to install your service application?


A service application can contain more than one service. The methods of the ServiceProcessInstaller class perform the tasks that are common for all the services within a service application, such as writing entries in the system registry for all the services within the service application. The ServiceInstaller class performs tasks specific to a service, such as creating an entry for a service in the registry of a computer.


How do you specify the security context of a user account within which a service application runs?


You use the Account property of the ServiceProcessInstaller class to specify the security context for your service application. To specify the security context of a user account, set the Account property to User. You then need to specify the user name and password of a user account when you install the service application.


What administrative tasks can you perform on your service using the SCM?


You can perform the following administrative tasks using the SCM:
o Change the state of a service
o Specify how to start a service
o Specify the recovery actions in case of a service failure
o Specify a user account for a service
o View service dependencies


What are the steps to run custom commands on your service application?


• The steps to run custom commands on your service application are
• Create a Windows application that you use to control your service application.
• Create a method that calls the ServiceController.ExecuteCommand method in the Windows application.
• Override the OnCustomCommand method in your service application to specify the tasks that you want your service application to perform.


What are the steps to attach a debugger to your service application?


The steps to attach a debugger to your service application are:
• Start your service application using the SCM.
• Choose Processes from the Debug menu.
• Select Show System Processes.
• Select the process for your service application and click Attach. The Attach To Process dialog box appears.
• Select Common Language Runtime, click OK to specify a debugger, and close the Attach To Process dialog box.


How is COM+ related to the DNA architecture?


Windows DNA provides the infrastructure and services that enable you to create and deploy applications based on the three-tier architecture. COM+ services, which are an integral part of Windows DNA, include services such as transactions, queued components (QC), security, loosely coupled events, JIT activation, and object pooling.
• Briefly explain the use of the following COM+ services:
o JIT activation
o Queued components
o Object pooling
Just-in-time activation. The Just-In-Time (JIT) Activation services of COM+ ensure that the client application has references to objects as long as they require them. As a result, the client application does not need to use the valuable memory resources of the server to save the object references.
Queued components. The Queued Component service of COM+ is based on the Microsoft Message Queue Server (MSMQ) model that is a part of Windows 2000 and Windows XP. MSMQ is a middle-tier service that facilitates the asynchronous delivery of messages to named queues. The MSMQ system queues up the method calls and executes them automatically as and when the component is available. You can, therefore, use queued components to execute client methods even after the component is unavailable or offline, ensuring the continuous running of a distributed application.
Object pooling. COM+ provides an automated service for configuring a component so that it can maintain ready-to-use and active object instances in a pool to process client requests. To configure and monitor the pool, you specify characteristics such as the pool size and the creation request time-out values. Next, the COM+ service is responsible for managing the pool and ensuring the activation and reuse of the pool objects according to the configured specifications.


What is a serviced component?


A serviced component is a class that derives from the System.Enterprise?Services.ServicedComponent class, which is the base class for all classes that use COM+ component services. You create and register each service component before it can access the COM+ services.


Which class do you need to define when creating serviced components?


To create a serviced component, you need to define a class that is derived directly from the ServicedComponent base class.


How do you assign a name and ID to a COM+ application?


The application ID serves as an index for all application searches made during the registration process. The application ID is assigned by using the ApplicationID attribute that is derived from the System.EnterpriseServices namespace.


What is the importance of the activation type attribute in the registration of a serviced component?

You use the activation type attribute to specify whether the created serviced component is created in the library of the caller process or in a new process of the server.


Which tool is used to add a strong name to an assembly?

You can use the Strong Name Tool (sn.exe) to create the file containing the public key information.


Which procedures can be used to register serviced components?

COM+ services use the following three types of registration for a serviced component:
a. Manual registration
b. Dynamic registration
c. Programmatic registration


How do you configure a serviced component for implementation of role-based security at the interface level?


To assign roles to a component, method, or interface, complete the following steps:
• In the console tree of the Component Services tool, locate the COM+ application for which the role is defined.
• Expand the tree to view the components, interfaces, or methods of the application, depending on whom you are assigning the role.
• Right-click the item to which you want to assign the role and click Properties.
• In the properties dialog box, click the Security tab.
• In the Roles Explicitly Set For Selected Item(s) list box, select the roles that you want to assign to the item.
• Click OK.


What are the requirements to enable communication between objects across remoting boundaries?

To enable communication between objects across remoting boundaries, you need
o A server object that exposes the functionality to callers outside its boundary
o A client that makes calls to the server object
o A transportation mechanism to pass the calls from one end to the other


Describe the two types of remotable objects.

The two types of remotable objects are
o Marshal-by-value objects. These objects are copied and passed by value out of the application domain.
o Marshal-by-reference objects. The clients that use these objects need a proxy to access the object remotely.


Describe the two types of activation modes of the .NET Remoting system.

The two types of activation modes in the .NET Remoting system are
o Server activation. In server activation, objects are created on the server when you call a method in the server class. However, objects are not created when you use the new keyword to create an instance of the server class.
o Client activation. In client activation, objects are created on the server when you create an instance using the new keyword.


How can you renew lifetime leases of objects?


You can renew the lifetime lease of an object in the following two ways:
o A client application calls the ILease.Renew method.
o A sponsor renews the lease.


What are channels?


Channels enable an application that is running in one application domain, process, or computer to send messages to an application running in a different application domain, process, or computer. In addition, channels allow applications to send and receive messages using protocols, such as TCP and HTTP.


List the tasks you need to perform to publish a service outside the service domain.

• To publish a service outside the service domain, you need to:
o Identify the application domain that will host the service.
o Identify the activation model: server activation or client activation.
o Identify and create a channel and a port.
o Identify how the client application obtains the metadata information about the service.


Why do you use delegates in your remoting applications?

You use delegates to implement callback functions, event programming, and asynchronous programming in your remoting applications. Events use delegates to enable callback functions to the client in remoting applications. This enables the client and the remote application to function as domain servers. Therefore, you need to design a server/server application instead of designing a client/server application.


What steps do you perform to implement asynchronous programming in a remoting application?

The steps to implement asynchronous programming in a remoting application are
1. Create an instance of an object that can receive a remote call to a method.
2. Wrap that instance method with an AsyncDelegate method.
3. Wrap the remote method with another delegate.
4. Call the BeginInvoke method on the second delegate, passing any arguments, the AsyncDelegate method, and some object to hold the state.
5. Wait for the server object to call your callback method.


What information do you need to provide to the .NET Remoting system to configure remote objects?

You must provide the .NET Remoting system with the following information to configure remote objects:
o The activation type for the remote object
o The channels that the remote object will use to receive messages from clients
o The URL of the remote object
o The type metadata that describes the type of your remote object


Which method will you use to load the contents of an XML file into an ?XmlDocument object?

You need to use the Load method to load the contents of an XML file into an XmlDocument object. Alternatively, you can use the LoadXml method to load the XML data from a string format into the XmlDocument object.


Which method will you use to write the contents of the XmlDocument object into an XML file?

You need to use the Save method of the XmlDocument class to write the contents of the XmlDocument object into an XML file.


How do you read the contents of an XML document using XmlTextReader?

You need to perform the following tasks to read the contents of an XML document using XmlTextReader:
o Create an object of the XmlTextReader class.
o Call the Read() method on the reader object until all the data is read.
o While reading the data from the XML document, check the type of the data being read using the XmlTextReader.NodeType property.


Which class do you use to write data to an XML file?

You use the XmlTextWriter class to write to an XML file. The XmlTextWriter class provides methods such as WriteStartDocument, WriteStart?Element, WriteAttributeString, WriteEndElement, and WriteEndAttribute, which you use to write data in a well-formed XML document.


How does XPathNavigator read data from an XML document?

The XPathNavigator object reads data from an XML document by using a cursor that enables forward and backward navigation within the nodes. XPathNavigator enables you to randomly access any node in an XML document. However, the XPathNavigator cursor is read-only; therefore, you cannot edit an XML document with XPathNavigator.


Which methods of the XPathNavigator class do you use to navigate within the nodes selected from an XML document?

You can use the MoveTo, MoveToNext, MoveToPrevious, MoveToFirst, MoveToFirstChild, MoveToParent, MoveToRoot, and MoveToId methods to navigate within the nodes selected from an XML document.


What objects are used to create the structure of an XML document within a schema?

The simpleType and complexType elements are used to specify the structure of the XML document in the XSD schema file.


Which event is raised for validating the semantics of the XML Schema?

The XmlValidatingReader.ValidationEventHandler event for the ?Compile method is raised for semantic validation checking of the XML Schema.


How can you ensure your XML document is valid?

You can ensure the validity of XML documents by using the Xml?Validating?Reader class. The XmlValidatingReader class provides DTD, XDR, and XSD schema validation services. The XmlValidatingReader class takes XmlTextReader as input. XmlValidatingReader applies the property that you specify in XmlTextReader.


How can you read fragments of an XML document?

You can use XmlValidatingReader to read XML fragments. Xml?ValidatingReader parses a given string as a fragment of XML. This enables you to bypass the root-level rules of an XML document. The value you pass to the XmlNodeType parameter of XmlValidatingReader determines how to parse an XML string.


Which method enables you to retrieve the XSD schema for the XML representation of the data stored in the DataSet?

The GetXmlSchema method enables you to retrieve the XSD schema for the XML representation of the data stored in the DataSet.


Which method of the DataSet class enables you to write the contents of a DataSet into an XML file?

The WriteXml method of the DataSet class enables you to write the contents of a DataSet into an XML file.


What is an XML Web service?

XML Web services are program components that allow you to build scalable, loosely coupled, platform-independent applications. XML Web services enable disparate applications to exchange messages using standard protocols such as HTTP, XML, XSD, SOAP, and Web Services Description Language (WSDL).


What are the components of the XML Web service infrastructure?

The components of the XML Web service infrastructure include XML Web services directories, XML Web services discovery, XML Web services description, and XML Web service wire formats.


What are the steps to deploy a Web service?

Follow these steps to deploy a Web service:
1. Copy the files for your XML Web service application to the ?Inetpub\Wwwroot folder.
2. Open Internet Services Manager from the Administrative Tools folder.
3. Expand the Default Web Site node.
4. Right-click the Web service folder you copied to the Inetpub\Wwwroot folder to open its properties dialog box.
5. Click Create in the properties dialog box to configure the virtual folder as the root of your Web application.


What are the components that are published when you deploy a Web service?

The components that are published when you deploy a Web service are
o The Web application directory
o The <WebService>.asmx file
o The <WebService>.disco file
o The Web.config file
o The \Bin directory


What does the .disco file contain?

A .disco file contains links to other resources that describe your XML Web service and enables clients to discover an XML Web service. The discovery document contains information regarding other XML Web services that reside on the same or a different Web server.


What are the steps to configure discovery information for an XML Web service?

To configure discovery information for an XML Web service, perform the following tasks:
0. Create an XML document and insert the <?xml version="1.0" ?> tag in the first line.
1. Add a <discovery> element.
2. Add references to service descriptions, XSD schemas, and other discovery documents within the <discovery> element.
3. Deploy the discovery document to a Web server.


What tasks do you need to perform to consume a Web service in a client application?

To consume a Web service from a client application, you need to perform the following tasks:
0. Add a Web reference to the XML Web service in the client application by discovering the XML Web service you want to consume.
1. Generate a proxy class for the XML Web service.
2. Create an object of the XML Web service proxy class in the client application.
3. Access the XML Web service by using the proxy object.


Which attribute is used to create a Web method?

In C# you use the [WebMethod] attribute to declare a Web method that exposes the functionality of the XML Web service. In Visual Basic .NET, you use the <WebMethod> attribute to create a Web method.


Which file contains configuration information, such as debug mode?

The Web.config file contains configuration information, such as the debug mode and the authentication mode for a Web project. It also includes information about whether to display custom errors for a Web project.


Which file allows you to handle application-level events?

The Global.asax file enables you to manage application-level events. This file resides in the root directory of an ASP.NET Web application or ASP.NET Web service. The Global.asax.cs or Global.asax.vb class file is a hidden, dependent file of Global.asax, which contains the code for handling application events such as the Application_OnError event.


Which property of the WebMethod attribute allows you to maintain the state of objects across sessions in a Web method?

The EnableSession property of the WebMethod attribute allows you to enable session state for a Web method.


What steps do you need to perform to enable transactions in a Web method?

To enable transactions in a Web method, you need to perform the following steps:
1. Add a reference to the System.EnterpriseServices.dll by using the ?Solution Explorer.
2. Include the System.EnterpriseServices namespace in the XML Web service project.
3. Set the TransactionOption property to an appropriate value.


When should you use asynchronous programming?

You should use asynchronous programming when your application calls a method on an object that takes significant time to execute and you do not want the program to wait for the method to return.


Explain how you implement asynchronous programming using callbacks.

A client calls the Begin method on the server object and passes a reference to the callback method. When the asynchronous method finishes execution, the server object calls the callback method on the client object. The callback method in turn calls the End method on the server object. The End method returns a value to the client.


Which method do you call for the first time when you access an XML Web ?service or service method with which the SOAP extension is configured to ?execute?

You call the GetInitializer method the first time when you access an XML Web service or service method with which the SOAP extension is configured to execute.


What are the different properties of the <add> XML element?

Type, Priority, and Group are the three properties of the <add> XML element. The Type property of the <add> element represents the type of SOAP extension. The Priority property represents the relative priority of the SOAP extension within a group. The Group property represents the group name to which the SOAP extension belongs.


Which element in the Web.config file do you use to manage custom error ?messages?

You use the <customErrors/> element to manage custom error messages. You can set the <customErrors> mode attribute to On or RemoteOnly to enable custom error messages, and Off to disable the error messages.


How can you ensure that only authorized users access your Web service?

You can use the <authorization> element to specify the users and roles that can access your Web service. This element enables you to implement both positive and negative authorization assertions. You can use this element to allow or deny access to your Web service based on specific users or roles.

Next  .NET Assemblies, Configuration, and Security interview questions and answers            Go back to Interview Question Main

(C) Atanu Maity, 2006-2018