
salesforce-python-toolkit - issue #1
_setEndpoint() throws exception - self._sforce.wsdl.service not instantiated
When instantiating / logging on through a partner wsdl, the call to _setEndpoint() fails because the "service" attribute is not instantiated in the suds Definitions object. There is a "services", but no "service" in Definitions. I am running suds 0.3.7. This is the earliest version available for download from the suds site. Is the toolkit written for an earlier version of suds or is this just a bug?
def _setEndpoint(self, location): ''' Set the endpoint after when Salesforce returns the URL after successful login() ''' self._sforce.wsdl.service.setlocation(location) self._location = location
Comment #1
Posted on Nov 5, 2009 by Quick Cathmmm. I just tested with the partner wsdl against 0.3.7 and it appears to work correctly. If you insert the following line in that method:
print dir(self._sforce.wsdl);sys.exit()
do you not see 'service' as one of the attributes? My first instinct was that this was a result of the multiple service support added in suds in 0.3.7, would you mind giving the 0.3.6 tarball a try against your wsdl and let me know if that resolves the issue? The link is:
https://fedorahosted.org/releases/s/u/suds/python-suds-0.3.6.tar.gz
Comment #2
Posted on Nov 10, 2009 by Quick LionThanks for your response and link to suds 0.3.6. Running with suds 0.3.7 still does not work: there is no "service" member instantiated. The sud Client class init in client.py instantiates self.wsdl = Definitions(url, options) However, the suds implementatin of the Definitions class changed between 0.3.6 and 0.3.7. Namely, the Definitions init method in wsdl.py in suds 0.3.6 instantiates self.service = None while Definitions.init in wsdl.py 0.3.7 instantiates self.services = [] There is no member "Definitions.service" in 0.3.7.
Since suds 0.3.7 has no member "service", references in the salesforce toolkit in base.py self._sforce.wsdl.service.setlocation(location) will throw an exception.
However, the toolkit works OK using suds 0.3.6.
Comment #3
Posted on Nov 10, 2009 by Quick Catack! Sorry, was having a pathing issue.
So, the fix should be in trunk, if you check out the latest SVN. I'll tarball it soon. The issue is that suds' new multiple service functionality breaks the setlocation method, which SFDC uses to give the client a new URL after auth. See https://fedorahosted.org/suds/ticket/261 for more info.
Could you just confirm that this fixes the issue for you? Thanks for taking the time to report the bug.
David
Comment #4
Posted on Nov 10, 2009 by Quick Cat0.1.2 tarball is up.
Comment #5
Posted on Nov 16, 2009 by Quick LionI've tested toolkit 0.1.2, and it works OK with suds 0.3.7. Thanks very much for making the update.
Comment #6
Posted on Nov 16, 2009 by Quick Cat(No comment was entered for this change.)
Status: Fixed
Labels:
Type-Defect
Priority-Medium