spyne
库可以创建wsdl
服务器,wsdl示例代码:
from spyne.application import Application
from spyne.decorator import rpc
from spyne import ServiceBase, String
from spyne.protocol.soap import Soap11
from spyne.server.wsgi import WsgiApplication
from wsgiref.simple_server import make_server
class Test(ServiceBase):
@rpc(String, _returns=String)
def get_data(self, post_data):
return process_xml_data(post_data)
app = Application([Test], 'http://schemas.xmlsoap.org/soap/envelope',
in_protocol=Soap11(validator='lxml'), out_protocol=Soap11())
wsgi_app = WsgiApplication(app)
if __name__ == '__main__':
server = make_server('0.0.0.0', 8080, wsgi_app)
server.serve_forever()
所以我想知道有没有办法在flask
中创建wsdl
服务flask-spyne
根本不支持python3
,它已经处于生命终结。
请参阅:https://github.com/arskom/spyne/tree/master/examples/flask.我验证了,它正在工作。