如何将Zeep整合到AppEngine中?

时间:2019-05-21 00:00:36

标签: python google-app-engine zeep

当前在带有Python的GoogleAppEngine应用中使用zeep与SOAP API进行交互,并在初始化客户端时收到超时错误。

错误: “ DeadlineExceededError('在等待来自URL的HTTP响应时超出了期限:wsdlUrl”

我在Zeep的论坛上通读了您是否希望它通过App Engine运行,您还必须添加传输超时的传输。

from zeep import Client
from zeep.transports import Transport
wsdlUrl = https://somewasdlservice

Code that causes error:
  client = Client(wsdlUrl, transport=Transport(cache=None))

问题在于它只是在请求过程中挂起,所以我实际上在应用程序引擎之外创建了一个单独的文件,以查看它是否可以工作,并且确实起作用了……这使我需要做些什么才能使URLFetch与Zeep在应用程序中一起工作发动机。

顺便说一句:我无法指定指向wsdl服务的URL,但是它可以快速加载并可以立即在应用程序引擎之外运行,所以想知道我该怎么做才能配置它并在应用程序中使用它。

在请求AppEngine期间,状态:

AppEnginePlatformWarning: urllib3 is using URLFetch on Google App Engine sandbox instead of sockets. To use sockets directly instead of URLFetch see https://urllib3.readthedocs.io/en/latest/reference/urllib3.contrib.html.AppEnginePlatformWarning)

AppEnginePlatformWarning: URLFetch does not support granular timeout settings, reverting to total or default URLFetch timeout.AppEnginePlatformWarning)

然后大约3分钟的状态:

<requests.packages.urllib3.contrib.appengine.AppEngineManager object at 0x106f5dd10>, DeadlineExceededError('Deadline exceeded while waiting for HTTP response from URL: wsdlUrl',)

1 个答案:

答案 0 :(得分:0)

发现挂起的唯一原因是,即使我传递了https URL,它也要连接到端口80,一旦我指定了端口443,它就起作用了

相关问题