pysimplesoap for base64Binary

259 Views Asked by At

This is my code:

from pysimplesoap.client import SoapClient,SimpleXMLElement
client = SoapClient(wsdl='urlToMyWsdl?wsdl')
print client.help("myMethod")
client.myMethod(arg0='mystring', arg1='thisCauseMeError')

the help function prints: myMethod(arg0=type 'str'>, arg1=*{}*)

in myMethod at wsdl file, the variable arg1 is base64Binary. python expects a Ordered dictionary, but I dont know how to set it. Any Ideas?

1

There are 1 best solutions below

1
Down the Stream On
# 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)