axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jorge Medina <>
Subject Re: Does the service client caches attachments by default ?
Date Mon, 07 Jun 2010 22:16:27 GMT
Also, I want to make a recommendation to the users of my service.
Although they may use any SOAP client, I provide them with a pre-compiled
client using Axis2 v1.5.1 (yeah, I know, they could generate their own)
I want to give some advise on how to use the service when using Axis2.
If the client caches all the attachments in memory, I need to tell them to
be aware of their memory requirements.

On Mon, Jun 7, 2010 at 5:58 PM, Jorge Medina

> Hi Axis2 users:
>    I am accessing a service that provides the response with an MTOM
> attachment. (The attachment can be just hundreds of  KB up to 75 MB).
>    I am using an Axis2 v 1.5.1 client.
>    My client code looks something like:
>             MyServiceResponse myServiceResponse=service.downloadTable(tableid
> );
>             DataHandler dataHandler = myServiceResponse.getTableFile();
>             is = new GZIPInputStream(  new BufferedInputStream(
> dataHandler.getInputStream() ) );
>             BufferedReader br = new BufferedReader( new InputStreamReader(
> is, "UTF-8") );
>             int members =0;
>             for(String line = br.readLine(); line != null; line =
> br.readLine() ) {
>                  // do something with the record here ...
>                   System.out.println(line);
>             }
> where "service" is the generated stub using ADB databinding.
>     wsdl2java -o myoutputpath -d adb -u -uw -ap -or  -uri
> http://url/to/my/service.wsdl
> The The attachment is a tab-separated text file that has been gzipped.
> The file is produced "on-the-fly" from a database, there is never a
> physical file.
> The server uses SpringWS with JAXB as the marshaller/unmarshaller with mtom
> enabled.
> But I believe these details are irrelevant.
> I was expecting that the call to service.downloadTable(tableid) would
> return almost immediately and that the file would be streamed, resulting on
> execution of the loop in parallel as the server provides the file.
> But what I am observing is that my server streams the whole file (table)
> and just after all the data was sent (according to server logs) then  the
> call to downloadTable(tableid) returns and the loop starts executing.
> Is the client caching the attachment prior to return from
> service.downloadTable(tableid) ? I noticed the memory used by the JVM
> increases, but that does not prove anything)
> Is there a way to make the call such as the loop will start executing as
> the file is streamed ?
> -Jorge

View raw message