def django_dispatch(request): soap_request = SOAPRequest(DjangoEnvironWrapper(request.environ), request.body) soap_request._original_request = request soap_dispatcher = SOAPDispatcher(service, **dispatcher_kwargs) soap_response = soap_dispatcher.dispatch(soap_request) response = HttpResponse(soap_response.http_content) response.status_code = soap_response.http_status_code for k, v in soap_response.http_headers.items(): response[k] = v return response
def flask_dispatch(): soap_request = SOAPRequest(request.environ, request.data) soap_request._original_request = request soap_dispatcher = SOAPDispatcher(service, **dispatcher_kwargs) soap_response = soap_dispatcher.dispatch(soap_request) response = Response(soap_response.http_content) response.status_code = soap_response.http_status_code for k, v in soap_response.http_headers.items(): response.headers[k] = v return response