RSS Feed for This PostCurrent Article

Web Services Interview Question

Can you give an example of when it would be appropriate to use a web service as opposed to non-serviced .NET component
Web service is one of main component in Service Oriented Architecture. You could use web services when your clients and servers are running on different networks and also different platforms. This provides a loosely coupled system. And also if the client is behind the firewall it would be easy to use web service since it runs on port 80 (by default) instead of having some thing else in Service Oriented Architecture applications.

What is the standard you use to wrap up a call to a Web service
“SOAP”

What is the transport protocol you use to call a Web service SOAP
HTTP with SOAP

What does WSDL stand for?
“WSDL stands for Web Services Dsescription Langauge. There is WSDL.exe that creates a .wsdl Files which defines how an XML Web service behaves and instructs clients as to how to interact with the service. eg: wsdl http://LocalHost/WebServiceName.asmx”

Where on the Internet would you look for Web Services?
www.uddi.org

What does WSDL stand for?
Web Services Description Language

True or False: To test a Web service you must create a windows application or Web application to consume this service?
False.

What are the various ways of accessing a web service?
1. Asynchronous Call
Application can make a call to the Web service and then continue to-do whatever it wants to do. When the service is ready it will notify the application. Application can use BEGIN and END method to make asynchronous call to the webmethod.We can use either a Wait Handle or a Delegate object when making asynchronous call.
The Wait Handle class share resources between several objects. It provides several methods which will wait for the resources to become available
The easiest and most powerful way to implement an asynchronous call is using a delegate object. A delegate object wraps up a callback function. The idea is to pass a method in the invocation of the web method. When the web method has finished it will call this callback function to process the result

2. Synchronous Call
Application has to wait until execution has completed.

What are VSDISCO files?
VSDISCO files are DISCO files that support dynamic discovery of Web services. If you place the following VSDISCO file in a directory on your Web server, for example, it returns references to all ASMX and DISCO files in the host directory and any subdirectories not noted in elements:

xmlns="urn:schemas-dynamicdiscovery:disco.2000-03-17">





How does dynamic discovery work?
ASP.NET maps the file name extension VSDISCO to an HTTP handler that scans the host directory and subdirectories for ASMX and DISCO files and returns a dynamically generated DISCO document. A client who requests a VSDISCO file gets back what appears to be a static DISCO document.

Note that VSDISCO files are disabled in the release version of ASP.NET. You can reenable them by uncommenting the line in the section of Machine.config that maps *.vsdisco to System.Web.Services.Discovery.DiscoveryRequestHandler and granting the ASPNET user account permission to read the IIS metabase. However, Microsoft is actively discouraging the use of VSDISCO files because they could represent a threat to Web server security.

Is it possible to prevent a browser from caching an ASPX page?
Just call SetNoStore on the HttpCachePolicy object exposed through the Response object’s Cache property, as demonstrated here:

<%@ Page Language="C#" %>

<%
Response.Cache.SetNoStore ();
Response.Write (DateTime.Now.ToLongTimeString ());
%>

SetNoStore works by returning a Cache-Control: private, no-store header in the HTTP response. In this example, it prevents caching of a Web page that shows the current time.

Trackback URL

Post a Comment