.NET web services Interview Preparation Guide
Download PDF

Dot NET Web Services frequently Asked Questions in various .NET web services job Interviews by interviewer. The set of Dot NET Web Services interview questions here ensures that you offer a perfect answer to the interview questions posed to you. Get preparation of Dot NET Web Services job interview

19 Dot NET Web Services Questions and Answers:

1 :: What is .Net Web Service?

Web service is the way to publish application's function on web that can be accessible to the rest of the world.
Web services are the components that can be used by other applications
ASP.NET offers easy way to develop web services, just precede the functions with a special WebMethod ()> attribute in order them to work as Web Service.
Web services are discovered using UDDI directory services.
Web services are built on XML standard and use SOAP protocol that allows them to communicate across different platforms and programming languages.
Web services easily manage to work across corporate firewalls as they use HTTP protocol which is firewall friendly.
Web services platform elements are
SOAP (Simple Object Access Protocol)
UDDI (Universal Description, Discovery and Integration)
WSDL (Web Services Description Language)
The web services are built on internet standards that are not platform or language specific.
The .Net framework provides in-built classes to build and consume web services.
The components offered by web services are reusable.
The examples of web service components can be shipment tracking, translation utility, weather forecasting, sports scores etc.

2 :: Explain SOAP?

SOAP, Simple Object Access Protocol is a communication protocol, a way to structure data before transmitting it, is based on XML standard. It is developed to allow communication between applications of different platforms and programming languages via internet.

It can use range of protocols such as HTTP, FTP, SMTP, Post office protocal 3(POP3) to carry documents.

Http-Get, Http-Post works with name/value pair which means transferring complex object is not possible with these protocols, whereas SOAP serializes complex structure, such as ASP.NET DataSets, complex arrays, custom types and XML nodes before transmitting and thus allows exchange of complex objects between applications.

Two components can easily communicate using Remote Procedure Calls protocol. But because of their compatibility and security issues, most of firewalls and proxy server block this type of messages. SOAP uses HTTP channel to transport which makes it widely accepted protocal over the internet.

3 :: Can you explain WSDL?

WSDL stands for Web Services Description Language, an XML-based language that describes Web services and how to access and locate them.

4 :: Do you know UDDI?

UDDI stands for Universal Description, Discovery and Integration. It is an open, Internet-based specification that offers directory service for storing information about web services.

5 :: Explain the protocols a .Net Web Service uses?

In .Net, a web service is bind with three different protocols such as HTTP/POST, HTTP/GET, and SOAP. This allows client with three options to choose for communication. The protocols are included in the WSDL file that is automatically generated in .NET.

Http-Get and Http-Post can only be used when name/value pairs of data is dealt with. But when data is complex in nature such as ASP.NET dataset, XML notes etc, then we can use SOAP that serializes data in simpler form before sending.

6 :: Explain how to document web services?

ASP.NET web services are considered as self documenting as they provides all information about what methods are available and what parameters they require using XML based standard called WSDL. We can also provide addition information about the web services using their WebService and WebMethod attributes.

You can add descriptions to each method through the Description property of the WebMethod attribute and to the entire web service as a whole using the Description property of the WebService attribute. You can also apply a descriptive name to the web service using the Name property of the WebService attribute. The attributes have name, description and namespace as properties which are shown in following example:

[WebService(Name = "Customer Service", Description = "Retrieve the Customer details",Namespace=http://www.apress.com/ProASP.NET/)]
public class Customer : System.Web.Services.WebService
{
[WebMethod(Description = "Returns Customer Count")]
public int GetCustomerCount()
{ ... }

[WebMethod(Description = "Returns the list of Customer")]
public DataSet GetCustomer()
{ ... }
}

Namespace allows your web service to be uniquely identified. By default, ASP.NET web services use the default XML namespace http://tempuri.org/, which is suitable only for testing. XML namespace simply identifies your web service. XML namespaces usually look like URLs. However, they don't need to correspond to a valid Internet location.

7 :: Explain when do we required ASP.NET web services?

ASP.NET web services are the great way to expose your middle tier components via internet. These components offer no issue communicating across firewalls as they use SOAP as transport protocols that transmit structured data using HTTP channel. Thus, message can be easily exchanged through port 80, i.e. through internet data port without being getting hampered by corporate firewalls or proxy server.

Web services can fit in the situation when we require integrating disparate systems written by separate vendors via internet.

Web services are primarily being used for B2B integration like authorizing employees, supplier, electronically signing of invoice etc.

8 :: Why do we need .Net Web Services?

We have a number of heterogeneous technologies available on internet. The demand for reusable components across platforms and programming languages are high. Most of the components have the limitation that they can't share or exchange data across different platforms, they are mostly language specific or platform specific. The technologies like COM, RMI, CORBA etc. contributed best to fulfill requirements to some extent, but components result from these said technologies are mostly either language specific or platform specific.

To avoid above problem, we need to have web services. Through web services we have overcome the problem of interoperability between languages and platforms. Web services uses SOAP as transport protocol which uses a text based messaging model, i.e. XML to communicate between disparate systems.

9 :: Deploying a Web Service?

Deploying the .Net Web Services is as simple as any ASP.NET application. Similar to ASP.NET applications, you need to copy or upload the .ASMX file and the .DISCO files to the appropriate directories, and that's it.

10 :: Explain in brief different distributed technologies?

The need of distributed technologies arises with the requirement of distributed computing applications. The distributed computing allows partitioning of application logic into units and spreading the unit over different computers of a network or across different networks. This helps in spreading out loads over many computers. The components once developed can be reuse by other applications. There are many technologies developed to allow the distribution and reuse of application logic.