Skip to content

Login Uses Proxy but create() does not #3

Description

@GoogleCodeExporter
Confirmed that the WSDL contains only http:// urls and that HTTPS
requirement is disabled in my salesforce org.


Sample code:

#!/usr/bin/python

import sforce
from sforce.enterprise import SforceEnterpriseClient

h = SforceEnterpriseClient('enterprise.wsdl',
proxy={'http':'http://proxyhost:8080'})
lr = h.login('user','pass','token')

print lr

arraymetric = h.generateObject('CustomObjectc__c')
print arraymetric
result = h.create(arraymetric)
print result
h.logout()


Stangely enough, when using the proxy, the login() call suceeds (print of
lr is clean and shows the write userID, a reasonable sessionID, etc).    
However, I then try a create call it stalls, eventually giving me a
traceback inducating that it couldn't reach the service via https directly
(not via proxy):

  File "GetAndUploadFreeSpace.py", line 22, in ?
    result = h.create(arraymetric)
  File "/usr/lib/python2.4/site-packages/sforce/enterprise.py", line 33, in
create
    return super(SforceEnterpriseClient, self).create(xml)
  File "/usr/lib/python2.4/site-packages/sforce/base.py", line 361, in create
    return self._handleResultTyping(self._sforce.service.create(sObjects))
  File "/usr/lib/python2.4/site-packages/suds/client.py", line 539, in __call__
    return client.invoke(args, kwargs)
  File "/usr/lib/python2.4/site-packages/suds/client.py", line 598, in invoke
    result = self.send(msg)
  File "/usr/lib/python2.4/site-packages/suds/client.py", line 623, in send
    reply = transport.send(request)
  File "/usr/lib/python2.4/site-packages/suds/transport/https.py", line 64,
in send
    return  HttpTransport.send(self, request)
  File "/usr/lib/python2.4/site-packages/suds/transport/http.py", line 77,
in send
    fp = self.u2open(u2request)
  File "/usr/lib/python2.4/site-packages/suds/transport/http.py", line 116,
in u2open
    return url.open(u2request)
  File "/usr/lib/python2.4/urllib2.py", line 358, in open
    response = self._open(req, data)
  File "/usr/lib/python2.4/urllib2.py", line 376, in _open
    '_open', req)
  File "/usr/lib/python2.4/urllib2.py", line 337, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.4/urllib2.py", line 1029, in https_open
    return self.do_open(httplib.HTTPSConnection, req)
  File "/usr/lib/python2.4/urllib2.py", line 996, in do_open
    raise URLError(err)
urllib2.URLError: <urlopen error timed out>


I wouldn't expect it to be able to hit that directly, thats why i have a
proxy :).  Why is is automatically switching to HTTPS on me?

Original issue reported on code.google.com by mcow...@gmail.com on 19 Apr 2010 at 9:03

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions