<p>This <a href="https://stackoverflow.com/questions/11782/file-uploads-via-web-services">question and answer</a> shows how to send a file as a byte array through an XML web service. How much overhead is generated by using this method for file transfer?  I assume the data looks something like this:</p>

<pre><code>&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&lt;bytes&gt;
    &lt;byte&gt;16&lt;/byte&gt;
    &lt;byte&gt;28&lt;/byte&gt;
    &lt;byte&gt;127&lt;/byte&gt;
    ...
&lt;/bytes&gt;
</code></pre>

<p>If this format is correct, the bytes must first be converted to UTF-8 characters. Each of these characters allocates 8 bytes. Are the bytes stored in base 10, hex, or binary characters? How much larger does the file appear as it is being sent due to the XML data and character encoding? Is compression built into web services?</p>

[{'answer_id': 11830, 'author': 'Mark Glorie', 'author_id': 952, 'author_profile': 'https://Stackoverflow.com/users/952', 'pm_score': 0, 'selected': False, 'text': "<p>I use this method for some internal corporate webservices, and I haven't noticed any major slow-downs (but that doesn't mean it's not there).  </p>\n\n<p>You could probably use any of the numerous network traffic analysis tools to measure the size of the data, and make a judgment call based off that.</p>\n"}, {'answer_id': 11832, 'author': 'Kevin Dente', 'author_id': 9, 'author_profile': 'https://Stackoverflow.com/users/9', 'pm_score': 5, 'selected': True, 'text': '<p>Typically a byte array is sent as a <code>base64</code> encoded string, not as individual bytes in tags. </p>\n\n<p><a href="http://en.wikipedia.org/wiki/Base64" rel="nofollow noreferrer">http://en.wikipedia.org/wiki/Base64</a></p>\n\n<p>The <code>base64</code> encoded version is about <strong>137%</strong> of the size of the original content.</p>\n'}, {'answer_id': 11834, 'author': 'Adam Haile', 'author_id': 194, 'author_profile': 'https://Stackoverflow.com/users/194', 'pm_score': 0, 'selected': False, 'text': '<p>I\'m not sure about all the details (compressing, encoding, etc) but I usually just use <a href="http://www.wireshark.org/" rel="nofollow noreferrer">WireShark</a> to analyze the network traffic (while trying various methods) which then allows you to see exactly how it\'s sent.</p>\n\n<p>For example, if it\'s compressed the data block of the packet shouldn\'t be readable as plain text...however if it\'s uncompressed, you will just see plain old xml text...like you would see with HTTP traffic, or even FTP in certain cases.</p>\n'}, {'answer_id': 11840, 'author': 'lomaxx', 'author_id': 493, 'author_profile': 'https://Stackoverflow.com/users/493', 'pm_score': 0, 'selected': False, 'text': "<p>To echo what Kevin said, in .net web services if you have a byte array it is sent as a base64 encoded string by default. You can also specify the encoding of the byte array beforehand. </p>\n\n<p>Obviously, once it gets to the server (or client) you need to manually decode the string back into a byte array as this isn't done automagically for you unfortunately.</p>\n"}, {'answer_id': 24522, 'author': '17 of 26', 'author_id': 2284, 'author_profile': 'https://Stackoverflow.com/users/2284', 'pm_score': 0, 'selected': False, 'text': "<p>The main performance hit isn't going to be from the transfer of the encoded file, it's going to be in the processing that the server has to do to encode the file pre-transfer (unless the files don't change often and the encoded version can be cached somehow).</p>\n"}]
['https://Stackoverflow.com/questions/11820', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/26/']