[Major Edit based on experience since 1st post two days ago.]
I am building a Python SOAP/XML script using Suds, but am struggling to get the code to generate SOAP/X
I thought I'd share a pretty simple update on the solution above that should work for any WSDL: Note that the sending method is not necessary - it's so that you can audit your changes, as the Client's debug request printing fires before the marshal method runs.
class XMLBS_Plugin(MessagePlugin):
def marshalled(self, context):
def w(x):
if x.isempty():
print "EMPTY: ", x
x.detach()
context.envelope.walk(w)
def sending(self,context):
c = copy.deepcopy(context.envelope)
c=c.replace('><','>\n<') # some sort of readability
logging.info("SENDING: \n%s"%c)