4. FileServices

The FileServces bundles various file operations. Its WSDL is located at http://server:port/XServices/FileService?wsdl

4.1. downloadFile

Downloads a file as base64 encoded. Sample request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net">
   <soapenv:Header/>
   <soapenv:Body>
<!-- downloads a file from the XServices server as base64 encoded -->
      <ws:downloadFile>
         <file>
            <type>FILE</type>
            <uri>c:\temp\test.docx</uri>
         </file>
      </ws:downloadFile>
   </soapenv:Body>
</soapenv:Envelope>

Sample response:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:downloadFileResponse xmlns:ns2="http://ws.xservices.brutex.net">
         <return>
            <content>ADQBNA[... snipp ...]wAApzcAAAAA</content>
            <filename>test.docx</filename>
         </return>
      </ns2:downloadFileResponse>
   </soap:Body>
</soap:Envelope>

Encoding files as base64 is very memory consuming!

4.2. encodeFile

Encodes a file as base64. Sample request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.xservices.brutex.net">
   <soapenv:Header/>
   <soapenv:Body>
      <ws:encodeFile>
         <file>
            <type>FILE</type>
            <uri>c:\temp\test.docx</uri>
         </file>
      </ws:encodeFile>
   </soapenv:Body>
</soapenv:Envelope>

Sample response:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <ns2:encodeFileResponse xmlns:ns2="http://ws.xservices.brutex.net">
         <return>
            <content>ADQBNA[... snipp ...]wAApzcAAAAA</content>
            <filename>test.docx</filename>
         </return>
      </ns2:encodeFileResponse>
   </soap:Body>
</soap:Envelope>

DEPRECATED: Encoding files as base64 is very memory consuming!