wood burning stoves 2.0*
The moose likes Web Services and the fly likes Which style of webservice to use for heavy file load? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Which style of webservice to use for heavy file load?" Watch "Which style of webservice to use for heavy file load?" New topic
Author

Which style of webservice to use for heavy file load?

manoj r patil
Ranch Hand

Joined: Jun 06, 2002
Posts: 181
Hi,

I am currently analyzing on porting one file upload program to web service.

The file size can be upto 1GB and we want this process asynchronous. So the call can be really stateless.

Questions I have are:
  • Would RESTful service be better choice?
  • For REST, is Jursey API the best?



  • love your job and not your company;
    ...because you never know when your company will stop loving you!
    Ulf Dittmer
    Marshal

    Joined: Mar 22, 2005
    Posts: 41148
        
      45
    What are you trying to achieve by doing this? In other words, how would a web service be better than straight HTTP file upload?


    Ping & DNS - my free Android networking tools app
    Shashank Ag
    Ranch Hand

    Joined: Dec 22, 2009
    Posts: 88

    You should be using ftp if possible.


    SCJP 91%, SCWCD 97%
    manoj r patil
    Ranch Hand

    Joined: Jun 06, 2002
    Posts: 181
    Ulf Dittmer wrote:What are you trying to achieve by doing this? In other words, how would a web service be better than straight HTTP file upload?


    Actually I want to process this file and publish the results to our site. But then the interface should be in such a way that client should be able to push his data from the desktop application. ...so was wondering if web service could be better idea or how.
    Ulf Dittmer
    Marshal

    Joined: Mar 22, 2005
    Posts: 41148
        
      45
    Well, certainly not a SOAP WS. But I don't see a particular advantage of a REST WS over straight HTTP upload, either.
    William Brogden
    Author and all-around good cowpoke
    Rancher

    Joined: Mar 22, 2000
    Posts: 12761
        
        5
    I would certainly look into "resumable ftp" - google search found some interesting products.

    Surely you want to avoid the frustration of trying to upload a GB file in the presence of interruptions.

    Bill
    Shashank Ag
    Ranch Hand

    Joined: Dec 22, 2009
    Posts: 88

    well yes that was the point
    manoj r patil
    Ranch Hand

    Joined: Jun 06, 2002
    Posts: 181
    William Brogden wrote:I would certainly look into "resumable ftp" - google search found some interesting products.

    Surely you want to avoid the frustration of trying to upload a GB file in the presence of interruptions.

    Bill


    This would be best choice when the client is desktop. But then in case of web client, we have lesser flexibility esp. when it is not RIA.
    Ulf Dittmer
    Marshal

    Joined: Mar 22, 2005
    Posts: 41148
        
      45
    What is a "web client"?
    manoj r patil
    Ranch Hand

    Joined: Jun 06, 2002
    Posts: 181
    Ulf Dittmer wrote:What is a "web client"?


    Web client what I meant here is basically any web based page through which user wants to upload the file.

    So it can be Safari running on iPad or IE running on windows ...
    William Brogden
    Author and all-around good cowpoke
    Rancher

    Joined: Mar 22, 2000
    Posts: 12761
        
        5
    Before we continue - how much control do you have over the client side?

    I think we agree that anything based on a single HTTP connection requiring error-less serial transmission of the whole file would be a disaster no matter what was handling the connection on the server end, right?

    SO - IF we are stuck with a browser interface we have Applets and Java Web Start options to do something better.

    The reality of the web is that there is a lot of bandwidth not used by a single HTTP connection. Thats why BitTorrent and JXTA exist.

    Bill



    manoj r patil
    Ranch Hand

    Joined: Jun 06, 2002
    Posts: 181
    I can ask the client to update the browser settings with proper reasoning (like add respective policy for some applet, etc.). But then can not really install anything on his machine.

    You are absolutely right that over http, chances of transferring large file error-less are not very high.

    I was knowing about applet option but not really java web start. Thanks Bill for pointing this out, now I can google on it.
    Ulli Hertlein
    Greenhorn

    Joined: Jan 13, 2011
    Posts: 15

    manoj r patil wrote:Hi, I am currently analyzing on porting one file upload program to web service. The file size can be upto 1GB ...


    if you really have to implement this with a webservice/http than i agree to the postings before that http is not really suitable for doing this (a GB sized transfer in one large chunk).
    but maybe you could split such large files on the client and use soap-mtom-large-attachment-streaming for upload an reassemble the file on the server.
    mtom-streaming is explained here:

    http://metro.java.net/guide/Large_Attachments.html


    Professional Senior Crap Manager & doing Livestrong
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Which style of webservice to use for heavy file load?
     
    Similar Threads
    communicate between 2 war files
    How to shutdown oc4j server
    NFL Predictions
    RMI file service
    Converting a java file to a web service