title: BizTalk envelope schema self-closing node
body: <p>I have created a BizTalk receive location which has a subscribing send port which accepts an enveloped message and splits into separate messages just using the XML Receive Pipeline.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;MyEnvelope xmlns="MyNameSpace"&gt;
      &lt;MyData&gt;ABC&lt;/MyData&gt;
      &lt;MyData&gt;DEF&lt;/MyData&gt;
      &lt;MyData&gt;GHI&lt;/MyData&gt;
  &lt;/MyEnvelope&gt;
  </code></pre>
  
  <p>Gets saved as </p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;MyData xmlns="MyNameSpace"&gt;ABC&lt;/MyData&gt;
  </code></pre>
  
  <p>,</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;MyData xmlns="MyNameSpace"&gt;DEF&lt;/MyData&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;MyData xmlns="MyNameSpace"&gt;GHI&lt;/MyData&gt;
  </code></pre>
  
  <p>which is great.</p>
  
  <p><strong>However</strong>, when there are no elements in the message the service sends the message with self-closing and empty envelope:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;MyEnvelope xmlns="MyNameSpace"/&gt;
  </code></pre>
  
  <p>And I get the error message</p>
  
  <blockquote>
    <p>Source: "XML disassembler" Receive Port: "InLocation" URI:
    "c:\MyLocation*.xml" Reason: Unexpected event ("eos") in state
    "processing_header".</p>
  </blockquote>
  
  <p>If I manually create a message which is not self-closing:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;MyEnvelope xmlns="MyNameSpace"&gt;&lt;/MyEnvelope&gt;
  </code></pre>
  
  <p>I get no error. My processing is unaffected by the errors but it must have some performance impact and litters the Group Hub suspended instances view.</p>
  
  <p>It seems that BizTalk interprets self-closing nodes as whitespace instead of null. This seems linked to <a href="https://stackoverflow.com/questions/22687367/biztalk-0-parameter-web-message-not-being-sent-in-request">my issues with attempting to call a service with no parameters</a> where I need to send a self-closing node but BizTalk just sends nothing.</p>
  
  <p>It must be a common issue to handle an envelope with no content. How can I configure my application to pick up and ignore these messages with self-closing envelope nodes?</p>