Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

limitting the size of SOAP response

 
Geetha Ratnam
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have a requirement that the size of the response SOAP xml need to be restricted as the client consuming our web service can accept a response of maximum size of 100KB.

If the complete response for a particular request exceeds the size limit, we need to restrict the data we send as the response.

Is there any possibility that we can intercept the response problematically and amend the response. OR please let me know if there are any other better way to achieve this.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't abruptly terminate a SOAP message without turning it into invalid XML which would be rejected by the client.

In order to keep the response valid you will have to limit the volume of data at an earlier stage, before the SOAP response creation.

Bill
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Here is a suggestion that I hope will be of use to you:
- Implement one operation in your web service that returns a lightweight list of items, for instance a list containing only enough information to uniquely identify each item in the list.
- Implement another operation in your web service that returns a "heavyweight" list of items, that is, where each item contains all its data.
- Implement a handler on the server side that, if the size of a SOAP response exceeds 100kB, generates some certain kind of fault that tells the client that the request in question generated a response that exceeded the maximum possible size the client can handle.

This way, the client can first request a ligthweight list of items, with a larger chance of not exceeding the maximum response size.
Later, the client can request smaller chunks from the list, in order to retrieve the details of the items.
When encountering the special fault that indicates that the maximum response size was exceeded, the client can split the request into two request, only requesting half the number of items in the first request and the other half in the next request etc.
Best wishes!
 
Geetha Ratnam
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for the reply. It was very usefull.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!