Re: OWC COM Object Credentials in ASP.NET and Web Services

From: Alvin Bruney [ASP.NET MVP] (www.lulu.com/owc)
Date: 03/25/05


Date: Thu, 24 Mar 2005 19:38:39 -0500

I actually thought about this for the entire day because it disturbed me
that Aspcompat would fix the issue. I have a clue but I'm not entirely
convinced that this is the sole reason.

>PS. Alvin this is a continuation of my previous post from TJCube. I am sure
> that in your research for your .Net book, you might have come across this
> problem before.
That's a wise move to make that connection (i can hear the desperation in
your voice). I did fix this issue once. I'm straining to remember what i did
(old age).

So, one thing that you can do - since i suspect this issue is because of the
request being serviced on an MTA thread pool that lacks the appropriate
permission, you will need to make sure that the account is part of the OLAP
administration account. If that doesn't fix it, here is your next step.

instead of guessing, ask the webservice to tell you what account it is being
run under. For instance, do this
[webmethod]
public string whoami()
{
    //it would help to verify this line cuz it came from a tired brain
    return System.Windows.Security.Principal.WindowsIdentity.Name;
}

so let's say it returns NETWORK SERVICE/vapor, you would turn around and add
the appropriate olap permissions to the vapor account. That should fix it
for you.

The reason it works in the code-behind is because impersonation forces the
executing thread to have the correct permissions, however, a web request
from a webservice would use the default account.

-- 
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
_________________________
"Trevor Howe" <TrevorHowe@discussions.microsoft.com> wrote in message 
news:64F6B063-F8C3-44E0-BC61-21675DDAA884@microsoft.com...
> Hi All
>
> I got hold of an article about building an OLAP Reporting APP in ASP.Net.
> This article makes use of a Pivot Table on a web form and then uses a web
> service to set the various properties on the Pivot table. Here is a link 
> to
> that article:
>
> http://msdn.microsoft.com/msdnmag/issues/03/10/OLAP/default.aspx
>
> I found that the code worked fine except when I was trying to communicate
> with the fieldset property of the Pivot view. It gave an interop.owc10
> unspecified error (which tells me nothing). After two weeks of
> troubleshooting, and the help of one of my colleagues who knows a lot more
> about .Net than me, we have narrowed this problem down to a permissions 
> issue
> on the COM component (i.e. the Pivot table object on the web form).
>
> We have enabled impersonation by setting the <identity impersonate="true" 
> />
> in the web.config file. This allows the signed on users credentials to go
> through instead of the ASPNET account. The problem was that these same
> credentials were not being passed to the COM object. The solution, we 
> found,
> was to set the ASPCOMPAT property of the web form page to true. This works 
> if
> the code is sitting in code behind form, BUT NOT FOR WEB SERVICES.
>
> I need to get this up and running using web services, but web services 
> does
> not have any ASPCOMPAT property.
>
> What now? Is there any better way to do this? I am pretty new to .net, so
> any help would be appreciated.
>
> PS. Alvin this is a continuation of my previous post from TJCube. I am 
> sure
> that in your research for your .Net book, you might have come across this
> problem before.
>
> PPS. Jeffrey Hasan, Kenneth Tu - as authors of the article and 
> accompanying
> source code, can't you can shed some light on this matter?
>
> 


Relevant Pages

  • Re: Outlook 2007 woes - getting stuck at "updating cached messages
    ... and then "updating cache 250/xxx" issue crops up through ... Good thing I have iphone and web access to this email account. ... I can watch it go into an infinate loop of send/recieve, ... FIX - I deleted and re-established my IMAP account, ...
    (microsoft.public.outlook)
  • RE: Mailmerge works for me but not my client!
    ... On his PC are 2 user accounts - one I use for maintenance and the ... account it opens and merges successfully. ... error trap everywhere - but this looks like a bug in Access / Word. ... However I am at a loss as to how to find the cause and fix it. ...
    (microsoft.public.access.modulesdaovba)
  • Re: Reading keys from HKEY_CURRENT_USER from an impersonated Web Service
    ... profile for a specific user, you'll have to load it yourself by calling ... expensive in Web services where you need to ... the user is the local Administrator account. ...
    (microsoft.public.dotnet.languages.csharp)
  • Outlook 2003/Gmail/Default Mail Client/Error
    ... but I can't seem to find a definitive fix. ... "Either there is no default mail client or the current mail client ... noticed it would happen even when Outlook was shut down. ... Yes, I have another POP account w/my ISP, no I do not have an Exchange ...
    (microsoft.public.outlook.general)
  • RE: aspnet_wp.exe could not be launched because...
    ... domain account password is changed, ... One common reason is to get around the web services restrictions on Windows ... Server 2003, which is much better served by allowing web service GET and/or ... > specifically any manage code crash ...
    (microsoft.public.dotnet.framework)