At 10:23 7/06/2002 -0400, you wrote:
>Why does the invoker need the cache?  What does it do with it?

The invoker is actually an interface to the webservice. If you want data 
from the webservice, you ask the invoker to get this data and the invoker 
creates the correct SOAP message and sends it to the webservice, retrieves 
a SOAP response and converts it into specific objects.

I give a simplified example:

suppose you have webservices that provide a way to retrieve information 
about persons (fictive example to illustrate things). The invoker could 
look like this:

public class PersonWebServiceInvoker {

     public PersonWebServiceInvoker(URL url) {
         cache = JCS.getInstance("webservice");
     }

     public Person getPerson(String id) {
         // create SOAP message, and transform the response to a Person object
         Person p = result-of-soap-message
         cache.put(id, p);
         return p;
     }

     public boolean isPerson(String id) {
          return getPerson(id) != null;
     }

     ...
}

>Why can't the webservice use the cache?

I want to avoid the creation of the SOAPMessage, the network traffic, ...
Multiple calls of getPerson(id) with the same id shouldn't generate this 
traffic.

To illustrates the problem I'm dealing with: suppose I have to different 
webservices (with different persons in it)
1. retrieve a person with id1 from webservice1
2. the invoker is putting this person in its cache (region=webservice)
3. execute the isPerson(id1) method in webservice2
4. normally, this should return false because that person doesn't exist in 
webservice2, but in fact, it will return true because the invoker for 
webservice2 will use the same cache is for webservice1 because the region 
is the same (region=webservice). The same is true for getPerson(id): if I 
execute getPerson(id1) on webservice2 after I executed getPerson(id1) on 
webservice1, this method will return the same person I retrieved from 
webservice1 since it is located in the cache.

>You don't know the set of webservices?

no. If a user finds a webservice that can understand the SOAP messages like 
we have specified, it should be possible that he adds this service (create 
an invoker with the url of the service).

how can I solve these problems?

thanks,
Maarten



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to