title: SOAP web service using JNA to send text file data to DLL
body: <p>The following tech-stack (SOAP/JNA/Win DLLs) is a triple-whammy to me, so speak softly and use small words, please ;-)</p>
  
  <p><strong>EDITED</strong>
  The basic goal is to somehow get client-local file data across a remote web service, which provides JNA access to a DLL written in C that needs the file data.  I can fiddle with the DLL code if needed, but I am not so much a C programmer for the past several decades.</p>
  
  <p>Longer version:
  We have C-code that has been converted from a standalone application to a set of DLLs in hopes of converting the functionality into a set of services.  We have access to the C code and the ability to further change as necessary. But we are a Java shop and so there is not a wealth of C experience here (especially myself), so I hope to do the least amount of surgery on the C code.  I would also rather avoid trying to convert the core of the working mission-critical C code to Java, for fear of breaking it in the process.  But I am trying to write SOAP web services to access the DLL functionality remotely through multiple clients.  Someone initially wrote a JNA layer to access one of the simpler static interfaces.  But some of the modes of the old C application read an arbitrary number of files (currently local to the client) from a client-provided file list.</p>
  
  <p>I am trying to figure what kind of options there are for sending text file data through my JNA interface, and what is required of the client to send the files.  I saw <a href="https://stackoverflow.com/questions/1337525/pass-inputstream-through-jna-to-c-code-as-a-file-pointer">another SO question</a> indicating that sending Java <code>InputStream</code>s as C FILE pointers is an unlikely or impossible route to go.  The JNA example interfaces I have seen so far for tasks other than file transfer define Java classes extending <code>Structure</code> with pre-sized byte[] array fields for sending string data -- my files are text files.  But I do not know how many files will be found in the file list nor what the size of each file is going to be.</p>
  
  <p>Would the JNA <code>Pointer</code> come to my rescue somehow?  How would the JNA <code>Pointer</code> work across remote calls, and would it work with files directly or would I read in file contents into a <code>StringBuffer</code>, convert to a dynamically sized byte array and pass a <code>Pointer</code>?  Does SAAJ come into play at all?</p>