使用HTTPS和设置位置的SUDS

2024-09-30 12:24:50 发布

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

我使用SUDS调用SOAP,代码如下:

client = Client("https://xyz.rwth.de/SecuredDataService/SecuredData?wsdl",location="https://xyz.rwth.de/SecuredDataService/SecuredData",cache=None)

对于HTTP请求,类似于上述代码的请求可以工作(上面的请求中没有位置部分和正确的HTTP URL),但是对于HTTPS,它失败并给出以下错误。在

DEBUG:suds.wsdl:reading wsdl at: https://xyz.rwth.de/SecuredDataService/SecuredData?wsdl ...

DEBUG:suds.xsd.sxbasic:Import:0x1025f5710, importing ns="http://secured.services.xyz123.org/", location="http://xyz.rwth.de:7070/SecuredDataService/SecuredData?xsd=1"

DEBUG:suds.transport.http:opening (http://xyz.rwth.de:7070/SecuredDataService/SecuredData?xsd=1)

ERROR:django.request:Internal Server Error: /XYZ12/index.html/

我得到了urlopen error [Errno 60] Operation timed out

基本上,日志文件显示location参数没有被使用,而是使用了WSDL文件中指定的位置(即:http://xyz.rwth.de:7070/SecuredDataService/SecuredData?xsd=1)。为什么是这样,即使SUDS文档清楚地声明:location: This overrides the service port address URL defined in the WSDL.?在

编辑:在添加cache=None之后,将调用正确的位置,并在日志文件中打印整个WSDL。但是,在这之后,相同的错误(如上所述)会在日志文件中打印出来。在


Tags: 文件代码httpsdebughttpdelocationsuds

热门问题