.Net Remoting Interview

DCOM vs .Net Remoting
.Net Remoting is the successor of Distributed component object Model(DCOM). Both these technology are introduced by Microsoft that enable inter-process communication across application domains. DCOM was very successful technology. But it is never treated as best technology for inter-process communication because of lack of its support for interoperability across platform.
.Net Remoting is a new technology that ship with .Net Framework. It has all those features which are missing in DCOM. There are other pain involve with DCOM such as difficult to control format or channels, message trace is painful, change in configuration setting such as channels or port is not easy. DCOM is hard to learn and complicated to deploy and to maintain.

Differences between these two technologies are as follows.
DCOM technology is based on the COM architecture whereas .NET Remoting is primarily based on .NET Frameworks.DCOM is based on proprietary binary protocol which is not supported by all object model, thus has big drawbacks in the internet world.
DCOM is based on RPC protocol whereas .Net Remoting can use TCP or HTTP protocol which is stardard protocal in the market.
DCOM is not firewall friendly, can't choose port. .Net Remoting, on the other hand, works easily across firewalls.
.Net Remoting supports cross platform communication which is not possible with DCOM (only for windows platform).
Components created DCOM involves complex deployment in windows registries whereas .Net Remoting involves easy deployment using either xml based configuration file or programmatically in the code.
DCOM uses windows security features whereas .Net Remoting can use security features of IIS if hosted with ASP.NET. .Net Remoting, if hosted other than ASP worker process, allows to create own security mechanism for the application.
In DCOM, server is started by Service Control Manager (SCM) upon receiving the activation request from the client whereas in .Net Remoting, IIS is responsible to start server service. If not hosted with IIS then client request will fail if the Remoting server is not already started.
DCOM manages remote object lifetime by frequent pinging of clients whereas .Net Remoting has more efficient leasing mechanisms to maintain object lifetime.

Define windows process:
A process is an instance of a running application.Each process is allocated its own block of available RAM space.No process can access another process code or data. If the process crashes, it dies alone without taking the entire OS or a bunch of other applications down.

Define channels in .NET Remoting
Channels represent the objects that transfer the other serialized objects from one application domain to another and from one computer to another, as well as one process to another on the same box. A channel must exist before an object can be transferred.

What security means available for .NET Remoting in System.Runtime.Remoting?
None. Security should be taken care of at the application level. Cryptography and other security techniques can be applied at application or server level.

What is a formatter in .Net Remoting?
A formatter is an object that is responsible for encoding and serializing data into messages on one end, and deserializing and decoding messages into data on the other end.

.NET Remoting and Web services.
Use remoting for more efficient exchange of information when you control both ends of the application. Use Web services for open-protocol-based information exchange when you are just a client or a server with the other end belonging to someone else.

Name the distributed systems available apart from .Net Remoting.
Distributed Computing Environment/Remote Procedure Calls (DEC/RPC),Microsoft Distributed Component Object Model (DCOM), Common Object Request Broker Architecture (CORBA), and Java Remote Method Invocation (RMI).

How do you implement distributed applications in .NET?
.NET Remoting and ASP.NET Web Services.Classes for the same are in System.Runtime.Remoting and System.Web.Services.

Define proxy in .NET Remoting.
Its a fake copy of the server object that resides on the client side and behaves as if it was the server. It handles the communication between real server object and the client object. This process is also known as marshaling.

Define remotable objects in .NET Remoting.
Remotable objects are the objects that can be marshaled across the application domains.You can marshal by value, where a copy of the object is created and then passed to the receiver. You can also marshal by reference, where just a reference to an existing object is passed.

Define SingleCall activation mode in .Net Remoting.
If the server object is instantiated for responding to just one single request, the request should be made in SingleCall mode.

Define Singleton activation mode in .Net Remoting.
A single object is instantiated regardless of the number of clients accessing it. Lifetime of this object is determined by lifetime lease.

Define the lease of the object.
By implementing ILease interface when writing the class code.

