Solved

Call webservice from HTTP Delete method in ASP.NET Web API (IIS 6.0)

Posted on 2013-06-27
4
922 Views
Last Modified: 2013-09-09
In my ASP.NET Web API I got this error when running HTTP Delete:

Failed to load resource: the server responded with a status of 501 (Not Implemented)

After making a wildcard mapping in IIS the HTTP Delete finally works fine (gallery image is correctly deleted ). This is how I made the mapping in IIS:

http://www.proworks.com/blog/2012/11/14/how-to-fix-aspnet-mvc-web-api-http-put-and-delete-requests-failing/

Each time I make a HTTP Post in my Web API I update/delete the cache at the Remote website by calling a webservice (.asmx). That works perfect. But, when I make a HTTP Delete the same webservice call don't work (Remote cache is not updated).

So, my question is:
Why is it not possible to call a external webservice from a HTTP Delete method?
0
Comment
Question by:webressurs
  • 2
4 Comments
 
LVL 75

Expert Comment

by:käµfm³d 👽
ID: 39282977
So you have a Web API action declared in your Web API controller that is decorated with the Delete attribute?

e.g.

public class YourController : ApiController
{
    // Some methods

    [HttpDelete]
    public ActionResult YourDeleteAction()
    {
        // some code
    }

    // Some more methods
}

Open in new window

0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39282998
'HTTP Delete' is usually blocked to prevent people from deleting the files that make up your web site.  'Delete webservice.aspx' would be a request to delete your web service page.  http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol
0
 
LVL 1

Accepted Solution

by:
webressurs earned 0 total points
ID: 39464300
This error was caused by a failure in the cache procedure (webservice).
0
 
LVL 1

Author Closing Comment

by:webressurs
ID: 39475779
Problem solved by fixing the cache webservice.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question