Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 959
  • Last Modified:

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

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
webressurs
Asked:
webressurs
  • 2
1 Solution
 
käµfm³d 👽Commented:
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
 
Dave BaldwinFixer of ProblemsCommented:
'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
 
webressursAuthor Commented:
This error was caused by a failure in the cache procedure (webservice).
0
 
webressursAuthor Commented:
Problem solved by fixing the cache webservice.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now