<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <br>
    <br>
    <div class="moz-cite-prefix">On 04/21/15 06:52, Patricio Stegmann
      Gmail wrote:<br>
    </div>
    <blockquote cite="mid:5535C96E.5080102@gmail.com" type="cite">The
      bare parameter is forcing me to have, for the decorated function,
      only one parameter of input, </blockquote>
    <br>
    SOAP defines a way to map an XML document to a method call.
    Actually, that's like this for every serialization standard / RPC
    standard pair. For example JsonRPC is a standard to map an incoming
    json document to a method call. XmlRpc is another way of mapping xml
    documents to method calls, etc.. <br>
    <br>
    So in normal (non-bare) mode, you define your method and Spyne
    generates needed input and output objects for you. In bare mode,
    it's your job to define these objects. That's why you can only have
    a single input and single output object.<br>
    <br>
    So if your method needs to take two arguments, you have to do what
    Spyne does behind the scenes and define a complex model that has two
    attributes and use that object as type of the single argument to
    your method.<br>
    <br>
    The "one object == one method call" is the fundamental design
    principle behind Spyne[1].<br>
    <br>
    If that's clear, let's get back to your case. You need:<br>
    <blockquote>class InitializeRequest(ComplexModel):<br>
           __type_name__ = 'Initialize'<br>
           __namespace__ = 'tns' # whatever you passed to your app as
      tns argument<br>
      <br>
          _type_info = [<br>
              ('id', Unicode),<br>
              ('name', Unicode),<br>
          ]<br>
    </blockquote>
    and<br>
    <blockquote>class SomeService(ServiceBase):<br>
          @rpc(InitializeRequest, _body_style='bare')<br>
          def wicked(ctx, request):<br>
              print "id:", request.id<br>
              print "name:", request.name<br>
      <br>
    </blockquote>
    If you need to have the namespace of your incoming object different
    from your app's tns,  you need latest code from
    github.com/arskom/spyne. I just found out 2.11 doesn't support that.<br>
    <br>
    I hope this helps.<br>
    <br>
    Best,<br>
    Burak<br>
    <br>
    [1]: That doesn't mean one document can't contain more than one
    object, but that's not implemented because I don't see the point.<br>
    <br>
  </body>
</html>