Shenjie,
This behaviour of service cacheing can be a little confusing, but is the way it is designed to work. It works as follows:
The key is that if the cacheing determines that cached results need to be returned, it returns the entire pipeline as it was at the time of cacheing, and not just the output variables defined for that service. So if you have a service with input inA and outputs outA and outB, but you also have $iteration in the pipeline, then for a later call to that service with the same inA as an earlier call, $iteration will be “overwritten” by the value that $iteration had when that earlier call was made. I guess this is what you are seeing.
As you correctly point out, the best way to avoid this is by using the cached service as a transformer, because that creates a separate pipeline for the invocation consisting only of the service’s mapped input values, so the pipeline being cached by the cached service is “clean”.
The other option is to use scoping, which has a similar effect, namely to isolate a part of the pipeline (one document) as the input pipeline to the cached service.
It is not possible to see exactly what is in the cache, but you can see how many results are cached in the Service Usage screen in IS Administrator. You can also trigger cache clearing there.
Hope this helps.
regards,
Jonathan Heywood
webMethods Professional Services
#Integration-Server-and-ESB#webMethods#webMethods-General