Finding the originating method in an exception
I have a program that i have developed.
Its is a WinForm app that consumes a .net web service.
This webservice then calls a business layer class, the business layer class then calls the DataAccess class to get the data for the app.
App --> WebService --> BizLayer --> DataLayer
There are 20 methods inside the web service
When an exception occurs in the DataLayer I want to be able to find out which web method originated the call.
Does anyone know of a way that from the catch block I can find out who was the originating method?
If web method C was the originator of the method chain, thats what I want to find out.
Thanks,
Nick
no other layer class appears in the stack
i am using the StackTrace property and I have a try catch within the data access method. So I guess stack traces are created at the beginning of a try-catch block.
How can I access a global stack trace or tell the web service method to initiate a stack trace?
No other method is in the stack trace property
The method originates in the web service method and the actual try catch is inside the DataAccess method.
The web services has a direct reference to my data access classes.
The actual try catch is inside the Data Access method. Inside the try catch method I want to somehow, maybe reflection, determine which web method called this function.
Does that make things clearer? Its a hard to describe
Application layer is not being used to get this information., nor will it see this data.