title: Sending XML from Java to MSMQ - bodyType from VT_EMPTY to VT_BSTR
body: <p>We work on a Java (Java EE) application, and we generate XML files in order to send them to a remote .NET application with MSMQ reading on their side.
  The XML file is generated by JDom, like so :</p>
  
  <pre><code>// add elements...
  
  Document doc = new Document(root);      
  String XmlData = new XMLOutputter(Format.getPrettyFormat().setOmitEncoding(true)).outputString(doc);
  
  try {
          SendFile( XmlData, "title" , "path");
      } catch (UnsupportedEncodingException e) {
          e.printStackTrace();
      } catch (MessageQueueException e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p>Then we use this function, using the <a href="http://msmqjava.codeplex.com/" rel="nofollow">MsmqJava library</a> to send the file :</p>
  
  <pre><code>private void SendFile(String data, String title, String outputPath) throws UnsupportedEncodingException, MessageQueueException{
      String qname="name_of_the_queue";
      String fullname= "server_path" + qname;
      String body = data;
      String label = title;
      String correlationId= "L:none";
  
      try {
          Queue queue= new Queue(fullname);
          Message msg= new Message(body, label, correlationId);
          queue.send(msg);
              } catch (MessageQueueException ex1) {
             System.out.println("Put failure: " + ex1.toString());
         }
  }
  </code></pre>
  
  <p>They correctly receive the file, but they told us that the bodyType was set to "VT_EMPTY" while they wanted "VT_BSTR", and we haven't find a clue about how to fix this. If you know another lib who does the job, or a workaround to this one, we can change with no problem.</p>
  
  <p>Thanks !</p>