Closed GoogleCodeExporter closed 8 years ago
hmmm... The XML looks fairly similar to this:
http://www.salesforce.com/us/developer/resources/soap/sforce60/sforce_API_messag
es_update.html, and the code looks pretty similar to this:
http://code.google.com/p/salesforce-python-toolkit/source/browse/trunk/EXAMPLES#
228
Can you try a couple things?
1) try against suds 0.3.9
2) try retrieving the lead by ID, then setting the field, then calling update()?
Thanks for the bug report!
David
Original comment by dlanst...@gmail.com
on 21 Sep 2010 at 6:05
Hi David, thanks a lot for your quick answer.
Actually I forgot to mention but I did try with retrieve, raising the same
error.
Find below the code:
In [13]: obj = x.h.retrieve("Dias_netos__c", "Curso__c", "a0150000008Uug0AAC")
In [14]: obj
Out[14]:
(sObject){
fieldsToNull[] = <empty>
Id = "a0150000008Uug0AAC"
type = "Curso__c"
Dias_netos__c = 1.0
}
In [15]: obj.Dias_netos__c = 4.00
In [16]: obj
Out[16]:
(sObject){
fieldsToNull[] = <empty>
Id = "a0150000008Uug0AAC"
type = "Curso__c"
Dias_netos__c = 4.0
}
In [17]: x.h.update(obj)
15:25:26,598 ERROR [suds.client] [MainThread] <?xml version="1.0"
encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns0="urn:enterprise.soap.sforce.com"
xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="urn:enterprise.soap.sforce.com"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header>
<tns:SessionHeader>
<tns:sessionId>00D500000007iS2!ARkAQFCVlpHS0oTj2jOVj51e_ZEeGLIiDfmea.PLRX1cv0ye7z1TcmMuC33leIn6F6F6ms82fwLvKfpvKeWaWTKmIF0w9sFY</tns:sessionId>
</tns:SessionHeader>
</SOAP-ENV:Header>
<ns1:Body>
<ns0:update>
<sObjects xsi:type="ens:Curso__c">
<Id>a0150000008Uug0AAC</Id>
<Dias_netos__c>4.0</Dias_netos__c>
</sObjects>
</ns0:update>
</ns1:Body>
</SOAP-ENV:Envelope>
---------------------------------------------------------------------------
WebFault Traceback (most recent call last)
/home/mariano/Code/ReportingCom/sforce/repdotcom/<ipython console> in <module>()
/home/mariano/Sandbox/reporting/lib/python2.6/site-packages/sforce/enterprise.py
c in update(self, sObjects)
84 def update(self, sObjects):
85 xml = self._marshallSObjects(sObjects)
---> 86 return super(SforceEnterpriseClient, self).update(xml)
87
88 def upsert(self, externalIdFieldName, sObjects):
/home/mariano/Sandbox/reporting/lib/python2.6/site-packages/sforce/base.pyc in
update(self, sObjects)
503 def update(self, sObjects):
504 self._setHeaders('update')
--> 505 return
self._handleResultTyping(self._sforce.service.update(sObjects))
506
507 def upsert(self, externalIdFieldName, sObjects):
/home/mariano/Sandbox/reporting/lib/python2.6/site-packages/suds-0.4-py2.6.egg/s
uds/client.py in __call__(self, *args, **kwargs)
540 return (500, e)
541 else:
--> 542 return client.invoke(args, kwargs)
543
544 def faults(self):
/home/mariano/Sandbox/reporting/lib/python2.6/site-packages/suds-0.4-py2.6.egg/s
uds/client.py in invoke(self, args, kwargs)
600 timer)
601 timer.start()
--> 602 result = self.send(soapenv)
603 timer.stop()
604 metrics.log.debug(
/home/mariano/Sandbox/reporting/lib/python2.6/site-packages/suds-0.4-py2.6.egg/s
uds/client.py in send(self, soapenv)
647 else:
648 log.error(self.last_sent())
--> 649 result = self.failed(binding, e)
650 return result
651
/home/mariano/Sandbox/reporting/lib/python2.6/site-packages/suds-0.4-py2.6.egg/s
uds/client.py in failed(self, binding, error)
700 if status == 500:
701 if len(reply) > 0:
--> 702 r, p = binding.get_fault(reply)
703 self.last_received(r)
704 return (status, p)
/home/mariano/Sandbox/reporting/lib/python2.6/site-packages/suds-0.4-py2.6.egg/s
uds/bindings/binding.py in get_fault(self, reply)
263 p = unmarshaller.process(fault)
264 if self.options().faults:
--> 265 raise WebFault(p, faultroot)
266 return (faultroot, p.detail)
267
WebFault: Server raised fault: 'INVALID_TYPE: Must send a concrete entity type.'
I will try to downgrade to suds 0.3.9 and try both examples to see what
happens. I will let you know as soon as I'm done.
Mariano
Original comment by Mariano....@gmail.com
on 21 Sep 2010 at 6:28
Ok, I'm guessing it's an issue with the XML namespace prefixes - could you give
it a try with 0.3.9 and see if that works around the issue?
Original comment by dlanst...@gmail.com
on 21 Sep 2010 at 6:34
You hit the bull's-eye! Downgrading to suds 0.3.9 made the trick and I could
update the object. Thanks a lot for your input.
Original comment by Mariano....@gmail.com
on 21 Sep 2010 at 6:45
Cool, I'll dig into what changed in 0.4 wrt namespace prefixes and re-release.
Thanks again Mariano!
Original comment by dlanst...@gmail.com
on 21 Sep 2010 at 6:48
Issue 6 has been merged into this issue.
Original comment by dlanst...@gmail.com
on 12 Jan 2011 at 9:35
Added setup.py, which installs suds 0.3.9.
Original comment by dlanst...@gmail.com
on 9 Jun 2011 at 6:14
Original issue reported on code.google.com by
Mariano....@gmail.com
on 21 Sep 2010 at 3:56