How to change targetNamespace in soap description?

Asked by Alexey Ustinnikov

I have a problem with targetNamespace, here is my ladon_test.py:

from ladon.ladonizer import ladonize
from ladon.types.ladontype import LadonType

class Test(object):

    class Table(LadonType):
        slno = int
        colTitle = str
        colSize = int
        colAlign = str

    @ladonize([Table], rtype=int) #notice the [], around table that means the input will be a list of Table LadonTypes.
    def setTables(self, tables):

        return len(tables)

I want to make soap request using suds:

from suds.client import Client

client = Client('http://localhost:8888/Test/soap/description')

table = client.factory.create('Table')

table.slno = 1
table.colTitle = 'col1'
table.colSize = 10
table.colAlign = 'L'

table2 = client.factory.create('Table')
table2.slno = 2
table2.colTitle = 'col2'
table2.colSize = 15
table2.colAlign = 'L'

tableList = [table, table2]

print (client.service.setTables(tableList))

But I have an error:
suds.TypeNotFound: Type not found: ' (ArrayOfTable, http://tempuri.org/, )'

targetNamespace is set to tempuri.org in the service description. Can I change it?

Question information

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

Please try with soapdocumentliteral protocol.
/ Jakob
Den 04/02/2016 09.28 skrev "Alexey Ustinnikov" <
<email address hidden>>:

> New question #284545 on ladon:
> https://answers.launchpad.net/ladon/+question/284545
>
> I have a problem with targetNamespace, here is my ladon_test.py:
>
> from ladon.ladonizer import ladonize
> from ladon.types.ladontype import LadonType
>
> class Test(object):
>
> class Table(LadonType):
> slno = int
> colTitle = str
> colSize = int
> colAlign = str
>
>
> @ladonize([Table], rtype=int) #notice the [], around table that means
> the input will be a list of Table LadonTypes.
> def setTables(self, tables):
>
> return len(tables)
>
> I want to make soap request using suds:
>
> from suds.client import Client
>
> client = Client('http://localhost:8888/Test/soap/description')
>
> table = client.factory.create('Table')
>
> table.slno = 1
> table.colTitle = 'col1'
> table.colSize = 10
> table.colAlign = 'L'
>
> table2 = client.factory.create('Table')
> table2.slno = 2
> table2.colTitle = 'col2'
> table2.colSize = 15
> table2.colAlign = 'L'
>
> tableList = [table, table2]
>
> print (client.service.setTables(tableList))
>
> But I have an error:
> suds.TypeNotFound: Type not found: ' (ArrayOfTable, http://tempuri.org/,
> )'
>
> targetNamespace is set to tempuri.org in the service description. Can I
> change it?
>
> --
> You received this question notification because you are an answer
> contact for ladon.
>