金字塔肥皂。

pyramid_soap的Python项目详细描述


金字塔肥皂

金字塔soap包适应 Soapbox 对于金字塔框架,构建soap web服务。

源代码位于https://bitbucket.org/artgins/pyramid_soap

示例

from pyramid_soap import SOAPService, SOAPVersion, xsd

class GetStockPrice(xsd.ComplexType):
    company = xsd.Element(xsd.String, minOccurs=1)
    hora = xsd.Element(xsd.String)


class StockPrice(xsd.ComplexType):
    price = xsd.Element(xsd.Integer)


Schema = xsd.Schema(
    #Should be unique URL, can be any string.
    targetNamespace="http://127.0.0.1:8000/utsx/pid.xsd",
    #Register all complex types to schema.
    complexTypes=[GetStockPrice, StockPrice],
    elements={
        "getStockPrice": xsd.Element(GetStockPrice),
        "stockPrice": xsd.Element(StockPrice)
    }
)


soap_hello = SOAPService(
    targetNamespace="http://127.0.0.1:8000/utsx/pid.wsdl",
    location="http://127.0.0.1:8000/utsx",
    path="/utsx",
    schema=Schema,
    version=SOAPVersion.SOAP11)


@soap_hello.api(soapAction="GetStockPrice", input="getStockPrice",
                output="stockPrice", operationName="GetStockPrice")
def get_stock_price(request, gsp):
    print gsp.company
    print gsp.hora
    return StockPrice(price=139)

许可证

金字塔肥皂是根据麻省理工学院的条款发行的 许可证MIT

版权所有(c)2012,杜松子酒马丁内斯桑切斯<;ginsmar@artgins.com>;

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
如何在Java中超时Future而不使用Future。get()是阻塞操作吗?   使用CXF 2.7.17部署到WebSphere 8.5.5.6的java问题   为什么是布尔。类是java。lang.课堂和字符串。类是java。串?   java是验收测试SOAP Web服务的最佳方法?   java如何替换kotlin中的::new?   字符串LastIndexOf和java。lang.IndexOutOfBoundsException   java移动游戏窗口在其他窗口前面LibGDX   java如何构建真正本地的ApacheSpark“胖”jar。JRE内存问题?   JavaGSON更新json文件   java如何替换字符串中的所有#{key}?   java应用程序没有在Android Pie中获取MySQL数据库   java是否可以在JavaDoc中重用@param描述?   java在MangedBean clsass中的任何@Autowired注入都不起作用,它总是等于NULL吗?   java当我为登录用户创建会话时,如何在struts2中维护hibernate会话?   按反向日期排列的java排序适配器ArrayList   Mockito中带doNothing()的java非类方法?