【问题标题】:Problems with Oracle Membership Provider and Framework 4Oracle Membership Provider 和 Framework 4 的问题
【发布时间】:2011-11-02 18:24:59
【问题描述】:

我在 Visual Studio 2010(框架 4)中创建 Web 服务时遇到了严重问题。

无论如何,我必须使用 Oracle 会员提供程序(我已经安装了“Oracle Providers for ASP.NET 4 11.2.0.2.0”,它修改了框架的 machine.config),但我无法连接到会员。

我在web.config中的代码如下:

<configuration>
<connectionStrings>
    <remove name="OraAspNetConString"></remove>
    <add name="OraAspNetConString" connectionString="User Id=USUARIO;Password=PASSWORD;Data Source=DATABASENAME;" providerName="Oracle.DataAcces.Client"/>
</connectionStrings>

<system.web>

<membership defaultProvider="OracleMembershipProvider" userIsOnlineTimeWindow="30"/>
<roleManager defaultProvider="OracleRoleProvider" enabled="true" cacheRolesInCookie="true" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All"/>
    <authentication mode="None"/>
    <authorization>
        <allow users="*"/>
    </authorization>

我还在我的项目中添加了引用“System.Web.ApplicationServices”。

为了测试与 Oracle 成员的连接,我已将此代码放在具有我的 Web 服务的 OperationContract 之一中:

 MembershipUserCollection userC = Membership.GetAllUsers();

 sample.StringValue += " - " + userC.Count;

 bool resp = Membership.ValidateUser(id, id2);

获取的 MembershipUserCollection 总是在没有用户的情况下出现。 UserC.Count 始终为零。 参数 'id' 和 'id2' 分别是用户名和密码,用于验证(我知道这是不好用的)但总是返回 false。

有人可以帮我解决这个问题吗?

非常感谢。

PD:身份验证模式为“无”,我已尝试使用“表单”但仍无法正常工作。

【问题讨论】:

    标签: web-services oracle .net-4.0 membership


    【解决方案1】:

    问题解决了。

    我需要将应用程序的名称 (applicationName) 放在成员资格和角色管理器提供程序的标签上(在文件 machine.config 中)。

    :-)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-06-21
      • 1970-01-01
      • 2010-12-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多