Sonam,
I agree that you need to be very careful when dealing with cached services due to the pipeline management issues you noted. However, it can be a bit risky to use clearPipeline in a low-level/embedded/utility service if you’re not entirely aware of the calling service’s pipeline requirements. You could easily end up removing things from the pipeline upon which the calling service will later rely.
For this reason, my preferred approach for using cached services is to ensure the pipeline is properly scoped when I call the service. There appear to be two ways to do this (as discussed in a separate thread). Either use the Scope field on the Properties tab of the Flow step that calls the service, or call the service as a transformer.
I prefer to call cached services as transformers since the Scope field appears somewhat constrained. You have to manually specify a “document” that gets passed to the service in the Scope field, and I don’t think that provides enough control over the pipeline to be effective in many situations. On the other hand, Transformers automatically scope the pipeline to the declared Input of the cached service.
Overall, I’d like to see webMethods improve in this area. In my (albeit limited) experience, the 80/20 rule would be better served by caching ONLY the Output of a service. An option to control this behavior (cache entire pipeline), would then be a bonus.
#webMethods#Integration-Server-and-ESB#Flow-and-Java-services