magja/magja — Issue #9: 9 - provide a better method to connect to multiple magento instances on API 
Author: ceefour
Created: 2011-11-02 11:32:06+00:00
State: closed

Currently, the connection to Magento is made by the class
"MagentoSoapClient. In our first tests, we found that if we make a login
and logout in the API for each call multiple times, in the third or fourth
call sequence is throwed Timeout Exception.

So we did the MagentoSoapClient as a singleton, which in its first call is
logged in the Magento API and held the returned sessionId, the sessionId is
used for API validate each call that is made from there, thus avoiding a
overhead and the Timeout Exception.

However, when the client needs to perform operations on two or more Magento
instances, he should use the method "setconfig(SoapConfig config)" on
"MagentoSoapClient", sending the new instance settings to connect, this
method performs the logout of the current instance and the login to the new
instance. But with this current solution, that will fall into the same
problem of overhead and timeout if the client wishes to do multiple
operations in each of the instances interchangeably.

That's because we need to find a better solution for the user easily
connect to multiple Magento instances and execute multiple operations on
each interchangeably.

Original link: http://code.google.com/p/magja/issues/detail?id=9