run method @ladonize

Asked by romankrv

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/wsgi_application.py", line 271, in __call__
    output = dispatcher.dispatch_request(request_data,environ)
  File "/home/krv/VIRTUALENVS/lad/lib/python2.6/site-packages/ladon/server/dispatcher.py", 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/base.py", 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/soap.py", line 338, in parse_request
    m = re.match("^ns(\d+)$",soap_methodprefix)
  File "/home/krv/VIRTUALENVS/lad/lib/python2.6/re.py", 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 = 'http://127.0.0.1:8000/MyGateway/soap/description'
client1 = Client(url)
client1.service.test_login('1','1')

it work it return 'test'

what is happend in soapui ?

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
ladon Edit question
Assignee:
jsgaarde Edit question
Last query:
Last reply:
Revision history for this message
romankrv (romankrv) said :
#1
Revision history for this message
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 ...
</test_login>
...

It should send something like:

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

BTW:
The ServiceExample service at the ladonize.org 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

Revision history for this message
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. :)

Revision history for this message
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.
:-)

Revision history for this message
jsgaarde (jakob-simon-gaarde) said :
#5

Support for soapUI was commited later on