Solved

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

Posted on 2013-06-27
4
914 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 74

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 82

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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now