.NET Remoting versus Distributed COM
.NET Remoting is the successor of DCOM. Microsoft DCOM is a solution for distributed object and very good in terms of performance when components are in the same network. But its drawbacks in the internet connected world are visible. It uses proprietary binary protocol which is not supported by other object models, thus can't support interoperability across platform. .NET Remoting uses TCP or HTTP protocol that is supported by most of the object models. This allows .NET Remoting to be adaptable to the network environment in which it is being used.

Advantage of Remoting over Web Services
.NET Remoting allows objects to interact that can be hosted in different application domain within the same process or different process. The objects can also interact over intranet or internet. It supports many different protocols unlike Web Services that works over SOAP/HTTP protocol. .Net Remoting can work on TCP protocol that provides speed benefit from its counterpart. Being tied up with IIS, .Net Web service can only work with producer /consumer model whereas .Net Remoting can share objects from any type of application. .Net Remoting being part of .Net Framework support full .Net type system and can expose any object to the client. .Net Web Service supports on those types that can be expressed with XSD.

When should we choose .Net Remoting over .Net Web Services?
.Net Remoting provides distributed solution for a corporate use. So, if you need distributed environment to be implemented for internal use, .Net remoting is the best choice.
If you require a faster distributed solution, .Net Remoting with TCP protocal using binary format is faster than Web services. .Net Remoting is better solution when large transfer of data is required. Web Services provide an open-protocol-based exchange of information. Web Services are best when you need to communicate with an external organization or non .NET technology.

What are the ways to configure Remoting objects before client can use them?
There are two ways that the remoting objects can be configured. They can be configured by calling configuration methods inside the application. .Net Framework allows configuring objects also by adding configuration section in the application configuration file or machine.config file. Application-level XML settings take precedence over machine.config. When you apply any change in the configuration section, you don’t need to recompile the code. On the other hand, any change in the setting applied programmatically would require recompiling the code.

Define Delegates.
A delegate acts like a strongly type function pointer. Delegates can invoke the methods that they reference without making explicit calls to those methods. It is type safe since it holds reference of only those methods that match its signature. Unlike other classes, the delegate class has a signature. Delegates are used to implement event programming model in .NET application. Delegates enable the methods that listen for an event, to be abstract.

Define Events.
Events are one of the members of the class. When any noteworthy activity occurs in the application, an event is raised which sends out the message to the other part of the application which handles the event. The event can carry arguments that contain information about the event. The method which handles the event must have the same signature as the event itself. Events are commonly used in the applications with graphical user interface elements such as buttons, textbox etc. An event is triggered when any action such as mouse click occurred in the interface element. The event-based programming model can be used in the non-GUI applications such as .NET Remoting application. An event in remoting.net occurs when the state of the application changes.

What is asynchronous programming?
.Net Remoting supports asynchronous programming. In this model, a call is made to a class method while the calling program continues to execute. This increase application speed as the application continues to execute without waiting for the called methods to finish execution.

When do we 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.

What are the ways to renew lifetime leases of objects?
A client can renew the lifetime lease of an object by calling the ILease.Renew method.
What are the types of remotable objects?
The two types of remotable objects are
Marshal-by-value objects - These objects are copied and passed by value out of the application domain. When client calls a method on marshal-by-value-object, the remoting system creates a copy of this object and passes the copy to the client application domain. The copy hence received can handle any method call in client domain. Using Marshal-by-value-object reduces resource consuming trip across network.
Marshal-by-reference objects - The clients that use these objects need a proxy to access the object remotely. When client calls a method on Marshal by reference object, the remoting system create proxy object in the caller application that contains the reference of all method and properties of the object.

What are the Security features in .Net Remoting.
.Net Remoting is integral part of .Net Framework, so it has access to all security features of Framework. If remoting objects are hosted using IIS, it leverages the entire authentication and authorization features that are available to Web based protocols. If hosted other than HTTP protocols over IIS, then you have the opportunity to create your own security infrastructure.

What are the information required to configure remote objects?
Following information to be provide to configure remote object.
Activation type for the remote object Channels URL of the remote object Type metadata of the remote object .

