나는 약간의 튜토리얼에 따라 Django로 "Hello World"webservice를 만들려고 노력하고 있지만, 같은 장벽을 반복해서 반복하고있다.Django soaplib error
view.py :
from soaplib_handler import DjangoSoapApp, soapmethod, soap_types
class HelloWorldService(DjangoSoapApp):
__tns__ = 'http://saers.dk/soap/'
@soapmethod(_returns=soap_types.Array(soap_types.String))
def hello(self):
return "Hello World"
soaplib_handler.py : 나는 view.py 및 soaplib_handler.py 정의한
from soaplib.wsgi_soap import SimpleWSGISoapApp
from soaplib.service import soapmethod
from soaplib.serializers import primitive as soap_types
from django.http import HttpResponse
class DjangoSoapApp(SimpleWSGISoapApp):
def __call__(self, request):
django_response = HttpResponse()
def start_response(status, headers):
status, reason = status.split(' ', 1)
django_response.status_code = int(status)
for header, value in headers:
django_response[header] = value
response = super(SimpleWSGISoapApp, self).__call__(request.META, start_response)
django_response.content = "\n".join(response)
return django_response
을 그리고 그것은 "응답 = 슈퍼 보인다 ... . "선은 나를 괴롭힌다. 내가 /hello_world/services.wsdl url.py에 매핑로드 할 때 내가 얻을 :
AttributeError /hello_world/service.wsdl '모듈'개체는 전체 오류 메시지에 대한 속성 'tostring'
이 없습니다에 , 여기를 참조하십시오 : http://saers.dk:8000/hello_world/service.wsdl
이 오류가 발생하는 이유에 대한 의견이 있으십니까? ElementTree는 어디에 정의되어 있습니까?
네가 맞습니다. http://saers.dk:8000/hello_world/service.wsdl을 호출하면 hello() 메소드가 호출되지 않으므로 다른 문제점이 있습니다. – zinovii