如何将Zeep合并到AppEngine中?

2024-06-12 18:56:50 发布

您现在位置:Python中文网/ 问答频道 /正文

当前正在使用GoogleAppEngine app w/Python中的zeep与SOAP API交互,并在初始化客户端时出现超时错误。你知道吗

错误: “deadlineexceederror('等待来自URL:wsdlUrl的HTTP响应时超过了截止日期”

我阅读了Zeep上的论坛,如果你想让它通过appengine工作,你必须添加一个传输,它也会超时。你知道吗

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

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

问题是它只是在请求过程中挂起,所以我实际上在appengine之外创建了一个单独的文件,看看它是否可以工作,它确实可以…不知道我需要做什么才能让URLFetch在appengine中与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',)

Tags: fromhttpsimportclienthttpurl错误transport