所以最初我连接到服务器:
soapclient = Client(url, transport=WindowsHttpAuthenticated(username=user, password=passwd))
这样可以正常工作,因为当我打印它时,它会正确显示所有属性。
然后我跑:
request = self.soapclient.factory.create('ns3:CRRequest')
request['ChangeRequestId'] = '601904'
response = self.soapclient.service.GetChangeRequestById([request])
然后我在响应行上收到一条错误,上面写着:
Traceback (most recent call last):
File "C:\Users\nlujan\Desktop\prism_source.py", line 63, in <module>
CR = prism.getChangeRequestById('601904')
File "C:\Users\nlujan\Desktop\prism_source.py", line 36, in getChangeRequestById
response = self.soapclient.service.GetChangeRequestById([request])
File "build\bdist.win32\egg\suds\client.py", line 542, in __call__
return client.invoke(args, kwargs)
File "build\bdist.win32\egg\suds\client.py", line 602, in invoke
File "build\bdist.win32\egg\suds\client.py", line 643, in send
result = self.succeeded(binding, reply.message)
File "build\bdist.win32\egg\suds\client.py", line 678, in succeeded
reply, result = binding.get_reply(self.method, reply)
File "build\bdist.win32\egg\suds\bindings\binding.py", line 149, in get_reply
soapenv.promotePrefixes()
AttributeError: 'NoneType' object has no attribute 'promotePrefixes'
我有其他人运行我的脚本,它在他们的计算机上工作正常,但我一直在收到错误。我已经安装了几个不同版本的python来查看是否存在问题,但没有运气。有谁看到可能是什么问题?
答案 0 :(得分:0)
尝试添加端点地址
client = Client('url', location = "https://someurl/services")