我已阅读关于Spyne Faults(http://spyne.io/docs/2.10/manual/03_types.html)的信息,但无法正确地使用400返回码提醒错误。我有故障的反应形成正确的,但有一个500 HTTP返回代码时,我有一个要求返回400Spyne Fault - HTTP返回代码
@srpc(Boolean, _returns=String)
def requestConfiguration(value):
#if value is true, get all the data
if value == True:
#todo - get the config
return 'True Received'
else:
# if anything other than True is received, MUST respond with a SOAP fault and HTTP 400
raise Fault(faultcode="Client.", faultstring="Value must be True")
# raise error.InvalidInputError("problem", "problem")
阅读一些文件(http://spyne.io/docs/2.10/modules/spyne/model/fault.html#Fault)的,我将其解释为在faultcode必须是字符串从客户端开始,它将返回400错误。 (我知道如果 - 否则是坏的,即时只是试图得到一个概念证明工作之前,我写代码正常)
我想我需要继承故障,而不是只提高它,但不能提高我的头它。我跳入代码/协议/ SOAP/soap11,只见那fault_to_http_reponse_code只是返回HTTP提前