Vote count: 0 I have some Web API server methods that include the following POST action. Without specifying the [Route()] directive, the response completes fine with CreatedAtRoute(). When setting the directive (with and without the tilde), then that method fails. Changing it to Created() makes it succeed. [HttpPost] [Route("~/api/ExamTaken")] [Authorize] [ResponseType(typeof(ExamTaken))] public async Task PostExamTaken(ExamTaken ExamTaken) { // ... db.ExamsTaken.Add(ExamTaken); await db.SaveCha...
ادامه مطلبVote count: 0 public IEnumerable GetWords() { retu db.Words.ToList(); } I need this output in XML using webapi2; i already google and try var appXmlType = config.Formatters.XmlFormatter.SupportedMediaTypes.FirstOrDefault(t => t.MediaType == "text/xml"); config.Formatters.XmlFormatter.SupportedMediaTypes.Remove(appXmlType); It gives data only in JSON. also I update following package: Microsoft.AspNetCore.Mvc.Formatters.Xml But how can I get it in XML. Thanks in advance. asked 39 secs agosurzo4368...
ادامه مطلبVote count: 0 I am new to angularJS and leaing implementing webservices. I have a sevice that I hit on 'Post man ' that is working fine but when I am implementing this service in my angular code and i tested on Google chrome console it is giving me status 405 method not found error. I don't know the reason.Below is the code I am using var myApp = angular .module('myApp',[]) .controller('MyController', function ($scope, $http) { var parameter = JSON.stringify({search:''}); $http.post(url, paramet...
ادامه مطلبVote count: 0 I'm using win32 API Logon user on c# in order to impersonate a wcf chael. The problem when service is ruing in a machine where the admin removed all the users (except admin) from "Allow logon locally" the impersonation fails. How can I impersonate the call if GPO does not allow "Allow logon locally" (Interactive login)? aditional info: I tried to use all methods (Interactive, NewCredentials, Network...) The service ruing web application serving all organization users. The admin doe...
ادامه مطلبVote count: 0 I created a simple web API in VS2015 which I'd like to test on my phone, however, I'm not able to access this API through my private IP address, only via localhost:PORT. I have read some suggestions which were saying to modify bindings in applicationhost.config file, but in this file, under I only have one site called WebSite1 which is not my web API I'm testing, therefore modifying bindings in there makes no difference. What should I make so that my web API is added to application...
ادامه مطلب