Complex types and arrays in response

Asked by azurit

I'm unable to get complex types working with SUDS SOAP client. I'm even unable to return an array (python list), always getting this error:
suds.TypeNotFound: Type not found: 'item'

XML:
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:test" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><ns:testResponse><result><item>aa</item><item>ff</item></result></ns:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

Is it really supposed to work ? I failed to find any client which is working with Ladon :(

Question information

Language:
English Edit question
Status:
Solved
For:
ladon Edit question
Assignee:
No assignee Edit question
Solved by:
azurit
Solved:
Last query:
Last reply:
Revision history for this message
jsgaarde (jakob-simon-gaarde) said :
#1

Hi Azurit.

Yes it works with suds. I would like to help, but you need to post an example. Use http://pastebin.com to post it.

Best Regards Jakob Simon-Gaarde

Revision history for this message
azurit (azurit) said :
#2

I solved problem with arrays by patching Ladon (see https://bugs.launchpad.net/ladon/+bug/858833 ) but complex types are still not working - but i think it's the SUDS false, i have the same problem with rpclib + SUDS.

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

Hi Azurit.

I just checked to be sure I hadn't broken anything when I released version 0.6.3 - everything seems to work as it should. I'd like to draw your attention to the official examples at Ladon's homepage:

http://ladonize.org/files/ladon-0.6.3-examples.tar.gz

1. Unpack it on your local system.

2. run the examples server: $ python runserver.py

Now you can test it with suds:
----------------------
>>> from suds.client import Client
>>> cli = Client("http://localhost:8080/AlbumService/soap/description")
>>> cli.service.listAlbums('Best')

This method method returns an Array of complex type. Even nested arrays. Please see if you can get this working.

Revision history for this message
azurit (azurit) said :
#4
Revision history for this message
azurit (azurit) said :
#5

The same problem was with arrays but i fixed it (as i stated before).

Revision history for this message
azurit (azurit) said :
#6

Maybe i have some modules for processing XML installed and suds is preffering them before python build-in modules ? And everything is not working ok with Ladon's XML generation.

Revision history for this message
azurit (azurit) said :
#7

or maybe my system is using broken versions of some XML libraries ? Jakob, do you have any ideas what colud be wrong ? Thank you.

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

Hi Azurit.

I just installed suds from trunk ( svn co http://svn.fedorahosted.org/svn/suds/trunk ) and tested with AlbumService - it worked exactly the same way as 0.4.1-2 installed from Ubuntu's repositories. I would focus on this message:

  No handlers could be found for logger "suds.umx.typed"

Seems like some type checker is not working correctly.

Best Regards
Jakob Simon-Gaarde

Revision history for this message
azurit (azurit) said :
#9

I think that message is only for python logging module. Btw, are you testing it on Windows or Linux ? Error message is talking about type 'band' (lowercase 'b') but type is called 'Band' (uppercase 'B'). Where SUDS got that 'band' type ? Maybe you cannot see this problem cos your system is case-insensitive ?

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

Windows is only something I use as a last resort - I'm running Ubuntu ;-)
Besides filesystem insensitivity should have nothing to do with this matter. The Type Band is based on a Python class:

class Band(LadonType):
  ...

and therefore the type name doesn't reflect on the filesystem at all.

/ Jakob

Revision history for this message
azurit (azurit) said :
#11

Windows is NOT case-insensitive only on filesystem (yes, it's totally broken). Anyway, i don't have more ideas for now. rpclib, which was generating the same error combined with SUDS, was fixed after i installed newer version of it (2.4.0-beta).

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

ok, that's interesting. Can you maybe help me and identify what the difference is between the WSDL/SOAP generated by Ladon and rpclib respectively so I can fix the problem?

/Jakob

Revision history for this message
azurit (azurit) said :
#13

Ok, i prepared it all :) so:
Ladon test app: http://pastebin.com/RYW6dVMf
rpclib test app: http://pastebin.com/L07gpiA8
client app: http://pastebin.com/T04awwFS (just change URL parameter at the top)

WSDL Ladon: http://pastebin.com/71qUDCCx
WSDL rpclib: http://pastebin.com/W7jg0sYe

Ladon XML response: http://pastebin.com/uBRrTgM0
rpclib XML response: http://pastebin.com/t3aA3qfx

Ladon result: http://pastebin.com/k2Bey1sH
rpclib result: http://pastebin.com/zZq4yQ42

hope i didn't mess up the links :))

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

Thanks Azurit.

I am looking in to it now :-)

Best regards
Jakob Simon-Gaarde

Revision history for this message
azurit (azurit) said :
#15

cool, i just opened a beer :D

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

Hi Azurit

Good news - I found the problem, it is in the WSDL generation. Thanks a bunch for all your effort.
Could you do one last thing? convert this question to a bug.
I will deliver a patch tonight when I have made proper changes - and attach it to the bug.

Best Regards
Jakob Simon-Gaarde

Revision history for this message
azurit (azurit) said :
#17

done