Ejemplo n.º 1
0
    def create_in_document(self, ctx, charset=None):
        if ctx.transport.type == "wsgi":
            # according to the soap via http standard, soap requests must only
            # work with proper POST requests.
            content_type = ctx.transport.req_env.get("CONTENT_TYPE")
            http_verb = ctx.transport.req_env["REQUEST_METHOD"].upper()
            if content_type is None or http_verb != "POST":
                ctx.transport.resp_code = HTTP_405
                raise RequestNotAllowed("You must issue a POST request with the Content-Type " "header properly set.")

            content_type = cgi.parse_header(content_type)
            collapse_swa(content_type, ctx.in_string)

        ctx.in_document = _parse_xml_string(ctx.in_string, XMLParser(**self.parser_kwargs), charset)
Ejemplo n.º 2
0
    def create_in_document(self, ctx, charset=None):
        if ctx.transport.type == 'wsgi':
            # according to the soap via http standard, soap requests must only
            # work with proper POST requests.
            content_type = ctx.transport.req_env.get("CONTENT_TYPE")
            http_verb = ctx.transport.req_env['REQUEST_METHOD'].upper()
            if content_type is None or http_verb != "POST":
                ctx.transport.resp_code = HTTP_405
                raise RequestNotAllowed(
                    "You must issue a POST request with the Content-Type "
                    "header properly set.")

            content_type = cgi.parse_header(content_type)
            collapse_swa(content_type, ctx.in_string)

        ctx.in_document = _parse_xml_string(ctx.in_string, charset)
Ejemplo n.º 3
0
    def create_in_document(self, ctx, charset=None):
        if isinstance(ctx.transport, HttpTransportContext):
            # according to the soap via http standard, soap requests must only
            # work with proper POST requests.
            content_type = ctx.transport.get_request_content_type()
            http_verb = ctx.transport.get_request_method()
            if content_type is None or http_verb != "POST":
                ctx.transport.resp_code = HTTP_405
                raise RequestNotAllowed(
                    "You must issue a POST request with the Content-Type "
                    "header properly set.")

            content_type = cgi.parse_header(content_type)
            collapse_swa(content_type, ctx.in_string)

        ctx.in_document = self._wof_parse_xml_string(
            ctx.in_string, XMLParser(**self.parser_kwargs), charset)
Ejemplo n.º 4
0
    def create_in_document(self, ctx, charset=None):
        if isinstance(ctx.transport, HttpTransportContext):
            # according to the soap via http standard, soap requests must only
            # work with proper POST requests.
            content_type = ctx.transport.get_request_content_type()
            http_verb = ctx.transport.get_request_method()
            if content_type is None or http_verb != "POST":
                ctx.transport.resp_code = HTTP_405
                raise RequestNotAllowed(
                        "You must issue a POST request with the Content-Type "
                        "header properly set.")

            content_type = cgi.parse_header(content_type)
            collapse_swa(content_type, ctx.in_string)

        ctx.in_document = _parse_xml_string(ctx.in_string,
                                            XMLParser(**self.parser_kwargs),
                                                                        charset)