home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / QuickStart / howto / doc / formatters.aspx < prev    next >
Encoding:
Text File  |  2000-06-08  |  3.9 KB  |  75 lines

  1.  
  2. <!-- #include virtual="/quickstart/howto/include/header.inc" -->
  3.  
  4. <h4>How Do I...Use message formatters?</h4>
  5.  
  6. <div class="indent" style="width:660">
  7. <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">Message
  8. queuing makes it easy for application developers to communicate with application
  9. programs quickly and reliably by sending and receiving messages. Messaging
  10. provides you with guaranteed message delivery and a robust, fail-safe way to
  11. carry out many of your business processes.<br>
  12. <br>
  13. The MessageQueue component allows you to easily incorporate message-based
  14. communication into your applications. Using this component and its associated
  15. language features, you can send and receive messages, explore existing queues,
  16. create and delete queues, and perform a variety of other operations using a
  17. simple programming model.<br>
  18. <br>
  19. The sample illustrates how to use the MessageQueue component to use different
  20. serialization mechanisms to send objects through a message queue. To run the
  21. sample you have to have Message Queuing installed on your system.<br>
  22. <br>
  23. Selecting a serialization mechanism is as simple as changing the value of one
  24. property. Here are some examples:</font></p>
  25. <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
  26. <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">1.
  27. Send a message using an XML based serialization mechanism:</font></p>
  28. <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
  29. <blockquote>
  30.   <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Courier New" color="#0000ff" size="2">mq.Formatter = new SoapMessageFormatter(); <br>
  31.   mq.Send(order);</font></p>
  32. </blockquote>
  33. <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
  34. <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">2.
  35. Send a message using a binary serialization mechanism:</font></p>
  36. <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
  37. <blockquote>
  38.   <p style="word-spacing: 0px; margin-top: 0px; margin-bottom: 0px"><font face="Courier New" color="#0000ff" size="2">mq.Formatter = new BinaryMessageFormatter(); <br>
  39.   mq.Send(order);</font></p>
  40.   <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
  41. </blockquote>
  42. <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">3.
  43. </font><font face="Tahoma" size="1">Send a message using a serialization
  44. mechanism which is compatibile with the MSMQ ActiveX Formatter</font><font face="Tahoma" size="1">:</font></p>
  45. <blockquote>
  46.   <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"> </p>
  47.   <p style="word-spacing: 0px; margin-top: 0px; margin-bottom: 0px"><font face="Courier New" color="#0000ff" size="2">mq.Formatter = new ActiveXMessageFormatter(); <br>
  48.         mq.Send(order); </font></p>
  49. </blockquote>
  50. <p style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; WORD-SPACING: 0px"><font face="Tahoma" size="1">Have
  51. a good time MessageQueue'ing!</font></p>
  52.  
  53. </div>
  54.  
  55. <h4>Example</h4>
  56.  
  57. <p>
  58. <div class="indent">
  59. <a target="_blank" href="/quickstart/howto/samples/Services/MessageQueue/Formatters">
  60. <img style="border-color:black" border=1 src="/quickstart/images/genicon.gif"><br>
  61. </a>
  62. <div class="caption">Formatters.exe</div><br>
  63. [<a target="_blank" href="/quickstart/howto/samples/Services/MessageQueue/Formatters">View Sample</a>] | 
  64. [<a target="_blank" href="/quickstart/util/srcview.aspx?path=/quickstart/howto/samples/Services/MessageQueue/Formatters/Formatters.src">View Source</a>]<p>
  65. </div>
  66.  
  67. <h4>Source Code</h4>
  68.  
  69. <div class="code">
  70. <xmp>
  71. <!-- #include virtual="/quickstart/howto/samples/Services/MessageQueue/Formatters/Formatters.cs" -->
  72. </xmp>
  73. </div>
  74.  
  75. <!-- #include virtual="/quickstart/howto/include/footer.inc" -->