簡體   English   中英

Spyne和Django-silk的請求后錯誤

[英]Post-request error with Spyne and Django-silk

我已經將spyne-RPC用作Django中的SOAP服務器。 我已經安裝了django-silk來監視請求。 對於我的GET請求,它工作正常,但是當我使用POST時,出現以下錯誤和超時。 如果我刪除django-silk,就可以了。 spyne的django.py處存在問題

response = WsgiApplication.__call__(self, environ, start_response)

錯誤如下

Traceback (most recent call last):
  File "/home/test/django/django-apps/venv-test/lib/python2.7/site-packages/django/core/handlers/exception.py", line 41, in inner
    response = get_response(request)

  File "/home/test/django/django-apps/venv-test/lib/python2.7/site-packages/django/core/handlers/base.py", line 187, in _get_response
    response = self.process_exception_by_middleware(e, request)

  File "/home/test/django/django-apps/venv-test/lib/python2.7/site-packages/django/core/handlers/base.py", line 185, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/test/django/django-apps/venv-test/lib/python2.7/site-packages/django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/test/django/django-apps/venv-test/lib/python2.7/site-packages/spyne/server/django.py", line 89, in __call__
    response = WsgiApplication.__call__(self, environ, start_response)
  File "/home/test/django/django-apps/venv-test/lib/python2.7/site-packages/spyne/server/wsgi.py", line 304, in __call__
    return self.handle_rpc(req_env, start_response)
  File "/home/test/django/django-apps/venv-test/lib/python2.7/site-packages/spyne/server/wsgi.py", line 411, in handle_rpc
    contexts = self.generate_contexts(initial_ctx, in_string_charset)
  File "/home/test/django/django-apps/venv-test/lib/python2.7/site-packages/spyne/server/_base.py", line 64, in generate_contexts
    self.app.in_protocol.create_in_document(ctx, in_string_charset)
  File "/home/test/django/django-apps/venv-test/lib/python2.7/site-packages/spyne/protocol/soap/soap11.py", line 202, in create_in_document
    charset)
  File "/home/test/django/django-apps/venv-test/lib/python2.7/site-packages/spyne/protocol/soap/soap11.py", line 96, in _parse_xml_string
    chunk = next(xml_string)
StopIteration

有任何想法嗎?

概率django-silk正在使用返回值中的生成器,該返回值不會為客戶端留下任何數據。

我在文檔中簡要提到了這一點: http : //spyne.io/docs/2.10/manual/03_types.html#arrays

...返回值可能是生成器,除非將數據返回給客戶端,否則不能使用返回值。 這對於例如自定義記錄器很方便,因為它們不應嘗試記錄返回值(因為這將消耗生成器)。

如果您可以自己消耗生成器並將其替換為具有相同數據的列表或元組,則可以正常工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM