title: How to put a byte array into XML in Scala
body: <p>I'm interacting with a .Net web service. According to the service description the server is expecting a base64Binary type.</p>
  
  <p>This is how I'm trying to build the SOAP packet:</p>
  
  <pre><code>  &lt;soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;soap:Header&gt;
      &lt;/soap:Header&gt;
      &lt;soap:Body&gt;
        &lt;uploadFile xmlns="http://localhost/"&gt;
          &lt;FileDetails&gt;
            &lt;ReferenceNumber&gt;123&lt;/ReferenceNumber&gt;
            &lt;FileName&gt;testfile&lt;/FileName&gt;
            &lt;FullFilePath&gt;file&lt;/FullFilePath&gt;
            &lt;FileType&gt;1&lt;/FileType&gt;
            &lt;FileContents&gt;{request.getContent().array()}&lt;/FileContents&gt;
           &lt;/FileDetails&gt;
          &lt;/uploadFile&gt;
        &lt;/soap:Body&gt;
     &lt;/soap:Envelope&gt;
  </code></pre>
  
  <p>In the snippet above the <code>request.getContent().array()</code> is an HTTP request I'm receiving from a mobile application developed in PhoneGap.</p>
  
  <p>The server responds that the FileContents is invalid. Any ideas?</p>