1

我正在尝试使用 Web 服务调用一个函数,该服务似乎使用 SoapUI 可以正常工作,但不能使用 pysimplesoap。WSDL 有这个功能:

Name: getAvailableDates
Input {'getAvailableDates': {u'criteria': {u'id': <type 'str'>, u'appointmentDurationMin': <type 'int'>}, u'numberOfSlots': <type 'int'>}}

但是当我这样调用它时:

client.getAvailableDates(criteria={'id' : '1', 'appointmentDurationMin' : 60}, numberOfSlots=10)

但它总是返回一个我不明白的神秘错误:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/env/lib/python2.7/site-packages/pysimplesoap/client.py", line 181, in <lambda>
    return lambda *args, **kwargs: self.wsdl_call(attr, *args, **kwargs)
  File "/env/lib/python2.7/site-packages/pysimplesoap/client.py", line 346, in wsdl_call
    return self.wsdl_call_with_args(method, args, kwargs)
  File "/env/lib/python2.7/site-packages/pysimplesoap/client.py", line 370, in wsdl_call_with_args
    response = self.call(method, *params)
  File "/env/lib/python2.7/site-packages/pysimplesoap/client.py", line 269, in call
    fault = operation['faults'][detailXml.children()[0].get_name()]
KeyError: u'ns2:TTServiceException'

关于我可能做错了什么的想法?感谢任何帮助。

4

0 回答 0