From 827f7432fc96f0f2b458301ea023a48c43c40541 Mon Sep 17 00:00:00 2001 From: Harry Karvonen Date: Tue, 11 Jan 2022 12:47:22 +0200 Subject: [PATCH 1/2] SoapMessage.parse find first soap:body anywhere. --- src/zeep/wsdl/messages/soap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zeep/wsdl/messages/soap.py b/src/zeep/wsdl/messages/soap.py index 553bfa2c2..3292f2022 100644 --- a/src/zeep/wsdl/messages/soap.py +++ b/src/zeep/wsdl/messages/soap.py @@ -197,7 +197,7 @@ def parse(cls, definitions, xmlelement, operation, type, nsmap): # After some profiling it turns out that .find() and .findall() in this # case are twice as fast as the xpath method - body = xmlelement.find("soap:body", namespaces=operation.binding.nsmap) + body = xmlelement.find(".//soap:body", namespaces=operation.binding.nsmap) if body is not None: body_data = cls._parse_body(body) From e55763f11c6d91d8dc93fecd803a943882a281fb Mon Sep 17 00:00:00 2001 From: Harry Karvonen Date: Tue, 11 Jan 2022 12:58:18 +0200 Subject: [PATCH 2/2] SoapMessage.parse find soap:headers anywhere. --- src/zeep/wsdl/messages/soap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zeep/wsdl/messages/soap.py b/src/zeep/wsdl/messages/soap.py index 3292f2022..3296683df 100644 --- a/src/zeep/wsdl/messages/soap.py +++ b/src/zeep/wsdl/messages/soap.py @@ -202,7 +202,7 @@ def parse(cls, definitions, xmlelement, operation, type, nsmap): body_data = cls._parse_body(body) # Parse soap:header (multiple) - elements = xmlelement.findall("soap:header", namespaces=operation.binding.nsmap) + elements = xmlelement.findall(".//soap:header", namespaces=operation.binding.nsmap) header_data = cls._parse_header( elements, definitions.target_namespace, operation )