Explain Serialization Formatters in .NET Remoting.
In .Net Remoting, the objects are shared over distributed network. The objects are transmitted in serialized form. The objects are first serialized into message data before it is sent with the wire. On the other end of the wire, this serialized data is read and desterilized back to the actual object. This process of converting objects into message data is done by serialization formatters. .Net Remoting supports two formatters. SOAP FormatterBinary FormatterSOAP Formatter converts objects into XML string whereas Binary Formatter converts an object's state into a binary stream. The binary serialization formatter is slightly faster.

What are the requirements to enable remote components to interact each other?
To enable communication between objects across remoting boundaries, you need to have A server object to expose service A client that calls server object to consume service A message transmission protocol

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

Define Client Activated Objects (CAO).
Client-activated objects are objects whose lifetimes are controlled by the client, i.e. calling application domain. This mode works in similar fashion to the model where object is local to the client and referenced object's lifetime is controlled by the calling object. When instance of server object is created, object reference is obtained in the form of proxy.
In COM model, clients hold an object in memory by holding a reference to it. The object is released from the memory when the entire client releases the reference. But in .Net Remoting, client-activated objects use lifetime leases to determine how long they should continue to exist. When a client creates a remote object, it can specify a default length of time that the object should exist. If the remote object reaches its default lifetime limit, it contacts the client to ask whether it should continue to exist, and if so, for how much longer. If the client is not currently available, a default time is also specified for how long the server object should wait while trying to contact the client before marking itself for garbage collection. The client might even request an indefinite default lifetime. Client-activated instances serve only the client and the reference that was responsible for their creation.
To create an instance of a client-activated type, clients either configure their application programmatically or using a configuration file and call new, or they pass the remote object's configuration in a call to Activator.CreateInstance.

Explain Marshalling and its types in .Net Remoting.
Objects can't be transmitted as such over communication channel. The objects are packed into message buffer before transmitted. This process is called marshalling. There are two different ways to Marshal objects:
Marshal by Value: Server creates copy of the remoting object's state and passes it to the client. You need to implement your classes to have marshal by value features either by implementing ISerializable interface or using attribute. Here you need to copy whole object to the client which means with large size object, the communication overhead is significant.
Marshal by Reference: In this type proxy is created by the reference of the server objects. Class must extend the System.MarshalByRefObject to implement marshal by reference. Here, client keeps server object reference which means round trip to server with each method call.

Summary of .Net Remoting
.Net enables interaction between applications over distributed network.
To develop a Remoting application, you need to create client and server objects. You need to activate the objects and use reference of the server objects in client to communicate.
Channels allow application to send and receive messages using protocal like TCP or HTTP.
You can use delegates in Remoting application to implement event based programming and asynchronous programming.
Asynchronous programming in Remoting application helps to calls remote methods while client continues to execute other local method.
To host remote object, server needs some information about the objects.
The information can be provided programmatically in the code or can be loaded from configuration section of application configuration file or machine.config file.
Being part of .Net Framework, .Net Remoting can implement role based security. Moreover, it can leverage all security features of ASP.NET, if it hosted in ASP.NET.

XML Interview

Difference between XML and HTML:
HTML is Presentation Language, it is not case sensitive, every
tag need not have an ending tag, we cannot write our own Tags.In XML, Every tag must have an ending tag, We can write our own tags, It is case sensitive.

XML and Binary Serialization:
XMLSerialization is called Shallow Serialization because it can serialize only
public fieldsSoap Serialization and Binary Serialization techniques are called Deep Serialization because it serialize the object containing reference.

How would you build a search engine for large volumes of XML data?
The way candidates answer this question may provide insight into their view of XML data. For those who view XML primarily as a way to denote structure for text files, a common answer is to build a full-text search and handle the data similarly to the way Internet portals handle HTML pages. Others consider XML as a standard way of transferring structured data between disparate systems. These candidates often describe some scheme of importing XML into a relational or object database and relying on the database's engine for searching. Lastly, candidates that have worked with vendors specializing in this area often say that the best way the handle this situation is to use a third party software package optimized for XML data.
Obviously, some important areas of XML technologies were not included in this list -- namespaces, XPointer, XLink, and so on -- and should be added to the interviewer's set of questions if applicable to the particular position that the candidate is applying for. However, these questions in conjunction with others to assess soft skills (communication skills, ability to work on teams, leadership ability, etc.) will help determine how well candidates understand the fundamental principles of XML.
What is XQuery?
Xquery is a query language that is used to retrieve data from XML documents.
XQuery is a way to query the XML data, It is built on XPath expressions and is supported by quite a few database engines.
It can find and extract elements and attributes from XML documents.
XQuery is written in FLWOR fashion which stands for: For, Let, Where, Order by, Return
An example of XQuery is:for $x in doc("abc.xml")/abc_namewhere $x/a>30order by $x/breturn $x/c.

