java - a spring bean to wrap salesforce web service calls -


I am trying to find out how to create a static spring bean that wrapped a group of calls for the sale of Webforces API is. My understanding is that the process of selling a cell phone is something like this:

  1. Call the login service to enter the sales force
  2. Make a series of service calls < / Li>
  3. Call logout

To keep a stateless cover, this correct pattern seems to be that in each bean, each method is to be done in all the three steps mentioned above (pseudocode) / P>

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

Is this a good practice? It seems that it would be an expensive way to keep the position of bean in the unfavorable position. Would Bean be better in this example to create a request scope ?

I agree with anonymity, you should take a look at SFDC YSC

If you want to be completely stateless, then you will need to know the following things about a sales force connection.

  1. Each action should have an endpoint URL, such as some na6.salesforce com or na7.salesforce.com
  2. each action has a valid SID Session ID).

When you have the original endpoint Login.salesforce.com and if you are sucessfull you will be returned to a valid endpoint (na6.salesforce.com) and an SID.

You can leave that endpoint / SID in singleton and share it as you want, with many spring beans in each bean you will have to make a new SUBPUBLIC STUB and one You need to set Endpoint and SID before executing / updating / updating / etc. Action.

This will end after the inactivation of SID (at any time 30-120 minutes depending on the setting), so that you must capture any exceptions and religns using the singleton object.

Concern about two beans on singleton relinine at the same time, because the sales force will give Sims Sid back to both.


Comments