IIS UnAuthorize xml响应

时间:2013-02-25 16:13:33

标签: c# iis smoothing unauthorized

当我像这样呼叫服务器时:

       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>

我应该更改(安装)的内容和位置?

0 个答案:

没有答案