Click here to Skip to main content

C#

    RSS: RSS Feed
Home > Forums > C#

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page  Show 
  Refresh
GeneralRe: better way to make function returns [modified] PinmemberSaksida Bojan7:34 20 Nov '09  
GeneralRe: better way to make function returns PinmembernetJP12L7:50 20 Nov '09  
GeneralRe: better way to make function returns PinmemberSaksida Bojan7:59 20 Nov '09  
AnswerRe: better way to make function returns Pinmember0x3c07:38 20 Nov '09  
AnswerRe: better way to make function returns Pinmembermusefan8:39 20 Nov '09  
GeneralRe: better way to make function returns PinmembernetJP12L9:34 20 Nov '09  
AnswerRe: better way to make function returns Pinmemberdojohansen11:59 23 Nov '09  
.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 Pinmemberjoana.simoes6:11 20 Nov '09  
AnswerRe: Stream closes while reading a socket PinmemberPaulo Zemek6:57 20 Nov '09  
GeneralRe: Stream closes while reading a socket Pinmemberjoana.simoes7:19 20 Nov '09  
GeneralRe: Stream closes while reading a socket PinmemberPaulo Zemek8:44 22 Nov '09  
AnswerRe: Stream closes while reading a socket PinmvpLuc Pattyn7:27 20 Nov '09  
GeneralRe: Stream closes while reading a socket Pinmemberjoana.simoes1:13 23 Nov '09  
GeneralRe: Stream closes while reading a socket Pinmemberjoana.simoes1:39 23 Nov '09  
GeneralRe: Stream closes while reading a socket PinmvpLuc Pattyn1:43 23 Nov '09  
GeneralRe: Stream closes while reading a socket Pinmemberjoana.simoes4:56 23 Nov '09  
NewsRe: Stream closes while reading a socket Pinmemberjoana.simoes7:43 23 Nov '09  
AnswerRe: Stream closes while reading a socket Pinmemberdojohansen12:15 23 Nov '09  
NewsRe: Stream closes while reading a socket Pinmemberjoana.simoes2:37 24 Nov '09  
QuestionExcel Formatting. PinmemberFEMDEV5:47 20 Nov '09  
AnswerRe: Excel Formatting. Pinmembertoby319:16 20 Nov '09  
GeneralRe: Excel Formatting. PinmemberFEMDEV23:44 22 Nov '09  
QuestionSQLite Pinmemberjashimu4:26 20 Nov '09  
AnswerRe: SQLite PinmemberMeLight4:35 20 Nov '09  
GeneralRe: SQLite Pinmemberjashimu5:44 20 Nov '09  

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

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


Advertise | Privacy | Mobile
Web02 | 2.5.120210.1 | Last Updated 13 Feb 2012
Copyright © CodeProject, 1999-2012
All Rights Reserved. Terms of Use
Layout: fixed | fluid