def send(self, soapenv):
result = None<EOL>location = self.location()<EOL>binding = self.method.binding.input<EOL>transport = self.options.transport<EOL>retxml = self.options.retxml<EOL>prettyxml = self.options.prettyxml<EOL>log.debug('<STR_LIT>', location, soapenv)<EOL>try:<EOL><INDENT>self.last_sent(soapenv)<EOL>plugins = PluginContainer(self.options.plugins)<EOL>plugins.message.marshalled(envelope=soapenv.root())<EOL>if prettyxml:<EOL><INDENT>soapenv = soapenv.str()<EOL><DEDENT>else:<EOL><INDENT>soapenv = soapenv.plain()<EOL><DEDENT>soapenv = soapenv.encode('<STR_LIT:utf-8>')<EOL>plugins.message.sending(envelope=soapenv)<EOL>request = Request(location, soapenv)<EOL>request.headers = self.headers()<EOL>reply = transport.send(request)<EOL>ctx = plugins.message.received(reply=reply.message)<EOL>reply.message = ctx.reply<EOL>if retxml:<EOL><INDENT>result = reply.message<EOL><DEDENT>else:<EOL><INDENT>result = self.succeeded(binding, reply.message)<EOL><DEDENT><DEDENT>except TransportError as e:<EOL><INDENT>if e.httpcode in (<NUM_LIT>,<NUM_LIT>):<EOL><INDENT>result = None<EOL><DEDENT>else:<EOL><INDENT>log.error(self.last_sent())<EOL>result = self.failed(binding, e)<EOL><DEDENT><DEDENT>return result<EOL>
Send soap message.
@param soapenv: A soap envelope to send.
@type soapenv: L{Document}
@return: The reply to the sent message.
@rtype: I{builtin} or I{subclass of} L{Object}