Interview Questions Part 3 - Oracle , DotNet , SQL , C# , Javascript , UML , AJAX
Question 1 :What are parameter array ? How is parameter array declared ?
Answer 1 :
A parameter array allows variable number of arguments to be passed to a method. A parameter array is declared with the params modifier. Only the last parameter of a method can be a parameter array, and the type of a parameter array must be a single-dimensional array type.
Example :
public static void DisplayEmployeeDetails(string name, params object[] args) {...}
State different types of method parameters in C# ?Different type of method parameters in C# are :
- Value Parameter
- Reference Parameter
- Output Parameter
State differences between BasicHttpBinding and WsHttpBinding ?
Answer 2 :
Criteria | BasicHttpBinding | WsHttpBinding |
Security support | This supports the old ASMX style, i.e. WS-BasicProfile 1.1. | This exposes web services using WS-* specifications. |
Compatibility | This is aimed for clients who do not have .NET 3.0 installed and it supports wider ranges of clients. Many of the clients like Windows 2000 still do not run .NET 3.0. So older version of .NET can consume this service. | As its built using WS-* specifications, it does not support wider ranges of client and it cannot be consumed by older .NET version less than 3 version. |
Soap version | SOAP 1.1 | SOAP 1.2 and WS-Addressing specification. |
Reliable messaging | Not supported. In other words, if a client fires two or three calls you really do not know if they will return back in the same order. | Supported as it supports WS-* specifications. |
Default security options | By default, there is no security provided for messages when the client calls happen. In other words, data is sent as plain text. | As WsHttBinding supports WS-*, it has WS-Security enabled by default. So the data is not sent in plain text. |
Security options |
|
|
State few WebService attribute in XML Web Service ?
Answer 3 :
Various WebService attributes are :
- NameSpace : Specifies the namespace, which defaults to "http://tempuri.org",
- Description : Specifies description text for the XML Web service
What are various webmethod attributes in Web Service ?
Answer 4 :
The WebMethod attribute in Web Service provides the following properties:
- BufferResponse
- CacheDuration
- Description
- EnableSession
- MessageName
- TransactionOption
How to enable transaction in Web Service ?
Answer 5 :
Please follow below steps to enable transaction in Web Service :
1.Add a reference to System.EnterpriseServices.dll.
2.Add the System.EnterpriseServices namespace to the XML Web service
using System.EnterpriseServices;
3.Use the TransactionOption property of the WebMethod attribute, as shown below:
public class Service1 : System.Web.Services.WebService
{
[System.Web.Services.WebMethod(
TransactionOption=TransactionOption.RequiresNew)]
public string DoSomethingTransactional()
{
// The transaction was successful...
ContextUtil.SetComplete();
return ContextUtil.TransactionId.ToString();
}
}
Question 6 :
What are commonly used namespaces in .NET for XML ?
Answer 6 :
The commonly used namespaces in .NET for XML are :
- System.Xml
- System.Xml.Schema
- System.Xml.XPath
- System.Xml.Xsl
What is well formed XML document ?
Answer 7 :
Well formed XML document follows below rules :
- Every start tag has end tag
- XML document has root element enclosing all other elements
- Opening and closing tag must match and must be written in same case
- Attribute values should be enclosed with double quotation marks.
- XML tags must be properly nested
What are different implementations of LINQ ?
Answer 8 :
Different implementations of LINQ are :
- LINQ to SQL
- LINQ to DataSet
- LINQ to XML
- LINQ to Objects
What are various message patterns in WCF ?
Answer 9 :
There are three message patterns :
- Request/Reply pattern : This is default message pattern. Every request from client has a reply from service
- One way pattern : client does not wait for reply from service for further processing.
- Duplex pattern : Service and client can send messages to each other simultaneously .
How AJAX works ?
Answer 10 :
No comments:
Post a Comment