Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2008-06-17
4
Medium Priority
?
810 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
ID: 21808127
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
ID: 21811636
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
ID: 21813355
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
ID: 21859502
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

927 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