|
-
Jan 19th, 2007, 08:38 AM
#1
Thread Starter
Addicted Member
can you pass data back with an exception
Hello
I have a test application that calls a web service method.
This method adds a document to a database, then retrives the doc id and then performs another operation using the doc id then the doc id is returned to the test application.
Problem is if the document is added and the doc id retrieved and something goes wrong in the second oepration and an exception is thrown back then the user does not get the doc id even tho the first operation completed successfully.
is it possible to pass the doc id back along with the exception when it is thrown.
or
is splitting this one method into two sub methods a betetr option and then call the sub methods seperatly from the test application?
or what other way could i do this.
-
Jan 19th, 2007, 07:44 PM
#2
Fanatic Member
Re: can you pass data back with an exception
You need to create your own custom Exception and return that exception then you can have access to any information you wish.
Code:
public class CustomExceptions : ApplicationException
{
public CustomExceptions ()
: base()
{ }
public CustomExceptions (String message)
:base(message)
{ }
}
-
Jan 22nd, 2007, 11:34 AM
#3
Re: can you pass data back with an exception
If the entire thing is one logical transaction, then the user should not get a DOC id back. If they're two separate transactions, then yes, do make two calls to two different methods.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|