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
Solved

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

Posted on 2008-06-17
4
801 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
A phishing scam that claims a recipient’s credit card details have been “suspended” is the latest trend in spoof emails.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

789 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