Click here to Skip to main content
15,881,715 members
Home / Discussions / C#
   

C#

 
GeneralRe: better way to make function returns Pin
netJP12L20-Nov-09 6:28
netJP12L20-Nov-09 6:28 
GeneralRe: better way to make function returns [modified] Pin
Saksida Bojan20-Nov-09 6:34
Saksida Bojan20-Nov-09 6:34 
GeneralRe: better way to make function returns Pin
netJP12L20-Nov-09 6:50
netJP12L20-Nov-09 6:50 
GeneralRe: better way to make function returns Pin
Saksida Bojan20-Nov-09 6:59
Saksida Bojan20-Nov-09 6:59 
AnswerRe: better way to make function returns Pin
0x3c020-Nov-09 6:38
0x3c020-Nov-09 6:38 
AnswerRe: better way to make function returns Pin
musefan20-Nov-09 7:39
musefan20-Nov-09 7:39 
GeneralRe: better way to make function returns Pin
netJP12L20-Nov-09 8:34
netJP12L20-Nov-09 8:34 
AnswerRe: better way to make function returns Pin
dojohansen23-Nov-09 10:59
dojohansen23-Nov-09 10:59 
.NET already has default mechanisms in place that let you write your web methods as if they were not, so you can have void methods and return your own custom types - although obviously the client will get just data, not operations, since it's a web service, and you do not have type affinity (the representation of the type on the client need not be the same, so you can't do things like return int and assume that the bits in the int are the same on the client side - though the number it represents will still be the same).

So how about

public void AddUser(string username)
public void DeleteUser(string userID)
public User GetUser(string userID)
public void DeleteFile(string fileID)

instead? The service will still return something indicating the call was successful for the void methods, and a serialized User object from the GetUser function. (How something like "GetUser" can be of any use returning bool is beyond me.)

As for errors, by default the exception message will be serialized and sent to the client in the event of an unhandled exception in your web service.
QuestionStream closes while reading a socket Pin
joana.simoes20-Nov-09 5:11
joana.simoes20-Nov-09 5:11 
AnswerRe: Stream closes while reading a socket Pin
Paulo Zemek20-Nov-09 5:57
mvaPaulo Zemek20-Nov-09 5:57 
GeneralRe: Stream closes while reading a socket Pin
joana.simoes20-Nov-09 6:19
joana.simoes20-Nov-09 6:19 
GeneralRe: Stream closes while reading a socket Pin
Paulo Zemek22-Nov-09 7:44
mvaPaulo Zemek22-Nov-09 7:44 
AnswerRe: Stream closes while reading a socket Pin
Luc Pattyn20-Nov-09 6:27
sitebuilderLuc Pattyn20-Nov-09 6:27 
GeneralRe: Stream closes while reading a socket Pin
joana.simoes23-Nov-09 0:13
joana.simoes23-Nov-09 0:13 
GeneralRe: Stream closes while reading a socket Pin
joana.simoes23-Nov-09 0:39
joana.simoes23-Nov-09 0:39 
GeneralRe: Stream closes while reading a socket Pin
Luc Pattyn23-Nov-09 0:43
sitebuilderLuc Pattyn23-Nov-09 0:43 
GeneralRe: Stream closes while reading a socket Pin
joana.simoes23-Nov-09 3:56
joana.simoes23-Nov-09 3:56 
NewsRe: Stream closes while reading a socket Pin
joana.simoes23-Nov-09 6:43
joana.simoes23-Nov-09 6:43 
AnswerRe: Stream closes while reading a socket Pin
dojohansen23-Nov-09 11:15
dojohansen23-Nov-09 11:15 
NewsRe: Stream closes while reading a socket Pin
joana.simoes24-Nov-09 1:37
joana.simoes24-Nov-09 1:37 
QuestionExcel Formatting. Pin
FEMDEV20-Nov-09 4:47
FEMDEV20-Nov-09 4:47 
AnswerRe: Excel Formatting. Pin
toby3120-Nov-09 8:16
toby3120-Nov-09 8:16 
GeneralRe: Excel Formatting. Pin
FEMDEV22-Nov-09 22:44
FEMDEV22-Nov-09 22:44 
QuestionSQLite Pin
jashimu20-Nov-09 3:26
jashimu20-Nov-09 3:26 
AnswerRe: SQLite Pin
MeLight20-Nov-09 3:35
MeLight20-Nov-09 3:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.