Is there a way in zeep to inject raw XML into a message?
I'm looking for similar functionality to either the Raw method or the __inject kwarg in suds-jurko.
I'm thinking of this as a workaround for the issue in https://github.com/mvantellingen/python-zeep/issues/401
Look here
I'm currently using the Plugin structure as a workaround to fix the escaped chars e.g. All my current SOAP operations uses a XML doc as argument.
Probably the cleanest with to do is have a XmlType to contain arbitrary XML that won't get escaped when the envelope is serialized (eg: it overrides serialization and returns an etree.Element that gets appended to the parent):
xml = XmlType('<hi />')
client.service.say(message=xml)
Under the hook, XmlType will probably just call etree.XML(), but, most importantly, will override the default serialization when constructing the entire envelope.
Accepting both Elements and strs would be the cherry on top really.
This would be a nice feature.
@lfmet could you elaborate on how you fix the escaped characters from the plugin? I'm facing the same problem and it would be very helpful for me
@lfmet could you elaborate on how you fix the escaped characters from the plugin? I'm facing the same problem and it would be very helpful for me
https://stackoverflow.com/questions/48655638/python-zeep-send-un-escaped-xml-as-content
Most helpful comment
Probably the cleanest with to do is have a
XmlTypeto contain arbitrary XML that won't get escaped when the envelope is serialized (eg: it overrides serialization and returns anetree.Elementthat gets appended to the parent):Under the hook,
XmlTypewill probably just calletree.XML(), but, most importantly, will override the default serialization when constructing the entire envelope.Accepting both
Elements andstrs would be the cherry on top really.