0

I have a webservice that accepts bot GET and POST but when i call the webmethod using PUT or DELETE i get a response as

404.0 file not found

   [WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.Web.Script.Services.ScriptService]
public class reste : System.Web.Services.WebService
{
    HttpContext httpContext;
    dynamic response;
    string result;

    [WebMethod(true) ]
    public void clients()
    {
        initialize();

        ClientServices cl = new ClientServices(httpContext);
        result = cl.processRequest();

        sendResponse();

    }

here is the response headers

Status Code: 404
Date: Sun, 23 Feb 2014 21:47:28 GMT
Server: Microsoft-IIS/8.0
X-Powered-By: ASP.NET
Access-Control-Allow-Methods: GET,PUT,POST,DELETE,OPTIONS
Content-Type: text/html; charset=utf-8
Access-Control-Allow-Origin: *
Cache-Control: private
X-SourceFiles: =?UTF-8?B?        YzpcdXNlc
Access-Control-Allow-Headers: Content-Type
Content-Length: 4972
Sabareesh Kkanan
  • 1,201
  • 1
  • 14
  • 22
  • Duplicate of [PUT and DELETE getting 404 in WCF REST service .net 4 when running in IIS 6.0][1] [1]: http://stackoverflow.com/questions/5887089/put-and-delete-getting-404-in-wcf-rest-service-net-4-when-running-in-iis-6-0 – AxD Feb 23 '14 at 22:58
  • I am not using WCF. From the response header it is also clear that server can receive PUT request – Sabareesh Kkanan Feb 23 '14 at 23:38

2 Answers2

1

It seems like you cannot do put or delete request on asmx webservice files so i have implemented ihttphandler and routed request with help of web config

Sabareesh Kkanan
  • 1,201
  • 1
  • 14
  • 22
0

Yes, you are using WCF. Your code is executed by WCF. Read the other answer and you'll understand and find your solution right there.

AxD
  • 2,714
  • 3
  • 31
  • 53