What is XPATH?
XPath is a language that describes how to locate specific elements (and attributes, processing instructions, etc.) in a document.
An XSL sublanguage designed to uniquely identify or address parts of a source XML document, for use with XSLT.
It is based on a tree representation of XML document. It provides the ability to navigate around the tree and to select the nodes by a variety of criteria.
The simplest XPath is /A/B/C where C is the child of B, B child of A.
What is a CDATA section in XML?
CDATA - (Unparsed) Character DataThe term CDATA is used when you dont want some text data to be parsed by the XML parser.
A CDATA section starts with "":
What is XSL?
XSL is a language for expressing style sheets. An XSL style sheet is a file that describes the way to display an XML document.
Using XSL stylesheets, we can separate the XML document content and its styling.
An XSL style sheet begins with the XML declaration: defines that the document is an XSLT style sheet document.The element defines a template.
Define CSS and XSL.
XSL is a language for expressing style sheets. An XSL style sheet is a file that describes the way to display an XML document.
Cascading Style Sheets is an answer to the limitations of HTML, where the structure of documents was defined and not the display. CSS formats documents for display in browsers that support it.

How do you display XML with XSLT?
First you need to declare the XSL style sheet:

Then,you create an XSL Style Sheet with a transformation template.Add the XSL style sheet reference to your XML document to link them.
What is XMLA ?
XML for Analysis, It is a Microsoft specified XML-messaging-based protocol for exchanging analytical data between client applications and servers using HTTP and SOAP as a service on the Web.
What is XML Namespace?
An XSL sheet or a document may have duplicate elements and attributes. Therefore, the XML namespaces define a way to distinguish between duplicate element types and attribute names.An XML namespace is a collection of element type and attribute names. It is a URI due to which any element type or attribute name in an XML namespace can be uniquely identified. It consists of two parts : the name of the XML namespace and the local name.
e.g.: xmlns: h=”http://www.abc.com”After this, you can write……..to associate the table with the declared namespace.
What is XML data binding?
XML data binding refers to the process of representing the information in an XML document as an object in computer memory.
The limitations of data binding include round tripping of elements and attributes. XML data binding product generates documents that are invalid because of sibling order. They do not preserve physical constructs. They do not preserve comments and processing instructions.
What is XML Serialization and Binary Serialization?
XML Serialization makes it possible to convert any common language runtime objects into XML documents or streams and vise versa.
The XML Serialization enables it to convert XML documents into such a meaningful format that the programming languages can process the converted documents with ease.
Binary serialization converts the files to a binay format. In this case all the data get converted into a binary format which is not a human readable format. In binary serialization entire object state is saved, instance identity is preserved and it graphs with multiple references can be handled in this.
XML serialization doesnt allow these things.
What are XML indexes and secondary XML indexes?
The primary XML index is a B+tree and is useful because the optimizer creates a plan for the entire query.
It is always better to split the entire XML columns into relational rows and columns.
The primary XML index contains one row for each node in the XML instance.
The secondary XML indexes can be created to enhance the performance.There are the types of secondary indexes:
PATH secondary XML indexIf the use of path expressions on XML columns is prominant, the PATH secondary XML index can speed up the task.
VALUE secondary XML indexThe VALUE index can be used if your task involves quering unknown attribute names.
PROPERTY secondary XML indexClustering paths within each XML instance in the PROPERTY index can be beneficial when multiple values are retrieved from individual XML instances.
List the rules to be followed by an XML document.
Following rules need to be followed by an XML document:
They must have a root tag, the document should be well formed : the tags should be properly closed, since XML is case sensitive, one should take care that the documents are written with proper care and the attribute values should be inside “”
Explain about XML Canonicalization.
AnswerCanonicalization refers to finding the simplified form of an XML document.
XML files may not contain the same sequence of characters (bytes or octets) even if they are logically equivalent. This is where we need to canonicalize them and check their canonical forms.
Steps to canonicalize an XML document
Encoding schemes should represent characters by octets.XML documents should be encoded in UTF-8 encoding.
The canonical form needs all line breaks to be #xA.
All attributes need to be normalized in canonical form.
What is the XMLHttpRequest Object?
The XMLHttpRequest object is used to connect to the server through http. Scripts use it to do so programmatically.
The EventTarget interface needs to be implemented if an object implements the XMLHttpRequest interface. Also, an XMLHttpRequest() constructor needs to be provided by objects that implement the Window interface.

