ZF-2589: __construct demands endpoint, no options to recycle object
Description
It would be nice if I could create a {{Zend_XmlRpc_Client}} without passing a URL to the {{__construct}}.
Reason - I like to re-use my objects and didn't want to set up another client for every request I am doing (and I have 5 or so to different endpoints). So ideally I'd like to create a {{Zend_XmlRpc_Client}} without an endpoint and I would like to set another endpoint when I need.
For example:
$client = new Zend_XmlRpc_Client();
...
$client->setEndpoint('http://foo/bar/');
...
$client->setEndpoint('http://bar/foo');
...
Comments
Posted by Matthew Weier O'Phinney (matthew) on 2008-03-06T10:15:59.000+0000
Scheduling for first mini-release following 1.5.0GA release.
Posted by Matthew Weier O'Phinney (matthew) on 2008-03-21T16:40:24.000+0000
Re-scheduling; bigger change than originally assumed, and could introduce BC issues.
Posted by Matthew Weier O'Phinney (matthew) on 2008-04-22T11:09:37.000+0000
Scheduling for next minor release.
Posted by Till Klampaeckel (till) on 2008-07-21T22:55:20.000+0000
Any headsup?
Posted by Lars Strojny (lars) on 2009-08-22T08:06:59.000+0000
Till, I would like not to provide this option. It's not expensive to create a new client object and it makes it much harder - or impossible - to verify invariance of the client object. I can only guess your usecase, but if you need to access different XML/RPC endpoints through one object I would suggest to create something like Till_XmlRpc_Composite which takes a map with namespaces as keys and XML/RPC client objects as values and dispatch the calls accordingly. Does that sound like a solution for you?