金字塔肥皂。

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 Android Studio:我的短信应用程序不是默认短信应用程序的选项之一   java处理字符串问题   java为什么我的程序打印“null”而不是字符串?   java为什么要创建一个无限循环?   java循环在一段时间后将布尔值更改为false?   java Android Rest Api Post 400错误请求   java调用另一个方法以获取resultset并正确关闭连接?   java我想在2d数组中添加一行   Java:我需要从outputstream中获取字节数组   C语言中Java元注释的等价物#   java如何在从web下载图像时保持原始图像的dpi?   java中基于输入值的spring boot动态值   java从请求中获取主机名   java可以复制Swing代码并在intelliJ中的designer中查看它吗   spring如何使用java配置多个ldap   安卓如何在Java中使用具有多个类似参数的JSON请求/响应循环?   java LIbGDX如何在语言更改时翻译所有文本?