views:

29

answers:

1

I am trying to figure out how to create a stateless spring bean that wraps a group of calls to salesforce web service API. My understanding is that the process for calling salesforce is something like this:

  1. Call the login service to Log into salesforce
  2. Make a series of service calls
  3. Call the logout

To have a stateless wrapper it seems right pattern is to have each method in the bean perform all three steps above. e.g. (pseudocode)

binding.login();
binding.upsert(….);
binding.upsert(….);
binding.logout();

Is this a good practice? It seems it would be a costly way just to keep the bean stateless. Would it be preferable in this instance to make the bean request scope?

A: 

Have you tried SFDC WSC library? It's easy to use, and fits the use case that you are trying to accomplish.

Anup