run method @ladonize

Asked by romankrv on 2011-07-28

hi. when i run method test_login in soapUI (any version):

 @ladonize(str, str, rtype=str)
    def test_login(self, username, password):
        return "test"

i get error:

Traceback (most recent call last):
  File "/home/krv/VIRTUALENVS/lad/lib/python2.6/site-packages/ladon/server/", line 271, in __call__
    output = dispatcher.dispatch_request(request_data,environ)
  File "/home/krv/VIRTUALENVS/lad/lib/python2.6/site-packages/ladon/server/", line 113, in dispatch_request
    req_dict = self.iface.parse_request(request_data,encoding=self.response_encoding)
  File "/home/krv/VIRTUALENVS/lad/lib/python2.6/site-packages/ladon/interfaces/", line 54, in parse_request
    return self._request_handler.parse_request(soap_body,self._sinfo,encoding)
  File "/home/krv/VIRTUALENVS/lad/lib/python2.6/site-packages/ladon/interfaces/", line 338, in parse_request
    m = re.match("^ns(\d+)$",soap_methodprefix)
  File "/home/krv/VIRTUALENVS/lad/lib/python2.6/", line 138, in match
    return _compile(pattern, flags).match(string)
TypeError: expected string or buffer

but in console client in python-console:
from suds.client import Client
url = ''
client1 = Client(url)

it work it return 'test'

what is happend in soapui ?


Question information

English Edit question
ladon Edit question
jsgaarde Edit question
Last query:
Last reply:
jsgaarde (jakob-simon-gaarde) said : #2

Maybe that has something to do with SUDS honoring the SOAP 1.1 standard and soapUI isn't. From the error you sent it looks like soapUI is not sending the namespace prefix when posting a request. Can you use some kind of sniffer program like Wireshark to examine and send the raw request?

I almost certainly can garantee that it will look something like:

<SOAP-ENV:Body><test_login ...

It should send something like:

<SOAP-ENV:Body><ns1:test_login ...

The ServiceExample service at the site is not official and therefore not refered to under examples. It has no implementation, but the WSDL it preoduces is correct. Calling it will fail. The only reason that service is there is for testing because we are redesigning the browsable API catalog.

Best Regards Jakob Simon-Gaarde

romankrv (romankrv) said : #3

Support soapUI is bad because they not want to fix theirs bugs because I am not use pro version.

shit proprietary software. :)

jsgaarde (jakob-simon-gaarde) said : #4

I just took a quick look at soapUI - and saw it is a test library. I suggest you use suds and Pythons unittest framework in combination.

jsgaarde (jakob-simon-gaarde) said : #5

Support for soapUI was commited later on