I am working with a somewhat non-standard SOAP webservice. Most of the calls to the webservice return the standard SOAP XML as you would expect, but one call in particular returns a JSON string instead. This fouls up the xml parser on the client side.
My question is; is there a way to designate the return type on a particular webmethod in SUDS so that it does not try to run it through the xml parser? I just want the raw JSON response.
I would use the Python JSON encoder to validate first if it is JSON before feeding it to the XML parser.
try:
json.loads(json_to_test)
except ValueError:
print "Invalid json"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With