Forum Discussion

acesario's avatar
acesario
Contributor II
6 years ago
Solved

How to split an xml for multiple Web service submits?

I am pulling data from a db connection with multiple rows, and forming that into an xml. I am able to submit this against a web service, but what I need to do is to break down the xml by record for submission to the web service, one at a time.

For example:
“Record”:[{…1.}]…
“Record”:[{…2.}]…
“Record”:[{…3.}]…

Current xml looks something like this:
"File
Record
…1…
Record
record
…2…
Record
Record
…3…
Record
File

Desired XML
File
Record
…1…
/Record
/File
Put the above…then…
File
Record
…2…
/Record
/File
Put #2 the above…then…
…etc

Is there a way to break up the xml, and loop through the submits in SnapLogic?

  • Yes, you can use an XML Formatter at that point to get the document back into XML.

3 Replies

  • I think you are just looking for the XML Parser snap. That should be able to split your xml document into smaller sub documents.

  • acesario's avatar
    acesario
    Contributor II

    Thank you for the response. The parser takes my xml out of xml format, and back into JSON…correct?
    In which case I do not have xml to use for the SOAP Execute and would need to remap etc to submit … correct?

    • cjhoward18's avatar
      cjhoward18
      Employee

      Yes, you can use an XML Formatter at that point to get the document back into XML.