home *** CD-ROM | disk | FTP | other *** search
-
- <!-- #include virtual="/quickstart/howto/include/header.inc" -->
-
- <h4>How Do I...Use message formatters?</h4>
-
- <div class="indent" style="width:660">
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">Message
- queuing makes it easy for application developers to communicate with application
- programs quickly and reliably by sending and receiving messages. Messaging
- provides you with guaranteed message delivery and a robust, fail-safe way to
- carry out many of your business processes.<br>
- <br>
- The MessageQueue component allows you to easily incorporate message-based
- communication into your applications. Using this component and its associated
- language features, you can send and receive messages, explore existing queues,
- create and delete queues, and perform a variety of other operations using a
- simple programming model.<br>
- <br>
- The sample illustrates how to use the MessageQueue component to use different
- serialization mechanisms to send objects through a message queue. To run the
- sample you have to have Message Queuing installed on your system.<br>
- <br>
- Selecting a serialization mechanism is as simple as changing the value of one
- property. Here are some examples:</font></p>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">1.
- Send a message using an XML based serialization mechanism:</font></p>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
- <blockquote>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Courier New" color="#0000ff" size="2">mq.Formatter = new SoapMessageFormatter(); <br>
- mq.Send(order);</font></p>
- </blockquote>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">2.
- Send a message using a binary serialization mechanism:</font></p>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
- <blockquote>
- <p style="word-spacing: 0px; margin-top: 0px; margin-bottom: 0px"><font face="Courier New" color="#0000ff" size="2">mq.Formatter = new BinaryMessageFormatter(); <br>
- mq.Send(order);</font></p>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
- </blockquote>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">3.
- </font><font face="Tahoma" size="1">Send a message using a serialization
- mechanism which is compatibile with the MSMQ ActiveX Formatter</font><font face="Tahoma" size="1">:</font></p>
- <blockquote>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
- <p style="word-spacing: 0px; margin-top: 0px; margin-bottom: 0px"><font face="Courier New" color="#0000ff" size="2">mq.Formatter = new ActiveXMessageFormatter(); <br>
- mq.Send(order); </font></p>
- </blockquote>
- <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">Have
- a good time MessageQueue'ing!</font></p>
-
- </div>
-
- <h4>Example</h4>
-
- <p>
- <div class="indent">
- <a target="_blank" href="/quickstart/howto/samples/Services/MessageQueue/Formatters">
- <img style="border-color:black" border=1 src="/quickstart/images/genicon.gif"><br>
- </a>
- <div class="caption">Formatters.exe</div><br>
- [<a target="_blank" href="/quickstart/howto/samples/Services/MessageQueue/Formatters">View Sample</a>] |
- [<a target="_blank" href="/quickstart/util/srcview.aspx?path=/quickstart/howto/samples/Services/MessageQueue/Formatters/Formatters.src">View Source</a>]<p>
- </div>
-
- <h4>Source Code</h4>
-
- <div class="code">
- <xmp>
- <!-- #include virtual="/quickstart/howto/samples/Services/MessageQueue/Formatters/Formatters.cs" -->
- </xmp>
- </div>
-
- <!-- #include virtual="/quickstart/howto/include/footer.inc" -->