Explain common XMLHttpRequest Object Properties. i.e. onreadystatechange, readyState, responseText, responseXML, status, statusText.
The ‘onreadystatechange’ property fires at every state change event.
The ‘readyState’ property is an object status integer. It uses the integers 0 to 4 for uninitialized, loading, loaded, interactive and complete states.
The ‘responseText’ property is a string version of data returned from server process.
The ‘responseXML’ property is DOM-compatible document object of data returned from server process.
The ‘status’ property is for returning numeric codes from the server like error codes, etc.
The ‘statusText’ property is used for string messages that accompany the status code.

Explain common XMLHttpRequest Object Methods.
The abort() is used to stop the current request.
The getAllResponseHeaders() method is used to return the full set of headers as a string.
The getResponseHeader("headerLabel") method is used to return the string value of a single header label.
The open("method", "URL"[, asyncFlag[, "userName"[, "password"]]]) is used to assign the destination URL, method, and other optional attributes of a request.
The send(content) method transmits the request, optionally with postable string or the data of DOM object.
The setRequestHeader("label", "value") method is used to assign a label/value pair to the header to be sent with a request.
Why the need for XHTML?
If a script in an HTML document is not well formed, small devices like mobile phones fail to display the content properly. Also, upgrading all the browsers to support XML is a timely affair. An intermediate solution is XHTML that is a combination of HTML and XML. In XTML the content has to be well formed so that there is no bad HTML.

XHTML vs HTML
XHTMLElements must be properly nestedElements must be closedElements must be in lowercaseDocuments must have one root element
HTMLElements need not be properly nestedElements need not be always closedElements need not be in lowercaseDocuments need not have one root element.

Explain the XHTML syntax rules.
Some Syntax rules that need to be followed with XHTML are:
That Attribute names must be in lower case, their values must be in quotes and their minimization is done away from usage.
Also the ‘name’ attribute has been replaced by the ‘id’ attribute. The XHTML DTD defines mandatory elements.
Explain XML Attributes with an example.
The attributes in XML provide additional information about elements. Take a look at the following example:

XML Elements vs. Attributes.
XML elements as well as attributes can be used to provide the same information about an entity in an XML database. The only difference lies in the way they are written. For example:
..... is an example of using attributes. The same information can be provided in the element form as follows:Da Vinci Code.

What are the problems with using XML attributes?
It is preferred storing the data using the XML elemental form as it becomes very convenient to access and modify the data. Also the use of attributes is limited as they cannot contain multiple values, cannot contain tree structures nor are expandable.
What is the DOM?
DOM is a platform independent, World Wide Web Consortium (W3C) standard form of representation of structured documents as an object-oriented model. It is an application programming interface so as to access HTML and XML documents.

What is the HTML DOM?
The HTML DOM API specializes and adds the functionality to relate to HTML documents and elements. It addresses the issues of backwards compatibility with the Level 0 of DOM and provides mechanisms for common and frequent operations on HTML documents.

What is the XML DOM?
Microsoft’s MSXML DOM provides an API for working with XML data. It also provides a programmatic representation of XML documents, fragments, nodes, or node-sets. It is a W3C standard form of XML representation. XML DOM objects can be used in XML applications written in C/C++, VB, VBScript and JScript.
What is an XML encoding error?
XML documents can contain non ASCII characters, like Norwegian æ ø å , or French ê è é which introduce errors.
The 2 types are:An invalid character was found in text content.Switch from current encoding to specified encoding not supported.
You can avoid these errors by specifying the XML encoding Unicode.

