WebService Results
"So, in the previous example, you decide to submit a strongly-typed DataSet of rows back via the WebService when synchronizing. You then enumerate the rows of the DataSet table and create instances of the custom business objects. On each business object you call its Save() method. What does your WebMethod return? Does it return:
- A) True to indicate atomic success, False to indicate atomic failure.
- B) A DataSet of errors. If the DataSet is empty then no errors occurred.
- C) An enum representing the status of the operation.
- D) Other? "
D. Don't return anything. If there is an error updating, you should throw an exception, which will be returned in a SoapFault tag. The SoapFault tag has a Detail property that can be used to return application specific error information (like which rows failed or whatever you think might be useful to the consumer).