2011-11-02 98 views
0

我在使用Visual Studio 2010(Framework 4)創建Web服務時遇到了嚴重的問題。無論如何,我必須使用Oracle成員資格提供程序(我已經安裝了「用於ASP.NET 4 11.2.0.2.0的Oracle提供程序」,它修改了框架的machine.config),但我無法連接到成員資格。Oracle成員資格提供程序和框架問題4

我在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」我的項目

要測試的成員連接。甲骨文我把這段代碼放在OperationContract t之一中帽子有我的網絡服務:

MembershipUserCollection userC = Membership.GetAllUsers(); 

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

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

獲得的MembershipUserCollection總是顯示沒有用戶。 UserC.Count總是等於零。 參數'id'和'id2',用戶名和密碼分別用於驗證(這是一個糟糕的用法,我知道),但總是返回false。

有人可以幫助我嗎?

非常感謝。

PD:身份驗證模式爲'無',我試過'表格',仍然無法正常工作。

回答

0

問題解決。

我需要將應用程序的名稱(applicationName)放在成員資格和角色管理器提供程序的標籤上(在machine.config文件中)。

:-)

相關問題