My scenario is, when I make soap call to one of the backend services, I get response as below - for each element: [COLOR=Blue]<item>[/color]
Presently I need to transform it into format:
This is because the backend is been here for a long time and can’t be changed One of the option I see is, to write a .xsl to make the transformation and use pub.xslt.Transformations:transformSerialXML service.
Now my question is - is this the best way, or is there a better way for doing this in webMethods
a simple flow service will do. check the IS dev guide for how to do mapping
But mapping from the response to how I need, would not solve my problem. Because I have to do this in multiple services, and the is a document list. Hence I’m looking for a functional solution for this, and not specific to this single instance alone.
btw, is there a way to retrieve value from the item document list, without looping and branching, but by using the key. (like as in the copy condition)
Thanks for your response.
What’s the objection to looping and branching?
LOOP over ‘/item’
…BRANCH on ‘/item/key’
…address: MAP (value to target/address)
…key2: MAP (value to target/key2)
…someKey: MAP (value to target/anotherField)
At some point, something needs to know the address and the data within the paired tag maps to . The “IS way” to do this is the loop and branch above. There are many other implementation possibilities but IMO this is the most straight-forward.
Use documentListToDocument service. It does exactly what you want.
I had looked at that service and for some reason thought it wouldn’t work in this case. But clearly that is the right service for this task.
Thanks for the response!!