flam70 (4) [Avatar] Offline

I have to write a batch (read/process/write) that call a web service (SOAP) as input and then process the result (list of items) to finally write them in a database. How can i call a web service as datasource in teh reader?

Pour les francophones, voici ce que je souhaite.
Je désire écrire un batch qui en entrée fait appel à un web service. Ce web service renvoie une liste d'items. La phase de lecture (reader) doit donc appeler un web service et lire chaque item du résultat. La phase de traitement (process) appliquera des règles métier sur chaque item et la phase d'écriture (writer) enregistrera les items dans une base de données. Mon problème est le suivant : comment utiliser un web service comme source de données de la phase de lecture?
Merci d'avance.

arnaud.cogoluegnes (73) [Avatar] Offline
Re: Spring batch and web services
Hi, Frank.

Thanks for your interest in the book! This forum is really focused on the book, so I think you'd better off asking this question on the Spring Batch community forum (http://forum.springsource.org/forumdisplay.php?41-Batch), you would reach more people.

Nevertheless, I can give you some hints. There's no out-of-the-box support for Web Services calls in Spring Batch. You'll need to implement your own ItemReader from scratch or subclass one Spring Batch provides (like AbstractItemCountingItemStreamItemReader, if you need restart). The framework doesn't provide such support because there are too many parameters when calling a Web Service (does it return all the data in one call, does it support paging, if yes, which API, which web service client is it using, etc)

Hope that helps