Informational messages returned with WCF involved
Posted
by DT
on Stack Overflow
See other posts from Stack Overflow
or by DT
Published on 2010-04-08T20:30:47Z
Indexed on
2010/04/08
20:33 UTC
Read the original article
Hit count: 420
This question is about “informational messages” and having them flow from a “back end” to a “front end” in a consistent manner. The quick question is “how do you do it”?
Background:
Web application using WCF to call back end services.
In the back end service a “message” may occur. Now, the reason for this “message” may be a number of reasons, but for this discussion let’s assume that a piece of data was looked at and it was determined that the caller should be given back some information regarding it.
This “informational” message may occur during a save and also may occur during retrieval of information. Again, the message is not what is important here, but the fact that there is some informational messages to give back under a number of different scenarios.
From a team perspective we all want to return these “messages” in a standard way all of the time. Now, in the past this “standard way” has been done different ways by different people.
Here are some possibilities:
1) Every operation has a “ref” parameter at the end that contains these messages
2) Every method returns these messages… however, this only kind of works for “Save” methods as one would think that “Retrieve” methods should return actual data and not messages
3) Some approach using the call context so as to not "pollute" all message signatures with something; however, with WCF in the picture this complicates things. That is, going back to the messages go on a header?
Question: Back to my question then… how are others returning “messages” such as what was described above back through tiers of an application, over WCF and back to the caller?
© Stack Overflow or respective owner