Solved

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

Posted on 2008-06-17
4
805 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
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…
The viewer will learn how to count occurrences of each item in an array.

623 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