Need to change your career to Web API? Then we will offer you with all the essential entity for you to clear the interview Web API jobs. With our jobs portal you will find the number of jobs associated to you along with the Web API Interview Questions and Answers. There are numerous leading companies that offer jobs in several roles like Senior Python Developer - Web API/MicroServices, PHP HTML Developer - MVC/REST API, .NET Developers with Angular JS and WEB API, MVC/WebApi C# Developer, CallHealth - MEAN Stack Developer - Webservices/Web API, Backend Developer – WebAPI and many other roles too. To save the time in searching for all the interview questions and answers on different site we have provided you all type of interview question and answers at one place. For more details on Web API visit our site www.wisdomjobs.com.
Answer :
Unlike WCF service Web API is a framework which is used to build/develop Http based services.
Answer :
Question 3. Can We Do Unit Test Web Api?
Answer :
Web API can be unit test by using Fiddler tool.
Following is the settings to be updated in Fiddler:
Compose Tab -> Enter Request Headers -> Enter the Request Body and execute.
Question 4. Can Web Api Return View In Mvc?
Answer :
We cannot return view from Web API.
Question 5. How To Restrict Access To Methods With Specific Http Verbs In Web Api?
Answer :
With the help of Attributes(like http verbs) one can implement access restrictions in Web API.
We can define HTTP verbs as attribute over method to restrict access.
Example :
[HttpPost]
public void SampleMethod(SampleClass obj)
{
//logic
}
Question 6. What Is Web Api Routing?
Answer :
Routing is nothing but pattern matching like in MVC.
All routes will get registered in Route Tables.
Example :
Routes.MapHttpRoute(
Name: "SampleWebAPIRoute",
routeTemplate: “api/{controller}/{id}
defaults: new { id = RouteParameter.Optional}
};
Question 7. Differences Between Wcf And Web Api?
Answer :
WCF :
Web API:
Question 8. What Are The Advantages Of Using Rest In Web Api?
Answer :
Question 9. With Wcf Also You Can Implement Rest, So Why Webapi?
Answer :
Question 10. Web Api Where Is The Proxy?
Answer :
Web API doesn't make it easy for consumers to generate a service client like a SOAP WSDL does. If you're only ever going to have .NET clients it's not a big deal because they can share the contract objects you implement, but other language clients will need to manually create their client objects if you don't use SOAP.
Question 11. What Are The Advantages Using Webapi?
Answer :
Question 12. Differentiate Between Wcf And Web Api?
Answer :
WCF - Windows Communication Foundation(WCF) has been created by Microsoft with .NET Framework 3.0. It supports SOAP based services. It has compatibility with HTTP, TCP, UDP, etc. Good for developing secure and interoperable services. Used for back end purposes.
WEB API - Web API open source framework. It has compatibility with HTTP only. It has a support for non-SOAP based services. It is very light weight hence good for developing services for low bandwidth devices. It supports OData. It supports most of the MVC features. Used for front end purposes.
Answer :
TestApi is a library of utility and test APIs through which testers and developers create testing tools and automated tests for .NET and Win32 application using data-structure and algorithms.
Question 14. What Are Exception Filters?
Answer :
Exception filters will be executed when some of the exceptions are unhandled and thrown from a controller method. The reason for the exception may be anything. Exception filters will implement "Exception Filter" interface.
Question 15. How Can We Register Exception Filters?
Answer :
Three options are available to register Exception Filters which are From Action, From Controller and Global registration.
Question 16. How Can We Register Exception Filter From Action?
Answer :
We can register exception filter from action using following code
[NotImp ExceptionFilter]
public Test Customer Get My Test Customer(in custid)
{
//write the code
}
Question 17. How Can We Register Exception Filter From Controller?
Answer :
We can register exception filter from controller using following code:
[NotImp ExceptionFilter]
public class Test CustomerController : Controller
{
// write the code
}
Question 18. How Can We Register Exception Filter Globally?
Answer :
We can register exception filter globally using following code:
GlobalConfiguration.Configuration.Filters.Add(new MyTestCustomerStore.NotImplExceptionFilterAttribute());
Question 19. How To Handle Errors In Web Api?
Answer :
Several classes are available in Web API to handle errors. They are HttpError, HttpResponseException, Exception Filters, Registering Exception Filters.
Web API Related Tutorials |
|
---|---|
ASP.NET Tutorial | Framework7 Tutorial |
HTTP Tutorial | Windows Communication Foundation (WCF) Tutorial |
Java XML Tutorial | JSON (JavaScript Object Notation) Tutorial |
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.