Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

SOAP and Iterator Pattern  RSS feed

 
Ave Cahyadi
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
apologies in advance that this might not be the most appropriate place to ask this question.

I'm required to develop a java web service application (SOAP). the company i'm working, will develop the server, and another company will develop the client. Our application has to satisfy a standard thus we are not a freedom of defining our interface.

In one of the documentation developed by the standard body, they are talking about using Iterator Pattern for a query that potentially return many values. That is they want to get smaller chunk of XMLs return message.

So the flow is something like:
1. client sends request for query
2. server returns the first x number
3. client sends a query for the next batch
4. server returns the next x number and soon

Most of the discussion I've seen is that the server return a big xml file, and the client access it using iterator, but the xml returned still contains the whole results of the query.

My question is that if it's possible at all to develop Iterator Pattern for the purpose mentioned above on SOAP ?

thanks in advance
 
Nitesh Kant
Bartender
Posts: 1638
IntelliJ IDE Java MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ave:
Most of the discussion I've seen is that the server return a big xml file, and the client access it using iterator, but the xml returned still contains the whole results of the query.

Then the implementation does not follow the requirements that you have stated.

Keeping the requirement aside, I think there are 2 cases:

1) Client wants to read chunks of the response. May be because the client does not want to render everything in one go, eg: Pagination.

2) Client does not want to query the entire data set from the server. Primarily because the data set is huge and it will have latency and memory problems.

In either case, one can provide an abstraction of an iterator in the client that maintains the state i.e. the batch size/number of records read, current page, etc.
This iterator internally can have different implementations following 1 or 2 i.e. either it can query the entire data in one go or query the server again and again for every query.

So, the answer to your question:

if it's possible at all to develop Iterator Pattern for the purpose mentioned above on SOAP ?


is YES

But it is not really specific to SOAP or WS. It is a generic concept that you can have even in any non-WS application also. Only the method of querying data changes but not the iterator concept.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!