I have a back end c# service running an html/angularjs front end app. We have an authentication service, which may be the problem but I'm not sure..so i mentioned it just in case. We are able to login (....services/api/auth/login) and also able to get all the users (...services/api/users), but whenever we try to delete (...services/api/users/ + username, being sent as a DELETE call) or post/put(...services/api/users/ + username being sent as POST and PUT respectively) we are getting a 500 error.
The code looks like this:
[HttpGet]
// GET api/users
public IEnumerable<UserDTO> Get()
{
return (new LdapHelper()).GetAll();
}
[HttpDelete]
// DELETE api/users/kmader
public UserDTO Delete(string id)
{
if (id == null || id == String.Empty)
{
throw new ApplicationException("Id is null or empty, please verify the DELETE request is built correctly.");
}
return (new LdapHelper()).Delete(new UserDTO { UserName = id });
}
This isn't all the code but I believe enough. As far as the web.config file, I am using a <identity impersonate="true"..... >
tag because I saw somewhere that you needed that.
The error that I am getting is simply:
DELETE https://....Services/api/users/username 500 (Internal Server Error)
QUESTION: I wish I could be more clear, but my question is really that I have no idea what could be going on. Please comment for further details that may help.
EDIT A couple of you have mentioned debugging, and it should be mentioned that locally this isn't an issue. When it is published and deployed to our server is where this is going wrong...So I have access to the code but its all .dll files so I can't really debug there.