【问题标题】:Spyne SOAP server WSDL file cannot show httpsSpyne SOAP 服务器 WSDL 文件无法显示 https
【发布时间】:2019-02-28 07:00:53
【问题描述】:

我的 Spyne 服务器 WSDL 显示 <soap:address location="http://some-domain.com>

我希望它显示 https 而不是 http

基本上,<soap:address location="https://some-domain.com>

注意区别在于httphttps

我如何告诉我的 Spyne 服务器来解决这个问题?

已经多次阅读文档但无法弄清楚。

谢谢!

【问题讨论】:

    标签: python soap https spyne


    【解决方案1】:

    我也遇到了在负载平衡器上终止 SSL 的问题。

    假设您使用的是 WsgiApplication,您可以通过 build_interface_document 方法指定您想要的 URL。示例肥皂应用程序中的类似内容。

    if __name__ == '__main__':
        # You can use any Wsgi server. Here, we chose
        # Python's built-in wsgi server but you're not
        # supposed to use it in production.
    
        from wsgiref.simple_server import make_server
        wsgi_app = WsgiApplication(application)
        wsgi_app.doc.wsdl11.build_interface_document('https://some-hardcoded-url.blah.io')
        server = make_server('0.0.0.0', 80, wsgi_app)
        server.serve_forever() 
    

    它记录在这里,虽然我在第一次阅读时错过了它:http://spyne.io/docs/2.10/reference/server.html#module-spyne.server.wsgi

    【讨论】:

      【解决方案2】:

      WSDL url 是从第一个请求构造的。

      启动服务器后,从安全域请求 wsdl,它应该可以工作。

      【讨论】:

      • 对不起,我不明白这一点。我需要在 Spyne 服务器上进行哪些更改?
      • 在从 https 请求 WSDL 时遇到同样的问题
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-10-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-04-04
      • 1970-01-01
      相关资源
      最近更新 更多