Thanks..
    This would be helpful.

Cheers,
Sai
    

-----Original Message-----
From: Mike Smorul [mailto:[EMAIL PROTECTED]
Sent: 08 April 2005 14:03
To: axis-user@ws.apache.org
Subject: RE: sending very large attachments



Section 3.6 in http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html does 
a better job that I could of explaining transfer codings.

One difference that we did to handle large encodings was to divorce the 
attachments from actual message, ala no DataHandlers as parameters. 
Instead we send an array of filenames that correspond to the attachments. 
Normally, this loose coupling of attachments and parameter wouldn't be a 
good idea, but we didn't want to lock ourselves into using attachments for 
a bulk data transport, and we can verify attachments through previously 
passed checksums.

On the client side you can set chunked encoding by setting the transport 
to http 1.1, and adding chunked encoding to the transfer headers

    Hashtable chunkedTable = new Hashtable();
    chunkedTable.put(HTTPConstants.HEADER_TRANSFER_ENCODING,
                         HTTPConstants.HEADER_TRANSFER_ENCODING_CHUNKED);

    call.setProperty(MessageContext.HTTP_TRANSPORT_VERSION,
                         HTTPConstants.HEADER_PROTOCOL_V11);
    call.setProperty(HTTPConstants.REQUEST_HEADERS,chunkedTable);

    call.addAttachmentPart(
                         new DataHandler(new FileDataSource(file)));

On the server side, by not including datahandlers as parameters, Axis 
ony reads attachments on demand. This lets us toggle the location where 
Axis writes the Axis*att files.

    MessageContext msgContext  = MessageContext.getCurrentContext();
    msgContext.setProperty(
        MessageContext.ATTACHMENTS_DIR,newPath);

    // causes Axis to read in rest of attachment stream
    Iterator<AttachmentPart> iap = reqMsg.getAttachments();

-Mike

On Fri, 8 Apr 2005, Sai Giddu wrote:

> Mike,
>    Could you please elaborate more on "chunked-encoding". I'm facing 
similar performance issues while trying to send large data using SOAP 
protocol.
>
> Thanks,
> Sai
>
> -----Original Message-----
> From: Mike Smorul [mailto:[EMAIL PROTECTED]
> Sent: 07 April 2005 22:52
> To: 'axis-user@ws.apache.org'
> Subject: RE: sending very large attachments
>
>
>
> Most implementations tend to choke on large http transfers because they
> tend to buffer the entire transmission prior to sending. Usually done
> under the assumption you are transfering single web pages and not large
> files.
>
> We've have fairly good results at sending large (>1G) attachments through
> axis. This was done using chunked-encoding and redirecting the
> axis attachment directory per attachment to avoid recopying data
> into a final location. Although when dealing with large attachments, you
> should consider implementing some type of checkpointing during the
> transfer in case of failure.
>
> -Mike
>
> On Thu, 7 Apr 2005, THOMAS, JAI [AG-Contractor/1000] wrote:
>
>> More than Axis, it would be a problem with HTTP assuming you are using http 
>> transfer.
>> HTTP has a limitation on size that varies slightly by implementation but 
>> from experience, anything over 10meg would be a problem.
>>
>> Jai
>>
>>
>>
>> -----Original Message-----
>> From: Alex Milanovic [mailto:[EMAIL PROTECTED]
>> Sent: Thursday, April 07, 2005 4:33 PM
>> To: axis-user@ws.apache.org
>> Subject: sending very large attachments
>>
>>
>> Hi All,
>> I was wondering if it would make sense to use the SOAP attachment method for
>> sending very large files from one host to another over the Internet? How
>> would AXIS deal with a file of 1GB in size?
>> Alex
>>
>>
>

Reply via email to