mvantellingen / python-zeep

A Python SOAP client
http://docs.python-zeep.org
Other
1.87k stars 579 forks source link

problems with returned boolean data #1360

Open neilrieck opened 1 year ago

neilrieck commented 1 year ago

========================================================= Here is a quick fix for zeep-4.1.0 from Dave McNeil of our group:

In /usr/local/lib/python3.6/site-packages/zeep/wsdl/messages/soap.py at line 115 I added:

114 result = result.body 115 # DGM added test for bool since len(bool) raises and error 116 if isinstance(result, bool): 117 return result 118 if result is None or len(result) == 0:

========================================================= I am converting the Z-side of a SOAP interface that has been in production for more than 10 years. The A-side is Java-based SOAP running on UNIX in Montreal, Quebec. The Z-side is gsoap-based SOAP running on OpenVMS in Waterloo, Ontario. The new Z-side will be based upon python-zeep. The isAlive() method is defined to return a boolean. Both the Java-based and gsoap-based implementations return a response similar to this:

<?xml version="1.0" encoding="UTF-8"?>

true This XML actually makes it back to zeep but is not parsed properly so always yields an error message similar to this: "error object of type 'bool' has no len()" It could have something to do with the response text 'true' being treated as a string rather than the python boolean 'True' Neil Rieck Waterloo, Ontario, Canada. ============================================ You probably do not need this but the original WSDL follows: