def get_application(): application = Application([CampaignCrudService, ModuleCrudService], tns='pvtranslator', in_protocol=Soap11(), out_protocol=Soap11()) return application
def setUp(self): self.app = Application([SomeService], 'tns', in_protocol=Soap11(), out_protocol=Soap11()) self.app.transport = 'test' self.server = WsgiApplication(self.app) self.wsdl = Wsdl11(self.app.interface) self.wsdl.build_interface_document('prot://url')
def setUp(self): class SomeService(ServiceBase): @rpc(Unicode) def some_call(ctx, some_str): print(some_str) app = Application([SomeService], "some_tns", in_protocol=Soap11(), out_protocol=Soap11()) self.wsgi_app = WsgiApplication(app)
def create_soap_wsgi(db): logger.debug('Creating SOAP interface') soap = Application( [UTPService], tns=globals.TARGET_NAMESPACE, name=globals.NAME, in_protocol=Soap11(validator='lxml'), out_protocol=Soap11(),) soap.db = db return WsgiApplication(soap)
class HelloWorldService(ServiceBase): # '''sskdjf谁看得见发牢骚降低非''' @srpc(String, UnsignedInteger, _returns=Iterable(String)) def say_hello(name, times): for i in xrange(times): yield 'Hello,%s' % name if __name__ == '__main__': from wsgiref.simple_server import make_server import logging logging.basicConfig(level=logging.DEBUG) logging.getLogger('spyne.protocol.xml').setLevel(logging.DEBUG) application = Application( [HelloWorldService], 'spyne.examples.hello.http', in_protocol=Soap11(validator='lxml'), out_protocol=Soap11() #in_protocol=HttpRpc(validator='soft'), #out_protocol=JsonDocument(ignore_wrappers=None) ) wsgi_application = WsgiApplication(application) server = make_server('127.0.0.1', 8000, wsgi_application) logging.info("listening to http://127.0.0.1:8000") logging.info("wsdl is at: http://localhost:8000/?wsdl") server.serve_forever() input('slkdjf')