Database Reference
In-Depth Information
So, there are many possibilities to test the code. For the message handler, it will get the
command with GUID and state , read the XML files to get a matching message, and
send it to the WCF service, which will respond back to the saga. The saga keeps track of
the message routing and states and will respond to MVCApp . The MVCApp project will
update its state in the table. There could normally be multiple views that could read the
state, maybe an admin utility to check on the state of the messages, the CSR talking to the
customer and telling them whether the payment has been processed, or a confirmation
form, or an e-mail to the customer telling them that the payment is successful, or many
other scenarios. Besides a couple of functions to read the XML file for the message,
which is just used for testing, there could be a number of scenarios added; however, the
majority of the code is simply the following, which is simple enough:
/****
* The message handler
* Matches a XML message GUID from a file and the
command sent
* to it from MVC via the Saga
* If found, sends it to the WCF Server and
responds
* with the state of what happened.
* The WCF Service must be running to complete.
*
* ****/
public class EventMessageHandler :
IHandleMessages<SendCommand>
{
public IBus Bus { get; set; }
public void Handle(SendCommand message)
{
ServiceReference1.WcfServiceOf_PayMessage_ErrorCodesClient
client1 =
new
Search WWH ::




Custom Search