C# Web Service - Error Handling

Associate
Joined
28 Nov 2004
Posts
1,237
Location
Birmingham
Hi there!
I'm new to web services and I'm building my 1st one (the asmx way). It's all working nicely but I want to be able to present my error messages (such as login error etc) a bit more nicely.
My "GetResults" method pulls back data from the database upon logging in successfully and I'm compiling a List<> of my Items and returning them.
However, if there is an error, I want to instead return an instance of my "error" object to the user. At the moment, I can't change the return type of the method so the two objects are clashing. Any help?
 
thanks guys!
i will go down the wcf route. for the moment tho, im sticking with asmx.

i'll try out the suggested method! nice one!
 
Back
Top Bottom