Database Reference
In-Depth Information
XML serialization
NServiceBus, and ESBs in general, rely heavily on XML serialization and C# reflection as
well as many other frameworks, such as EF. There are many topics on XML serialization as
well, but we will discuss it in brief as it applies to NSB messages. It is not a requirement of
this topic to have skills in EF, MVC, reflection, and XML serialization, so introductions
will be provided. Working with NSB in general may not require these skills at first, but dig-
ging into any messaging and NSB code will start to require it; it will at least be beneficial
for deeper understanding. Extending the Entity Framework example, let's retrieve, as an ex-
ercise, XML files that look like messages from a file directory, load them into a SQL Serv-
er table, and then send the messages through message queuing. Later, we will extend this
example even more and load up the data through C# reflection. This example was derived
from the need to automatically send test message—only a few now—but it could be exten-
ded to hundreds, through NSB into MSMQ. This is testing through console programs, so a
MVC video store frontend could be added after the other pieces have been stress-tested.
There are many applications that may not require a frontend, as many organizations still
use batch processing, especially those associated with getting mainframe information,
through the use of mainframe text files being parsed into XML files as they are passed
from text into message forms. Messaging has evolved from various XML designs.
While many of the examples thus far have had simple messages, it is pretty normal that
messages, just as with XML and databases, will have multiple parts to break down the mes-
sages:
namespace MyMessages
{
public class EventMessage : IMessage
{
public Guid EventId { get; set; }
public PaymentReq paymentReq { get; set; }
}
public class PaymentReq
{
public string billerGroupId { get; set; }
public string billerId { get; set; }
public string bankRoutingNumber { get; set; } //
9-digits
Search WWH ::




Custom Search