File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Performance and the fly likes Is 5MB of data in SOAP response accetable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Performance
Bookmark "Is 5MB of data in SOAP response accetable" Watch "Is 5MB of data in SOAP response accetable" New topic

Is 5MB of data in SOAP response accetable

Joshua Antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 254

I am doing a Technical Design for a project, which interacts with webservice to fetch particular set of data. The problem here is that the maximum expected SOAP response size is 5MB. In order to simulate this behaviour, I created a Mock Service to return approx 5MB of data & tested the performance through SOAP-UI. However, to my surprise the SOAP-UI says that the response was 11MB! Just to make sure, I copied the response & saved as XML - validated the size , it was same 5MB. So, I started testing on different clients & I get inconsistent behaviour regarding the data returned and the performance by SOAP-UI. For the same 5MB of actual data, different SOAP-UI instances in different boxes have different response times (from 500ms - 5 sec) & different data size (5MB - 11MB). Thus, I assume that this is something to do with the network & hence the question -
What is the network overhead of sending 5MB of data as part of SOAP response? Will the response time be less than 1sec (assuming standard production app network configuration)?

Any inputs on this will be highly appreciated since its always better to find these gotchas before starting development :-)


Jayesh A Lalwani
Saloon Keeper

Joined: Jan 17, 2008
Posts: 2746

If the network is 10giga bit /sec, that roughly comes to 1gigabyte per second with overhead. So, 5mb should take about 1/200 of a second. IMO, network latency and server response time will be a bigger factor
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13037
No, 5mb inside a SOAP message is not acceptable, the reason being that a SOAP message gets parsed to an XML document - a DOM with an object for every element.

This is mind bogglingly slow plus uses lots of memory.

Large chunks of data should be handled as attachments - handy article in wikipedia on the api.

Carles Gasques
Ranch Hand

Joined: Apr 19, 2013
Posts: 199
could you use MTOM to optimize traversing part of this SOAP messages?
I agree. Here's the link:
subject: Is 5MB of data in SOAP response accetable
It's not a secret anymore!