我有一个接受僵尸程序GET和POST的网络服务但是当我使用PUT或DELETE调用web方法时我会得到一个响应
找不到404.0文件
[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();
}
这是响应标题
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
答案 0 :(得分:1)
好像你不能在asmx webservice文件上发出或删除请求所以我已经在web config的帮助下实现了ihttphandler和路由请求
答案 1 :(得分:0)
是的,您正在使用WCF。您的代码由WCF执行。阅读其他答案,您将理解并找到您的解决方案。