Last active
December 29, 2015 11:39
-
-
Save plq/7665245 to your computer and use it in GitHub Desktop.
simple type as __in_header__ does not work
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| from spyne.model.primitive import Boolean, Unicode, Integer | |
| from spyne.model.complex import ComplexModel | |
| from spyne.service import ServiceBase | |
| from spyne.decorator import rpc | |
| class SomeService(ServiceBase): | |
| __in_header__ = Unicode(sub_name='myinfo') | |
| @rpc(Unicode) | |
| def MyMethod(ctx, mymethodparam): | |
| print "I got:", mymethodparam | |
| print "myinfo:", ctx.in_header | |
| if __name__ == '__main__': | |
| from spyne.application import Application | |
| from spyne.protocol.soap import Soap11 | |
| from spyne.server.wsgi import WsgiApplication | |
| from wsgiref.simple_server import make_server | |
| logging.basicConfig(level=logging.DEBUG) | |
| logging.info('listening to http://127.0.0.1:8000') | |
| application = Application([SomeService], | |
| 'myapp', | |
| in_protocol=Soap11(validator='lxml'), | |
| out_protocol=Soap11()) | |
| wsgi_application = WsgiApplication(application) | |
| server = make_server('127.0.0.1', 8000, wsgi_application) | |
| server.serve_forever() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment