The last two lines of this patch allow the plugin to actually modify the outbound message. It is bit crass to allow this, but it was useful -- and the docs led me to believe it should be possible. Other plugins probably have objects which can support in-place modification, but the envelope here is a string.
soapenv = soapenv.encode('utf-8') ctx = plugins.message.sending(envelope=soapenv) soapenv = ctx.envelope