首页 > 其他 > 详细

ladon 与 suds互通 (转)

时间:2015-11-15 06:27:30      阅读:223      评论:0      收藏:0      [点我收藏+]

Ladon

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

class Calculator(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)

Suds

from suds.client import Client

client = Client(‘http://localhost:8888/Calculator/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)


ladon 与 suds互通 (转)

原文:http://my.oschina.net/cppblog/blog/530442

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!