HTTP500是python中SOAP请求的结果

2024-05-20 12:11:31 发布

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

这个问题对于一个服务来说可能相当具体,但是我不明白为什么我从SOAP服务得到HTTP500响应。我看到了我想访问的服务,我知道需要哪些参数。我还是得到了HTTP500。服务或我的代码有问题吗?在

#!/usr/bin/env python
# Import WSDL package
from SOAPpy import WSDL

# Create service interface
wsdlUrl = 'http://bioinf.cs.ucl.ac.uk/psipred_api/wsdl'

# Download the WSDL file
server = WSDL.Proxy(wsdlUrl)

# Get the information about which services are provided by this host
print server.methods.keys()

# After selecting the service of interest let's find out which arguments are necessary
callInfo = server.methods['PsipredSubmit']
for para in callInfo.inparams:
   print para.name, para.type

# Now let's discover what we will get back
for para in callInfo.outparams:
   print para.name, para.type

sequence = "MLELLPTAVEGVSQAQITGRPEWIWLALGTALMGLGTLYFLVKGMGVSDPDAKKFYAITTLVPAIAFTMYLSMLLGYGLTMVPFGGEQNPIYWARYADWLFTTPLLLLDLALLVDADQGTILALVGADGIMIGTGLVGALTKVYSYRFVWWAISTAAMLYILYVLFFGFTSKAESMRPEVASTFKVLRNVTVVLWSAYPVVWLIGSEGAGIVPLNIETLLFMVLDVSAKVGFGLILLRSRAIFGEAEAPEPSAGDGAAATSD"
email = "psipred@cs.ucl.ac.uk"
subject = "test"

result = server.PsipredSubmit(sequence, email, subject, "True", "False", "False", "all")

print result

Tags: thewhichserverservicecsacwsdlucl
2条回答

通常500个结果意味着服务器在处理您的请求时遇到了意外错误。在

这可能是一个临时情况,将在一两天内得到解决:可能是服务器的RAM芯片坏了,或者磁盘已满。在

或者完全是故意的:也许你提交的某个值有点不正确,服务器基本上是在说“你搞砸了;走开。”(在这种情况下,人们希望服务器会用更有用的诊断消息来响应,但并非总是如此。)

如果你与主办单位有官方联系,或者他们是愿意帮忙的好人,你也许可以给他们发个信息,问他们出了什么问题。在

您的代码看起来很好,我只是尝试通过suds访问服务器,它正常工作。在

from suds.client import Client
client = Client('http://bioinf.cs.ucl.ac.uk/psipred_api/wsdl')
print('PsipredSubmit' in client.wsdl.services[0].ports[0].methods)
>>> True

你通常使用代理吗?在

也许服务器暂时关闭了?在


^{pr2}$

使用suds提交作业有效,可能是您刚好赶上了服务器,或者您的SOAP库有问题?在

相关问题 更多 >