I don't know that XFire recognizes the FileDataSource object. In your
service method you should only be declaring a DataSource. On the client
side, you just construct a DataSource (using FileDataSource if you want) and
pass it into your client method:

DataSource ds = new FileDataSource(new File("file/i/want/to/send"));
client.receiveDataSource(ds);

Regards,
- Dan

On 11/28/06, Thomas Trostel <[EMAIL PROTECTED]> wrote:

I have a web service as follows:

        /** recieveFileDataSource
         * Recieve and save a transmitted file
         * @param source
         * @return
         */
        public void receiveFileDataSource(FileDataSource source)
        {

            try
            {
                // Get the name of the file being transmitted
                String fileName = source.getName();

                // Drop our new file in the tmp directory
                File to_file = new File("C:/tmp/" + fileName);

                // Get our input and output streams
                InputStream from_stream = source.getInputStream();
                FileOutputStream to_stream = new
FileOutputStream(to_file);

                int size = from_stream.available();
                int bytes_read;
                byte[] data = new byte[size];

                while((bytes_read = from_stream.read(data)) != -1)
                        to_stream.write(data, 0, bytes_read);

                from_stream.close();
                to_stream.close();

            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
        }
...

Which seems okay but on the client side how does one feed this a
FileDataSource
object?

Thanks in advance

Tom


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email




--
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

Reply via email to