title: Print out entire SOAP request in python spyne server
body: <p>I have a SOAP server which is written using <code>spyne</code>. Here is the code:</p>
  
  <pre><code>class myService(ServiceBase):
  
      @rpc(Integer, String, _returns=String)
      def my_method(ctx):
          sys.stdout.write("Request for `myService`: {}\n".format(ctx))
          return "0," + "".join(random.sample(string.hexdigits, 16))
  
  
  application = Application(
      [myService],
      tns=NAMESPACE,
      in_protocol=Soap11(validator="lxml"),
      out_protocol=Soap11()
  )
  
  
  if __name__ == "__main__":
      logging.basicConfig(level=logging.DEBUG)
      logging.getLogger("spyne.util").setLevel(logging.DEBUG)
      wsgi_app = WsgiApplication(application)
      server = make_server("0.0.0.0", 5555, wsgi_app)
      server.serve_forever()
  </code></pre>
  
  <p>It is a simulator which is going to mock a real service. I connect them with desired clients, but I'm getting <code>code 400, message Bad HTTP/0.9 request type</code> error for every request. Since I don't have access to the clients who are calling my mock server, I want to print out the received request in my server. Above code does not work (<code>sys.stdout.write</code>). </p>
  
  <p><strong>EDIT 1:</strong></p>
  
  <p>I changed <code>sys.stdout</code> to python <code>logger</code>:</p>
  
  <pre><code>import logging
  logger = logging.getLogger("spyne.util")
  ...
  ...
  ...
  logger.info("Request for `myService`: {}\n".format(ctx))
  </code></pre>
  
  <p>But nothing is printed and I'm getting following error this time:</p>
  
  <pre><code>code 400, message Bad request syntax
  </code></pre>