• 1 reply
  • Latest Post - ‏2011-11-01T19:16:01Z by scott_klement
1 Post

Pinned topic Processing results from a web service in RPG/DB2

‏2011-10-25T09:59:03Z |
Hi all,
Hoping for some design guide. We have a webservice that returns data from another database outside of DB2. We want to analyse each record to make sure it can be put into the DB2 database and then add it, or report errors.
At the moment we are using a SAX parser for the XML and loading all the data nto interim tables and then processing the data from there (using RPG code).
This doesn't feel right to me. We are going to end up with one set of tables for interim purposes, and the proper data model, when they get validated. So a database twice a big and all the additional processing to add twice!!!
Is there a better way to do this? Any reason why we cannot read the XML directly, validate the XML and add straight to our data model?

Updated on 2011-11-01T19:16:01Z at 2011-11-01T19:16:01Z by scott_klement
  • scott_klement
    244 Posts

    Re: Processing results from a web service in RPG/DB2

    If I understand you correctly, you say you're parsing the XML and then writing it to a temporary file, then reading the temporary file, validating it, and writing it to the production file.

    To my mind, it'd make more sense to do the XML parsing and data validation all at once, then write the result to the production files. I don't understand why you're doing it in two phases with a temporary file in-between?

    You seem to be asking us (i.e., the people in this "cafe") the same question. Why not do it all in one step? But how could we know? We should be asking you!

    Sure, it's possible that the original developer was just confused? Or wanted to make the design more modular by separating the parsing from the data validation? Or maybe another (unknown to me) reason? To find out, you'd have to ask them, not me.