C# Authentication.asmx出现错误-Sharepoint 2010

C# Authentication.asmx出现错误-Sharepoint 2010,c#,sharepoint,sharepoint-2010,C#,Sharepoint,Sharepoint 2010,我已添加对Sharepoint FBA网站的authentication.asmx web服务的引用。我有以下代码: Authentication auth = new Authentication(); LoginResult lResult = auth.Login("******", "******"); Login方法引发异常,如下所示: System.Web.Services.Protocols.SoapException:服务器无法运行 处理请求。-->

我已添加对Sharepoint FBA网站的authentication.asmx web服务的引用。我有以下代码:

 Authentication auth = new Authentication();
            LoginResult lResult = auth.Login("******", "******");
Login方法引发异常,如下所示:

System.Web.Services.Protocols.SoapException:服务器无法运行 处理请求。--> System.ServiceModel.FaultException`1[System.ServiceModel.ExceptionDetail]: 无法检索IIS设置。参数名称:上下文位于 Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.ReadResponse(消息 答复)在 Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken rst、RequestSecurityTokenResponse和rstr)位于 Microsoft.IdentityModel.Protocols.WSTrust.WSTrustChannel.Issue(RequestSecurityToken (rst)在 Microsoft.SharePoint.SPSecurityContext.SecurityTokenForContext(Uri 上下文,布尔BealerToken,SecurityToken onBehalfOf,SecurityToken actAs、SecurityToken委托人、SPRequestSecurityTokenProperties 属性)在 Microsoft.SharePoint.SPSecurityContext.SecurityTokenForFormsAuthentication(Uri 上下文、字符串成员资格ProviderName、字符串角色ProviderName、, 字符串用户名、字符串密码、SPFormsAuthenticationOption选项) 在 Microsoft.SharePoint.IdentityModel.SPClaimsutibility.AuthenticateFormsUser(Uri 上下文、字符串用户名、字符串密码)位于 Microsoft.SharePoint.SoapServer.Authentication.Login(字符串用户名, 字符串(密码)


我正在使用SQL成员资格提供程序设置FBA。

您是否为Web服务(http、https)使用了正确的协议?@spoekes:是的,我已经尝试了这两种协议。但是,结果总是一样的。它是否适用于Microsoft.SharePoint.IdentityModel命名空间中的SPClaimsutibility.AuthenticateFormsUser方法?@spoekes:我正在尝试开发一个使用SharePoint服务的Windows窗体应用程序。我尝试了下面的代码,但也没有成功。我也犯了同样的错误。Microsoft.SharePoint.Client.ClientContext ctx=new ClientContext(“);ctx.AuthenticationMode=ClientAuthenticationMode.FormsAuthentication;ctx.FormsAuthenticationLoginInfo=new FormsAuthenticationLoginInfo(“****”,“****”);Web w=ctx.Web;var lists=ctx.LoadQuery(w.lists);ctx.ExecuteQuery();