Sure here is the method from the server side code
public javax.activation.DataHandler[] returnStreamingByteArray(final int
timeout) {
DataHandler ret = new DataHandler(new DataSource() {
private long start = System.currentTimeMillis();
private long end = start + timeout;
public String getContentType() {
return "text/plain";
}
public InputStream getInputStream() throws IOException {
return new InputStream() {
public int read() throws IOException {
try {
Thread.sleep(10);
} catch (InterruptedException e) {
//ignore this exception
}
if (System.currentTimeMillis() > end) {
return -1;
} else {
return (int)(Math.random() * 256);
}
}
};
}
public String getName() {
return "";
}
public OutputStream getOutputStream() throws IOException {
return null;
}
});
return new DataHandler[]{ret};
}
-----Original Message-----
From: Davanum Srinivas [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 04, 2007 8:36 PM
To: [email protected]
Subject: Re: Streaming Soap with Attachments
Axis1 or Axis2? Can you post some code of what you tried?
thanks,
dims
On 7/4/07, Peter Makoi <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Does soap with attachments using MIME multipart support streaming?
>
> I have goggled around trying to find out if there is a possibility of
doing
> that but i end up getting some old postings and documentations that
suggest
> that SwA does not support streaming
>
> I have also tried to simulate streaming a considerably large amount of
data
> by sending it as a data handler and then use the streaming capability
of the
> activation framework to stream the data into an output stream
>
> But what I got is an overhead equivalent to the time spend to transmit
the
> whole file to the client before the streaming begins(my conclusion was
that
> the data is received in a one-go and because of it's large size it
take's
> the processor sometime to allocate some memory space to save it before
the
> streaming even begins).... Does anyone have any explanation? Thanks in
advance
--
Davanum Srinivas :: http://davanum.wordpress.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]