Ajax Interview Materials

What is AJAX and what problem does it solve?
Ajax is a set of client side technologies that allows asynchronous communication between client and web server. In synchronous communication, complete round trip happens with each request/response action event when small data of the page to be refreshed. Ajax has solved this problem of posting entire information every time through asynchronous communication.
XmlHttpRequest is the basic fundamental behind Ajax. This allows browser to communicate with server without making post backs.

What is AJAX and what problem does it solve?
Ajax is a set of client side technologies that allows asynchronous communication between client and web server. In synchronous communication, complete round trip happens with each request/response action event when small data of the page to be refreshed. Ajax has solved this problem of posting entire information every time through asynchronous communication.
XmlHttpRequest is the basic fundamental behind Ajax. This allows browser to communicate with server without making post backs.

What is AJAX and what problem does it solve?
Ajax is a set of client side technologies that allows asynchronous communication between client and web server. In synchronous communication, complete round trip happens with each request/response action event when small data of the page to be refreshed. Ajax has solved this problem of posting entire information every time through asynchronous communication.
XmlHttpRequest is the basic fundamental behind Ajax. This allows browser to communicate with server without making post backs.

What is AJAX and what problem does it solve?
Ajax is a set of client side technologies that allows asynchronous communication between client and web server. In synchronous communication, complete round trip happens with each request/response action event when small data of the page to be refreshed. Ajax has solved this problem of posting entire information every time through asynchronous communication.
XmlHttpRequest is the basic fundamental behind Ajax. This allows browser to communicate with server without making post backs.

What is the role of Script Manager in Ajax?
Script Manager, as the name suggests is used to manage the client side script of Ajax. Since Ajax uses Java Script, there needs to be a mediator to manage this script and restrict a particular version to a browser. A Script manager is present on every page where Ajax is used to enable the Ajax Libraries. These Libraries in turn helps to implement the core Functionality of Ajax: Partial rendering.

List out differences between AJAX and JavaScript.
Ajax is Asynchronous Java Script and XML. Here on sending request to the server, one needn’t wait for the response. Other operations on the page can be carried out. Hence, Asynchronous. On the other hand, Java script sends an HTTPRequest to the server and waits for the XML response.
E.g. populating State field. Using JavaScript we need to use the “Onchnage” event where as using ajax, the request is just sent to populate the state list. Other operations can be carried out on the page.
Ajax is a part of Java Script programming. Java Script is used to manage and control a web page once downloaded. Ajax does not need to wait for the whole page to download.
Use of Ajax can reduce connections to the server since the script has to be requested once.

Describe how to create AJAX objects.
Ajax Objects can be created by the following syntax:
Var ajax= New ajaxObject(‘page path’). Here page path is the URL you want the Object to call. The URL must be of the same domain as the webpage.

What is XMLHttpRequest object ?
XMLHttpRequest object is used to transfer data between a client and a server. Here the client can be a web browser. Here, the client can send and receive data without reloading the page.
It can be created as follow
Var request = new XMLHttpRequest ()

Describe the formats and protocols used by AJAX.
Ajax uses HTTP’s GET or POST. AJAX also uses XMLHttpRequest protocol for requesting to the web server.
AJAX uses JSON format to communicate between client and server. UED or URL encoded data formats can also be used.

What are the security issues with AJAX?
AJAX function calls are sent in plain text to server. These calls may easily reveal database details, variable names etc
User’s browsing session can be monitored my maliciously inserting scripts
Ajax may encourage developers to use multiple server side pages thereby introducing multiple entry points for attackers.

Describe how to handle concurrent AJAX requests.
JavaScipt closures can be used for handling concurrent requests. A function can be written to handle such requests. Once processing of code is over, URL and the call back function to call can be passed as parameters. These parameters are passed to the AJAXInteraction(url, callback) object. Closures insure that the proper callback function associated with a specific AJAX interaction is called.

How do you know that an AJAX request has completed?
By determining the readyState property value of XMLHttpReqyest, One can know if the request is completed. If the readyState value = 4, the request has been completed and the data is available.

