Generating API token randomly
Hi,can anybody help me how to randomly generate a token for certain user to be allowed to use the API? And than every time the user tries to use the API he/she should use this token and be validated on...
View Articlepass custom error from web api to client
I am running a web api 2.2 app, & getting it to throw an exception. Debugging the api, I can see it is throwing the error with the correct custom error message. Eg "Only Zoo keepers can feed...
View ArticleReusing same HttpClient fails
So this is pretty much the error I get:An unhandled exception has occurred while executing the request. System.InvalidOperationException: This instance has already started one or more requests....
View Articleangularjs get response from IHttpActionResult
hello all,i have a api project, i use it to communicate with database, UI project accessing api project and read/write data. my doubt is, im calling API from angular js, how do i receive API message...
View ArticleAngular Js Version and Visual Studio Version
Hi everyone! I have got an assignment to implement CRUD and some other functionalities. Stack is .Net MVC 5, Web API and Angular Js of my choice (between 2,4 or 5). I am very new to angular js and...
View ArticleHow to accept JSON and XML both in Web API post method
Hi All,I have written Web API code and my web service is able to accept JSON data sent from Advanced REST Client (Chrome app)But unfortunately I am unable to get XML data on my web service POST method....
View ArticleWeb Api Hosting using Service Bus
Hi All,I have a Web api which is self hosted. I want create two Host one using Azure Service Bus and second localhost.I followed below link to host using Azure service bus but it is giving me...
View ArticleASP.NET WebAPI to use ServiceBus
Can ASP.NET Web API be used to communicate with Service Bus for exhanging messages or what are the possibilities of ASP.NET Web API and Service Bus together. Thanks in advance.
View ArticleODataController in WebAPI with Custom Entity
Hi,Am having a table with one column say Code (With this one column I want to create a custom entity with 3 columns and build a JSON is the requirement).. I created a Custom Entity like belowClass...
View ArticleNot able to debug or hit the particular action method in controller.
Hi There,I have my Web API service installed in local machine and deployed in IIS server. I am using postman to call the action method of the web api controller. For this I have put the breakpoint at...
View ArticleCan I enable OData Query pagination with a method that returns DataTable?
Hi All,I am very new to developing services with WebAPI, and have been tasked with converting our existing ASMX service to RESTful (read it as writing a WebAPI2 layer)... :PI have the Get method...
View Article404 Not Found error when calling a Web API via jQuery
I have been dealing with a "404 Not Found" error when calling a Web API in an ASP.NET MVC project for some time and I just do not find the problem. This is the second Web API that I write and I had the...
View ArticleObject is null from Postman with Post Method
I have this:[Route("api/[controller]")]public class OptoutClientController : Controller{ HttpClient client = new HttpClient(); [HttpPost] public IActionResult...
View ArticleHosting WebAPI service and Angular WebAPP in the same host
Ideally Web API services should be hosted on a host and your web application should be on different one. But due to resource constraints i want to host my API service and Angular UI on the same host.Is...
View ArticleHow to Handle created class instances (objects) properly?
I am trying to have my tasks return same object response instead of having each one with a different return. I wrote the following class, public class ApiMethodResult : IDisposable { public...
View ArticleOnly Data is coming not keys in Json format
Hi All,Below is my controller (REST API) to get the data from database.public JArray Post(FormatQuestionBySetId data) { ArrayList Objdata = new ArrayList(); string ques = string.Empty; string[] myArray...
View ArticleNot finding an action in the controller
I am not finding one of the actions in my security controller. I keep looking for a typo but don't see one.here are my route statements in Global.asax.csvoid Application_Start(object sender, EventArgs...
View ArticleGetting external authentication token for API
Hi,I need to use userID and Password or security key that is passed for authentication by external client company's web application to use my API. So, I am interested only for the server side, only to...
View ArticlePassing complex and simple type parameters in API
Hi,I created an object that wraps two parameters, one of simple and one of complex type. I use two classes for the request and response.The example that helped me with this is on this web...
View ArticleWeb Api 2 project - cant run it, Parse error, tried multiple solutions
Hello,I am receiving following error when trying to run my web api 2 web api:I am so tired of this error, ive tried like all of the solutions from...
View Article