If you invoke a service (no matter whether it’s done via ‘invoke’ or a transformer or a scoped call) and pass in a document, the document is passed by reference. Hence all changes made to the document are made to the original. Hence, strictly speaking, you do not need to map it back, because the changes have already been made. It also does not matter whether you drop the document at the end of the called service.
If a service makes changes to a document I prefere to declare the document as an output parameter – just to make it clear that the service does change the document. But, again, technically it’s not necessary.
if you do not want to make the changes to the original you should make a deep clone of it (a shallow one will not suffice).
#Integration-Server-and-ESB#webMethods#Flow-and-Java-services