SOAPpy.Types.faultType: Cannot use object of type stdClass as array

Tamer Higazi th982a at
Sat Mar 23 20:38:41 CET 2013

I did what you said before in several ways.

The last way was putting the user and password directly into the dict as
parameter ALWAYS ends up telling me, that I cannot use object of
standard type class as ARRAY....

I did it this time with suds. So packaging issue is now out of scope,
and always the same headache.

now tell me what this error might tell me:

suds.WebFault: Server raised fault: 'Cannot use object of type stdClass
as array'
File "/storage/PyProjects/toolsAPP/python/", line 23, in
  KasObj = KASSystem()
File "/storage/PyProjects/toolsAPP/python/", line 20, in
line 542, in __call__
line 602, in invoke
line 649, in send
line 702, in failed
line 265, in get_fault

and when I open the python files they hand me out only the error
messages, which was sent back from Server!

here is the code:

import hashlib
from suds.client import Client
from suds import WebFault

class KASSystem:
    def __init__(self):
        WSDL_AUTH = ''
        WSDL_API = ''

        m = hashlib.sha1()

        SoapClient = Client(WSDL_AUTH)


KasObj = KASSystem()


Am 23.03.2013 16:03, schrieb Chris Angelico:
> On Sun, Mar 24, 2013 at 12:33 AM, Tamer Higazi <th982a at> wrote:
>> Hi Chris!
>> thanks.... But I am about of going nuts.... I did everything according
>> their sample:
> Since I'm not fluent in German, I'm relying on Google Translate to
> read of that page. (I didn't find an obvious English version of the
> page, but maybe I just didn't look in the right place.)
> One thing I've found about the PHP SOAP library is that it seems to
> behave quite oddly in some circumstances - my suspicion is the WSDL
> file (eg when it's unable to load it). Try monitoring the actual
> traffic - SOAP is XML carried over HTTP, so you should be able to just
> snoop the TCP/IP socket (easiest way might be to switch in your own
> server). See if you can spot a difference between the request that PHP
> sends and the one your Python script sends. Fortunately you're not
> moving megabytes of data around, here - it should be easy enough to
> eyeball the requests and see what's different about them :)
> A tip, by the way:
>         userpass = ['login','password']
>         m = hashlib.sha1()
>         m.update(userpass[1])
>         userpass[1] = m.hexdigest()
>         loginData = {'user':userpass[0],'pass':userpass[1]}
>                 'KasUser':loginData['user'],
>                 'KasPassword':loginData['pass'],
> You keep packaging and repackaging the credentials. I'm assuming you
> won't actually have them hard-coded like that (if you do, I would
> recommend hard-coding the SHA1 hash, rather than the password itself),
> so I'll stick with the userpass list (or tuple, which would work
> exactly the same way).
> password = hashlib.sha1(userpass[1]).hexdigest()
> ...
>                 'KasUser':userpass[0],
>                 'KasPassword':password,
> Or even inline that completely (which is what I'd probably do).
> There's no need to stuff it into a dictionary, only to pull it out
> again.
> Also: A try/except that just prints out the error message usually
> isn't helpful. Save yourself the trouble, at least during initial
> testing - just let the exception terminate your script. You'll get all
> the same information, plus the full traceback, and it's cost you
> exactly zero development time :) Later on, you can add try/except if
> you need to do something other than terminate, but often that "later
> on" never even happens.
> ChrisA

More information about the Python-list mailing list