python-zeep icon indicating copy to clipboard operation
python-zeep copied to clipboard

The Base64Binary type doesn't accept collections as value

Open argomauro opened this issue 3 years ago • 0 comments

ZEEP 4.1.0 Python 3.9.7

Hi, Thanks in advance for the support. I have a problem with invoking a service that has a base64 element as its element. The "stream" parameter is a base64 and building the object from ZEEP I get an error of the type reported in the object. WSDL online

` message = "Python is fun" message_bytes = message.encode('utf-8') base64_bytes = base64.b64encode(message_bytes)

identity_val={'delegated_domain': 'demoprod', 'delegated_password': 'password11','stream':base64_bytes,'delegated_user':'delegato' ,'otpPwd':'dsign','typeOtpAuth':'demoprod','user':'titolare_aut'} parameter_val={'type':'XMLENVELOPED'} parameter = parameter_type(parameter_val) signRequestV2_val={'certID': 'AS0','requiredmark':'true','identity':identity_val,'transport':'STREAM'} signRequestV2 = signRequestV2_type(signRequestV2_val)`

Error: raise ValueError( ValueError: The Base64Binary type doesn't accept collections as value

I also tried to pass the parameter directly to the method instead of putting it in the Collection but the result is the same.

Thanks for support

argomauro avatar Jan 18 '22 14:01 argomauro