It's not a secret anymore!
The moose likes Web Services and the fly likes sending files via web service Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Web Services
Reply 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: 106
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: 12271
    
    1
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


Java Resources at www.wbrogden.com
Rodrigo Bossini
Ranch Hand

Joined: Jul 03, 2009
Posts: 106
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
Bartender

Joined: Oct 04, 2006
Posts: 2193
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: sending files via web service
 
Similar Threads
passing image files stored in hard drive
Guide me for a SOAP attachment Tutorial.
web service not available
Adding attachments to web service response
Discrepancy in listing of a file using Windows Explorer and JAVA I/O classes