这是我的代码:
from pysimplesoap.client import SoapClient,SimpleXMLElement
client = SoapClient(wsdl='urlToMyWsdl?wsdl')
print client.help("myMethod")
client.myMethod(arg0='mystring', arg1='thisCauseMeError')
帮助功能打印: myMethod(arg0 = type' str'>,arg1 = * {} *)
在wsdl文件的myMethod中,变量arg1是base64Binary。 python期望一个Ordered字典,但我不知道如何设置它。任何想法?
答案 0 :(得分:0)
# Try something like this:
# test_base64binary.py
from base64 import b64decode, b64encode
arg1_prep = {'brunch': 'toast', 'lunch': 'BBQ', 'dinner': 'burger'}
arg1 = b64encode(str(arg1_prep))
print(arg1)
decoded_arg1 = b64decode(arg1)
print(decoded_arg1)