Congratulations to all monthly winners of May 2013 !!! They have won INR 2900 cash and INR 27497 worth prize.
DotNetFunda.Com Logo
Twitter TwitterLinkedIn
YouTubeGoogle
 Online : 11754 |  Welcome, Guest!   Register  Login
 Home > Interview Questions > Remoting, Web Services, XML, XSLT Interview Questions

Now you don't need go anywhere to get the best interview questions on Microsoft technology. We are trying to gather all real interview questions asked from MNCs and put them here. You can also assist us in doing so by submitting .net interview questions. These questions are generally different from certification questions however it may help you in that too.



Page copy protected against web site content infringement by Copyscape
Remoting is a more efficient communication exchange when you can control both ends of the application involved in the communication process. Web Services provide an open-protocol-based exchange of informaion. Web Services are best when you need to communicate with an external organization or another (non-.NET) technology.

What is DOM?


Posted by: Raja
Document Object Model (DOM) is a W3C specification that defines a standard (abstract) programming API to build, navigate and update XML documents. It is a "tree-structure-based" interface. As per the DOM specification, the XML parsers (such as MSXML or Xerces), load the entire XML document into memory, before it can be processed. XPath is used to navigate randomly in the document, and various DOM methods are used to create and update (add elements, delete elements, add/remove attributes, etc.) the XML documents.

UDDI is a platform-independent framework for describing services, discovering businesses, and integrating business services by using the Internet.

1. UDDI stands for Universal Description, Discovery and Integration
2. UDDI is a directory for storing information about web services
3. UDDI is a directory of web service interfaces described by WSDL
4. UDDI communicates via SOAP
5. UDDI is built into the Microsoft .NET platform

WSDL (Web Services Description Language) is an XML-based language for describing Web services and how to access them.

In .Net Remoting, an application use Channel to send message to another application which is runing in different domain or process. Before sending message, Channel converts message into appropriate format like XML or binary format. The channel that carries message(Mashalled parameter) can use protocal like TCP and HTTP. Channel can be HTTPChannel and TCPChannel. The HTTPChannel use soapFormatter to serialize messages into the XML format using SOAP protocal. Using SOAP method allows the client to call method on the remote object that might not be using .Net framework. The TCPChannel use binaryFormatter to serialize message into binary stream.

Marshal-by-value-objects - 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-object - 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.

The remotable objects are the objects which can be distributed accross domains, can be used with domain. The non-remotable objects are the objects which can't be distributed accross domains. In distributed system, if an object is very big, we can make it non-remotable object.

W3C, in the XML specification, has defined certain rules that need to be followed while creating XML documents. The examples of such rules include: having exactly one root element, having end-tag for each start- tag, using single/double quotes for attribute values, and so on. If an XML document follows all these rules, it is said to be well-formed document and XML parsers can be used to parse and process such documents.
Document Type Definitions (DTDs) or XML Schemas can be used to define the structure and content of a specific class of XML documents. This includes the parent-child relationship details, attribute lists, data type information, value restrictions, etc. In addition to the well-formedness rules, if an XML document also follows the rules specified in the associated DTD/Schema, it is said to be a valid XML document. All valid XML documents are well-formed; but the reverse is not always true, that is, well-formed XML documents do not necessarily have to be valid.

In .Net Remoting, an application use Channel to send message to another application which is running in different domain or process. Before sending message, Channel converts message into appropriate format like XML or binary format. The channel that carries message(Mashalled parameter) can use protocal like TCP and HTTP. Channel can be HTTPChannel and TCPChannel. The HTTPChannel use soapFormatter to serialize messages into the XML format using SOAP protocal. Using SOAP method allows the client to call method on the remote object that might not be using .Net framework. The TCPChannel use binaryFormatter to serialize message into binary stream.

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.

First, let's start off by creating a very simple webservice.
Creating A Webservice
1.Create a folder named Webservice under wwwroot
2. Create a File
<%@ WebService Language="c#" Class="AddNumbers"%>

using System;
using System.Web.Services;
public class AddNumbers : WebService
{
[WebMethod]
public int Add(int a, int b){
int sum;
sum = a + b;
return sum;
}
}
3.Save this file as AddService.asmx [asmx-> file extension]
4.Now the webservice is created and ready for the clients to use it.
5. Now we can call this webservice using
http://ip address/Webservice/Addservice.asmx/Add?a=10&b=5
This will return the result in XML format
Deploying the Webservice in the Client Machine
1.At the command prompt:
WSDL http://ip address ofthe site/WebService/MathService.asmx /n:NameSp /out:FileName.cs]
-This will create a file called FileNmame.cs .
WSDL -> WebServices Description Language (This is an application available at C:\Program
Files\Microsoft.NET\FrameworkSDK\Bin)
NameSp -> Name of the NameSpace which will be used in client code for deploying the webservice.
2.Compilation
CSC /t:library /r:system.web.dll /r:system.xml.dll CreatedFile.cs
This will create a dll with the name of the public class of the asmx file.( In our case, it is "AddNumbers.dll" )
CSC is an application available at C:\WINNT\Microsoft.NET\Framework\v1.0.2914
3.Put the dll file inside WWWRooT\BIN [Create a BIN Folder in WWWRoot]
Making use of WebService in client asp/aspx page
<%@ import Namespace = "NameSp" %>
<script language = "c#" runat = "server">
public void Page_Load(object o, EventArgs e){
int x = 10;
int y = 5;
int sum;
//Instantiating the public class of the webservice
AddNumbers AN = new AddNumbers();
sum = AN.Add(x,y);
string str = sum.ToString();
response.writeline(str);
}
</script>
Note
It is advisable to
1. Copy the .asmx file to the folder containing WSDL aplication (C:\Program Files\Microsoft.NET\FrameworkSDK\Bin) before creating cs file.
2. Copy the created .cs file to the folder containing CSC application

The process of communication between different operating system processes, regardless of whether they are on the same computer. The .NET remoting system is an architecture designed to simplify communication between objects living in different application domains, whether on the same computer or not, and between different contexts, whether in the same application domain or not.

Singleton types never have more than one instance at any one time. If an instance exists, all client requests are serviced by that instance.

Single Call types always have one instance per client request. The next method invocation will be serviced by a different server instance, even if the previous instance has not yet been recycled by the system.

The main classes working with XML data are as follows: -

1. XmlTextReader 

2. XMLTextWriter
3. XMLDocument
4. XmlDataDocument
5. XmlNodeReader
6. DocumentNavigator

Found this useful, bookmark this page link to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape
Navigate to Page: 1 | 2 | 3 | 4 | 5 | 6 | 7 |

 More Exclusive Remoting, Web Services, XML, XSLT Interview Questions and Answers here


Found interesting? Add this to:


About Us | Contact Us | The Team | Advertise | Software Development | Write for us | Testimonials | Privacy Policy | Terms of Use | Link Exchange | Members | Go Top
General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action.
Copyright © DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. | 6/20/2013 1:56:57 AM