Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which style of webservice to use for heavy file load?

 
manoj r patil
Ranch Hand
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?


  •  
    Ulf Dittmer
    Rancher
    Posts: 42967
    73
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    What are you trying to achieve by doing this? In other words, how would a web service be better than straight HTTP file upload?
     
    Shashank Ag
    Ranch Hand
    Posts: 88
    Java Spring Tomcat Server
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    You should be using ftp if possible.
     
    manoj r patil
    Ranch Hand
    Posts: 181
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Rancher
    Posts: 42967
    73
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 13061
    6
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 88
    Java Spring Tomcat Server
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    well yes that was the point
     
    manoj r patil
    Ranch Hand
    Posts: 181
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Rancher
    Posts: 42967
    73
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    What is a "web client"?
     
    manoj r patil
    Ranch Hand
    Posts: 181
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 13061
    6
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 181
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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
    Posts: 15
    Oracle VI Editor Windows
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    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

     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic