Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/wcf/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WCF服务在POST中返回HTTP 405_C#_Wcf_Iis 7.5_Windows Server 2008 R2 - Fatal编程技术网

C# WCF服务在POST中返回HTTP 405

C# WCF服务在POST中返回HTTP 405,c#,wcf,iis-7.5,windows-server-2008-r2,C#,Wcf,Iis 7.5,Windows Server 2008 R2,我面临以下情况:当我使用GET(getUserByUID)调用WCF服务时,该服务返回正确的数据。当我调用InsertUser时,服务器返回HTTP错误405 Method not allowed 我认为这可能是服务器配置问题。我已经在谷歌上搜索了很多,没有找到解决办法 该环境是Win2008R2和IIS7.5 提前谢谢大家, [ServiceContract] public interface IUserService { [OperationContract] [WebGet

我面临以下情况:当我使用GET(getUserByUID)调用WCF服务时,该服务返回正确的数据。当我调用InsertUser时,服务器返回HTTP错误405 Method not allowed

我认为这可能是服务器配置问题。我已经在谷歌上搜索了很多,没有找到解决办法

该环境是Win2008R2和IIS7.5

提前谢谢大家,

[ServiceContract]
public interface IUserService
{
    [OperationContract]
    [WebGet(BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json,
    ResponseFormat = WebMessageFormat.Json, UriTemplate = "GetUserById?x={uid}")]
    User getUserByUID(string uid);

    [OperationContract]
    [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json,
    ResponseFormat = WebMessageFormat.Json, UriTemplate = "InsertUser")]
    string InsertUser(User user);

@Mairaj Ahmad感谢你的帮助

我发现了错误。我在IIS中有WebDAV处理程序映射器,即使我从IIS中删除了它


我删除了条目,服务正常。

@Mairaj Ahmad感谢您的帮助

我发现了错误。我在IIS中有WebDAV处理程序映射器,即使我从IIS中删除了它


我删除了条目,服务正常运行。

你能显示你的
web.config
吗?你能显示你的
web.config
吗?