<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Hi Alex,<br>
    <br>
    The request for<br>
    <br>
        @rpc(RequestStatus, _returns=Integer)<br>
        def DemoFunction(ctx, data):<br>
    <br>
    is:<br>
    <br>
    {"DemoFunction": {"data": "whatever"}}<br>
    <br>
    So Spyne seems to be doing the right thing here. It should do the
    same thing every time though, are you sure you're sending the same
    document every time?.. Can you reproduce this with curl as well?<br>
    <br>
    $ curl -d '{"DemoFunction": {"data": "new"}}' <a class="moz-txt-link-freetext" href="http://localhost:8000">http://localhost:8000</a><br>
    4<br>
    $ curl -d '{"DemoFunction": {"data": "whatever"}}'
    <a class="moz-txt-link-freetext" href="http://localhost:8000">http://localhost:8000</a><br>
    {"faultcode": "Client.ValidationError", "faultstring": "The value
    \"('data', u'whatever')\" could not be validated."}<br>
    <br>
    Best regards,<br>
    Burak<br>
    <br>
    <div class="moz-cite-prefix">On 06/17/14 15:52, Alex wrote:<br>
    </div>
    <blockquote
cite="mid:CANK1NR0x4uFXGZ9y=v-ninXWq=Z3SXv8iUMKyz79FBuVetPmfA@mail.gmail.com"
      type="cite">
      <pre wrap="">Attached is an example that replicates the problem, the code is also
available here: <a class="moz-txt-link-freetext" href="http://pastebin.com/L0UC6pzh">http://pastebin.com/L0UC6pzh</a>


This is an example of what happens:
telnet 127.0.0.1 8000
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
POST / HTTP/1.1
Host: localhost
Content-Length: 42

{"DemoFunction":{"data":{"status":"new"}}}
HTTP/1.0 400 Bad Request
Date: Tue, 17 Jun 2014 12:46:01 GMT
Server: WSGIServer/0.1 Python/2.7.4
Content-Length: 131
Content-Type: application/json

{"faultcode": "Client.ValidationError", "faultstring": "The value
\"{u'status': u'new'}\" could not be validated.", "detail":
null}Connection closed by foreign host.





Here's the weird part, when I first ran it - it worked as expected. I
then gave it another try and the problem persists ever since.
Fortunately my terminal log confirms that it did behave correctly
once, printing `4` the first time:

alex@ralien ~/dk_cvs/Netopay/WebAPI/src $ telnet 127.0.0.1 8000
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
POST / HTTP/1.1
Host: localhost
Content-Length: 42

{"DemoFunction":{"data":{"status":"new"}}}
HTTP/1.0 200 OK
Date: Tue, 17 Jun 2014 12:34:46 GMT
Server: WSGIServer/0.1 Python/2.7.4
Content-Type: application/json

4Connection closed by foreign host.
alex@ralien ~/dk_cvs/Netopay/WebAPI/src $ telnet 127.0.0.1 8000
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
POST / HTTP/1.1
Host: localhost
Content-Length: 42

{"DemoFunction":{"data":{"status":"new"}}}
HTTP/1.0 400 Bad Request
Date: Tue, 17 Jun 2014 12:35:53 GMT
Server: WSGIServer/0.1 Python/2.7.4
Content-Length: 131
Content-Type: application/json

{"faultcode": "Client.ValidationError", "faultstring": "The value
\"{u'status': u'new'}\" could not be validated.", "detail":
null}Connection closed by foreign host.
</pre>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Spyne community mailing list
<a class="moz-txt-link-abbreviated" href="mailto:people@spyne.io">people@spyne.io</a>
<a class="moz-txt-link-freetext" href="http://lists.spyne.io/listinfo/people">http://lists.spyne.io/listinfo/people</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>