When you create a service that will be externally invokable (ie. one that you will expose to clients) make it stateless unless you store data in the session for later use (by a subsequent request from the same client). You don’t need the overhead of all these sessions lying around for just one request. The wm.tn:receive service (TradingNetworks) is stateless for example.
For caching, the documentation states that “When the server receives subsequent requests for a service with the same set of input values, it returns the cached result to the client rather than invoking the service again.” The only way a cached pipeline would be used is if you provide the same input values. So don’t use caching if the service will provide different output for the same input (flows that get the date/time for example). Here’s another quote from the developer’s guide "If a service retrieves data from a data source that is updated frequently, the cached results can become outdated. Do not cache services that retrieve information from sources that are updated in real-time or near real-time, such as stock quote systems or transactional databases. "
So my philosophy is generally NOT to use caching since most services retrieve dynamic data from a database that gets updated from other sources (even with the same input values).
Will
#Flow-and-Java-services#webMethods#Integration-Server-and-ESB