rajdeepd / salesforce-python-toolkit

Automatically exported from code.google.com/p/salesforce-python-toolkit
GNU Lesser General Public License v3.0
0 stars 0 forks source link

_setEndpoint() throws exception - self._sforce.wsdl.service not instantiated #1

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
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

Original issue reported on code.google.com by roberthe...@yahoo.com on 3 Nov 2009 at 3:37

GoogleCodeExporter commented 8 years ago
hmmm.  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

Original comment by dlanst...@gmail.com on 5 Nov 2009 at 9:10

GoogleCodeExporter commented 8 years ago
Thanks 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.

Original comment by roberthe...@yahoo.com on 10 Nov 2009 at 2:44

GoogleCodeExporter commented 8 years ago
ack!  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

Original comment by dlanst...@gmail.com on 10 Nov 2009 at 6:19

GoogleCodeExporter commented 8 years ago
0.1.2 tarball is up.

Original comment by dlanst...@gmail.com on 10 Nov 2009 at 6:29

GoogleCodeExporter commented 8 years ago
I've tested toolkit 0.1.2, and it works OK with suds 0.3.7.
Thanks very much for making the update.

Original comment by roberthe...@yahoo.com on 16 Nov 2009 at 4:03

GoogleCodeExporter commented 8 years ago

Original comment by dlanst...@gmail.com on 16 Nov 2009 at 5:54