Solved

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

Posted on 2008-06-17
4
804 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

728 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