class AverageStockPrice(xsd.ComplexType): price = xsd.Element(xsd.Integer)
class GetStockPrice(xsd.ComplexType): company = xsd.Element(xsd.String, minOccurs=1) hour = xsd.Element(xsd.String)
class GetAverageStockPrice(xsd.ComplexType): company = xsd.Element(xsd.String, minOccurs=1) week = xsd.Element(xsd.String)
class StockPrice(xsd.ComplexType): price = xsd.Element(xsd.Integer) class AverageStockPrice(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, GetAverageStockPrice, AverageStockPrice, StockPrice], elements={ "getStockPrice": xsd.Element(GetStockPrice), "getAverageStockPrice": xsd.Element(GetAverageStockPrice), "stockPrice": xsd.Element(StockPrice), "averageStockPrice": xsd.Element(AverageStockPrice), } ) 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)