Explain about the Response time when we are using this language?
Response time is also known as latency which can be described as the time taken or interval between the time taken to process the request generated from the client on the server. Proper handling of the XMLHttprequestobject might be the cause for some delays between the client and server request.

Explain about the onreadystatechange property?
Onreadystatechange property is very useful in Ajax. It stores information received from the client. It stores the function which can process the request generated from the client side in the server thereby reducing the time lag and increasing the efficiency of the process.

Explain about the readystate property?
Readystate property holds the response of the server to the query generated from the client side. Each time the readystate property changes onreadystatechange function will be executed. Some of the values for the readystate property are as follows if the status is zero the request is not initialized, 1 the request has been set up, 2 the request has been sent, 3 the request is in process, 4 the request is complete.

Explain about sending a request to the server?
To send a request to the server we should use the open () and send () method. Open() method has three arguments of which the first one defines which method to use which would help in sending the request. The second argument explains about the URL of the server side script. The third argument or request determines how the request should be handled whether asynchronously or not. Send () method is useful to send a request to the server to determine functionality.

If there is an input in the text field what are all the functions which get executed?
The following functions are executed when there is an input in the text field.
1) Defines the url which we should be sent to the server.
2) A parameter is added to the content of the input field.
3) A parameter is added to prevent the server from the cache.
4) When a change is triggered statechange is executed.
5) An XMLHTTP object with a given URL gets executed.
6) A request to the server is sent through HTTP.

Explain how friendly Ajax is with SEO ?
Ajax is a combination of many languages and it is not so friendly with search engine indexing because it uses Javascript for much part of its code. This problem occurs with websites which have dynamic data present in it. Search engines generally do not index Javascript present in web pages. Careful indexing should be done where there is dynamic data and presence of javascript.

Explain about the multimedia functions of ajax?
Ajax lacks built in multimedia functions. It is not so supportive of inbuilt applications but uses other browser functionalities and plugin`s such as SVG, Quicktime and flash pugin. General multimedia for ajax is achieved through mashup and hack. These multimedia functions can be obtained from outside which helps in building excellent applications.

Explain about direct ajax frameworks?
Direct ajax frameworks require CSS, HTML and ajax expertise. Authoring should be done in HTML and framework directly deals with HTML elements. Many of the frameworks and API`s are provided are many purposes such as commonly including functions (COM), event handling, DOM, and altering graphic rich elements. These frameworks are used for shopping frameworks but not for web based applications.

What does an ajax component frameworks provides?
The following features are provided for ajax component frameworks. They areCusomization Applications, skinning facilities, extensibility and programmatic control.These functions are very rich in application but they are a bit slower in execution with less control.

Explain the disadvantage of ajax related to browser integration?
Dynamically created pages created by ajax does not support back button which takes the user to the previous pages. There are various solutions to this problem out of which one solution is to use iframes. Also users can bookmark a certain application in its state. User can maintain the applications as the state of the application changes.

State the difference between GET and POST?
You would use GET when the request is idempotent, meaning that multiple requests generate the same result. In general use GET to retrieve data from the server, in other words try to change the state on the server with a GET call. Use POST methods anytime you are changing the state on the server with a GET call. In POST you are required to set the content-Type header on the XMLHttpRequest.

Explain about security of the Ajax based web applications?
The XMLHttpRequest object is subjected to the browsers security sandbox. Any resources requested by the XMLHttpRequest object must reside within the same domain from which the calling script originated from which the calling script requested. XMLHttpRequest cannot request services due to security restriction, outside the domain from which the script was originally served.

Explain about clearPreviousResults?
The clearPreviousResults function performs two tasks removing the results header task that appears at the top and clearing any rows from the results table. The nest task is to clearPreviousResults is to delete any rows that may already be in the table displaying the search results. Any results rows are child nodes of the tbody node.

Explain about the getElementsByTagName and parseResults function?
You use the tag method to retrieve all the property elements in the XML document as an array and assign the array to the local variable properties. Once you have the array of property elements you can iterate over each element in the array and retrieve the data. With parseResultsfunction you can get the next element in the array and assign it to the local property.