soap (document-literal) Interface fails with complexType or lists arguments

Bug #1306028 reported by MichaelRazoum
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
ladon
New
Undecided
Unassigned

Bug Description

Hi,

I have used the soap11 Interface and it worked fine. Unfortunately it is not compatible with C# (Bug #1096004).

I have tried using the soap (document-literal) interface, but it fails with arrays or LadonTypes. Example:

class webservice(object):
  @ladonize([str], rtype=price)
    def getIndexKeys(self, input):
        return ["a", "b", "c"]

I get the error in SoaupUI:
Source: http://localhost:8999/webservice/soap/description Error: Could not find type 'ArrayOfstr@http://tempuri.org/'. Do you mean to refer to the element named ArrayOfstr@http://schemas.microsoft.com/2003/10/Serialization/Arrays (in description)?

Changing the input from list of strings to string works.

class webservice(object):
  @ladonize(str, rtype=price)
    def getIndexKeys(self, input):
        return ["a", "b", "c"]

Based on the error message I have replaced "http://tempuri.org/" with "http://schemas.microsoft.com/2003/10/Serialization/Arrays". (Attachment: modified file ladon\interfaces\soap.py)
It seems to work.

Could someone look over it and perhaps patch the bug? Thanks!

Best regards
Michael

Revision history for this message
MichaelRazoum (michael-razoumovitch) wrote :
Revision history for this message
André (andre-miras) wrote :

Well the suds client was also failing with the following trace:
Traceback (most recent call last):
  File "./client1.py", line 12, in <module>
    client = Client('http://localhost:8000/Calculator/soap/description')
  File "/tmp/trash/ladon_venv/lib/python2.7/site-packages/suds/client.py", line 119, in __init__
    sd = ServiceDefinition(self.wsdl, s)
  File "/tmp/trash/ladon_venv/lib/python2.7/site-packages/suds/servicedefinition.py", line 58, in __init__
    self.paramtypes()
  File "/tmp/trash/ladon_venv/lib/python2.7/site-packages/suds/servicedefinition.py", line 137, in paramtypes
    item = (pd[1], pd[1].resolve())
  File "/tmp/trash/ladon_venv/lib/python2.7/site-packages/suds/xsd/sxbasic.py", line 63, in resolve
    raise TypeNotFound(qref)
suds.TypeNotFound: Type not found: '(ArrayOfstr, http://tempuri.org/, )'

I've created a "ticket1306028-soap-fix-lists-args" branch with the fix you suggested (which also fixes on suds).
Like I said, I'm not a Ladon maintainer, but I hope jsgaarde will have time to merge.

Thanks,

Andre

Revision history for this message
MichaelRazoum (michael-razoumovitch) wrote :

Hi,

the patch works fine with list of complex types. I have recently found out that if the complex type is not a list, the WSDL functionResponse is wrong. Example :

class example(LadonType):
    strings = [str]
    floats = [float]

class webservice(object):

    @ladonize([str], rtype=example)
    def function(self, input):
        return input

WSDL : Arrayofstr not right

<element name="functionResponse">
  <complexType>
    <sequence>
       <element xmlns:q1="http://schemas.microsoft.com/2003/10/Serialization/Arrays" minOccurs="0" name="strings" nillable="true" type="tns:ArrayOfstr"/>
    </sequence>
  </complexType>
</element>

If we define the Class Example

class strfloat(LadonType):
    string = str
    float = float

class example(LadonType):
    list = [strfloat]

It works fine and the WDSL document is correct.

Could you look over it again? Thanks!

Best regards
Michael

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.