Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/287.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# IIS未授权xml响应_C#_Iis_Smoothing_Unauthorized - Fatal编程技术网

C# IIS未授权xml响应

C# IIS未授权xml响应,c#,iis,smoothing,unauthorized,C#,Iis,Smoothing,Unauthorized,当我这样打电话给serever时: var client = new RestClient(); client.Authenticator = new NtlmAuthenticator(); var request = new RestRequest(uri); request.Method = Method.POST; request.RequestFormat = DataFormat.Xml; r

当我这样打电话给serever时:

       var client = new RestClient();
       client.Authenticator =  new NtlmAuthenticator();

       var request = new RestRequest(uri); 
       request.Method = Method.POST;
       request.RequestFormat = DataFormat.Xml;

       request.AddParameter("application/atom+xml", doc /*some xml document*/, ParameterType.RequestBody);
       IRestResponse response = client.Execute(request);

       Debug.WriteLine(response.Content); 

       if(response.StatusCode == HttpStatusCode.Created)
        {
          // always 401
        }
我得到下一个服务器响应:

<?xml version="1.0" encoding="UTF-8"?>
<SmoothStreaming xmlns="http://schemas.microsoft.com/iis/media/2011/03/streaming/management">
    <Error>
         <ErrorCode>0x80880022</ErrorCode>
         <ErrorMessage>All requests to the management APIs must be authenticated. Please install and enable an appropriate IIS authentication module for this website.</ErrorMessage>
    </Error>
</SmoothStreaming>

0x80880022
对管理API的所有请求都必须经过身份验证。请为此网站安装并启用适当的IIS身份验证模块。

我应该在哪里更改(安装)什么

我不是傻瓜。如果指定了我需要安装的模块,我不会问。我启用了iis拥有的所有现有模块。为什么您认为您的错误与iis模块有关,而与API的实际身份验证无关?如果您不清楚如何针对非您的web服务进行身份验证,您应该询问创建者他们使用的身份验证类型和可能的凭据。谢谢,我没有考虑这个问题。