• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sending files via web service

 
Rodrigo Bossini
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic