Solved

One-Way ASP.NET web service loses credentials / impersonation

Posted on 2008-06-17
4
793 Views
Last Modified: 2013-11-18
I have an ASP.NET web service that access a variety of COM objects and performs a variety of tasks.

One of the methods can take a very, very long time (5 minutes perhaps).  To get around this, I had marked the service as one way ( [SoapDocumentMethod(OneWay = true)] ).

For some reason, when executing the method is marked as OneWay, it loses the credentials and starts running as the machine account (MACHINENAME$).  When not marked as OneWay, the method executes as whatever user is configured.

I've tried changing the anonymous access user in IIS, using impersonation etc. but to no avail.  It works fine, as long as it is not a one way method.

HELP PLEASE!!!!
0
Comment
Question by:chrisIerickson
  • 3
4 Comments
 

Author Comment

by:chrisIerickson
Comment Utility
I found the following comment:

"But what about the simple case of launching a fire-and-forget Web Service from an ASP.NET page. Currently marking the Web Service with the oneway=true attribute does not propogate the thread context (making database connection impossible). Waiting for the end method or an asynchronous call holds up the page. " (http://weblogs.asp.net/despos/archive/2005/10/19/427861.aspx)

It is from 2005, and talking about ASP.NET 1.1.  I'm not sure if this has been fixed in 2.0 or not.

If it is caused by losing the thread context, is there a work around?
0
 
LVL 25

Expert Comment

by:Robbie_Leggett
Comment Utility
I'm by no means an ASP expert, but could this have something to do with the number of hops the credentials have to make? Is only 1 hop supported?

:-)
0
 

Author Comment

by:chrisIerickson
Comment Utility
Only 1 hop is supported, true.  I don't believe it is making multiple hops here.  For whatever reason, it seems that the thread context is lost when using one way methods on web services.  I'm trying to figure out what the standard practice is for a one-way method (or fire and forget method) to keep the privileges or credentials its class has.
0
 

Accepted Solution

by:
chrisIerickson earned 0 total points
Comment Utility
I ended up just changing the identity the application pool is running under.  Apparantly all one-way methods, along with child threads are run under the process identity, regardless of <identity impersonate ='true'/>
It seems funny that no 'experts' were able to suggest this.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now