File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes sending files via web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "sending files via web service" Watch "sending files via web service" New topic
Author

sending files via web service

Rodrigo Bossini
Ranch Hand

Joined: Jul 03, 2009
Posts: 113
Is it true that sending files via web service is a "bad practice"? Is it considered not recommendable? If so, why and where can I find some more on this?


I see wind mills
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12781
    
    5
Sending bulk data with SOAP should be done using SAAJ - the SOAP with Attachments API for Java. It is certainly bad practice to send bulk data as part of a SOAP message body since that involves much extra encoding and parsing.

Sending bulk data to a RESTful service is entirely reasonable until you get to really huge files taking a long time to send, at which point something like BitTorrent, which makes it easy to interrupt and resume transmission would be advised.

Bill
Rodrigo Bossini
Ranch Hand

Joined: Jul 03, 2009
Posts: 113
William Brogden wrote:Sending bulk data with SOAP should be done using SAAJ - the SOAP with Attachments API for Java. It is certainly bad practice to send bulk data as part of a SOAP message body since that involves much extra encoding and parsing.

Sending bulk data to a RESTful service is entirely reasonable until you get to really huge files taking a long time to send, at which point something like BitTorrent, which makes it easy to interrupt and resume transmission would be advised.

Bill


Thank you.

Has web services been officially added to the EJB specification ? When I create a web service using EJB, is it the same exact thing as creating a web service by using any other technology?
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi mr Attack!
Rod Attack wrote:
Has web services been officially added to the EJB specification ? When I create a web service using EJB, is it the same exact thing as creating a web service by using any other technology?

Exposing an EJB as a web service is a standardized solution described, for instance, in section 3.2.4 of the EJB 3.0 Core specification document.
Creating a web service using a stateless session EJB is different from creating a web service using a POJO in the following ways:
- An EJB can use transaction services offered by the EJB container.
- An EJB can have method-level security control.
- Concurrent access to an EJB is managed by the container. Thus only a single thread is allowed to execute in an EJB at a single point in time.
- The web service servlet context cannot be accessed from an EJB web service endpoint.
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sending files via web service