locked
Access SSAS cube through WCF RRS feed

  • Question

  • I have cube connected with the normal asp.net web application and its working fine.

    now i want access the cube through WCF service .When i tried it throughs the error

    "Either the user, xxx, does not have access to the xxx database, or the database does not exist."

    In IIS, i made windows authentication enabled,run the service as specific user etc;; etc;;;

    Web.config of asp.net application

        <system.web>

        <identity impersonate="true" userName="xxx" password="123456789"/>

       <authentication mode="Windows"/>
        </system.web>

    <system.serviceModel>
      <bindings>
       <basicHttpBinding>
        <binding name="BasicHttpBinding_ICubeDB" closeTimeout="00:20:00"
         openTimeout="00:20:00" receiveTimeout="00:20:00" sendTimeout="00:20:00"
         allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
         maxBufferSize="1500000" maxBufferPoolSize="1500000" maxReceivedMessageSize="1500000"
         messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
         useDefaultWebProxy="true">
         <readerQuotas maxDepth="32" maxStringContentLength="656000" maxArrayLength="656000"
          maxBytesPerRead="656000" maxNameTableCharCount="656000" />
         <security mode="None">
          <transport clientCredentialType="None" proxyCredentialType="Windows"
           realm="" />
          <message clientCredentialType="UserName" algorithmSuite="Default" />
         </security>
        </binding>
       </basicHttpBinding>
      </bindings>
      <client>
       <endpoint address="http://localhost/Cube/CubeDB.svc" binding="basicHttpBinding"
        bindingConfiguration="BasicHttpBinding_ICubeDB" contract="Scube.ICubeDB"
        name="BasicHttpBinding_ICubeDB" />
      </client>
       
     </system.serviceModel>

    Web.config of WCF Service

    <system.web>

        <identity impersonate="true" userName="xxx" password="123456789"/>

       <authentication mode="Windows"/>
        </system.web>

     <behaviors >
          <serviceBehaviors>
            <behavior  >
              <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
              <serviceMetadata httpGetEnabled="true" />
              <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />

    Code for Connecting WCF

    Scube.CubeDBClient DB = new Scube.CubeDBClient ();
          


            public DataTable GetCellset(string connection, string strMDX)
            {
                //DB.Credentials = System.Net.CredentialCache.DefaultCredentials;
                DB.ClientCredentials.Windows.ClientCredential.UserName = "CSBLR\aravind.chandr";
                DB.ClientCredentials.Windows.ClientCredential.Password = "123456789";
               // DB.ClientCredentials.Windows.AllowNtlm = true;
               // DB.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

                DB.Open();
                DataTable dt = DB.GetCellset(connection, strMDX);
                DB.Close();
                return dt;

            }

    Please help to resolve this ,with example much appreciated.

    Thanks....

    Tuesday, December 3, 2013 1:14 PM