1
我想從官方的pip倉庫中使用jurko(Python 3.5.2)發出一些使用泡沫的SOAP。聲明與泡沫錯誤
這是我的代碼。不幸的是,我應該隱藏我的登錄名和密碼,因此您不能將其複製並粘貼到您的終端。
my_login = 'login'
my_password = 'password'
barcode = '10100082848426'
message = \
"""<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:oper="http://russianpost.org/operationhistory" xmlns:data="http://russianpost.org/operationhistory/data" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header/>
<soap:Body>
<oper:getOperationHistory>
<data:OperationHistoryRequest>
<data:Barcode>""" + barcode+ """</data:Barcode>
<data:MessageType>0</data:MessageType>
<data:Language>RUS</data:Language>
</data:OperationHistoryRequest>
<data:AuthorizationHeader soapenv:mustUnderstand="1">
<data:login>"""+ my_login +"""</data:login>
<data:password>""" + my_password + """</data:password>
</data:AuthorizationHeader>
</oper:getOperationHistory>
</soap:Body>
</soap:Envelope>"""
result = client.service.getOperationHistory(__inject={'msg':message})
在這裏,我得到一個錯誤:
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/usr/local/lib/python3.5/site-packages/suds/client.py", line 521, in __call__
return client.invoke(args, kwargs)
File "/usr/local/lib/python3.5/site-packages/suds/client.py", line 760, in invoke
assert msg.__class__ is suds.byte_str_class
AssertionError
從回溯,我的理解是什麼錯誤,但我想不出什麼原因造成的。有什麼建議麼?
注:此請求是俄羅斯郵政API請求,所有需要採取
我還沒有足夠的信譽發表評論,但我發現皁液的庫頁上的這種情況。它是一個[bug](https://bitbucket.org/jurko/suds/issues/106/assertionerror) –