diff --git a/src/zeep/client.py b/src/zeep/client.py index fac7ecd7..261d15d8 100644 --- a/src/zeep/client.py +++ b/src/zeep/client.py @@ -148,7 +148,7 @@ def create_message(self, service, operation_name, *args, **kwargs): """ envelope, http_headers = service._binding._create( - operation_name, args, kwargs, client=self + operation_name, args, kwargs, client=self, service=service ) return envelope diff --git a/src/zeep/wsdl/bindings/soap.py b/src/zeep/wsdl/bindings/soap.py index 3a5e5433..efb358b0 100644 --- a/src/zeep/wsdl/bindings/soap.py +++ b/src/zeep/wsdl/bindings/soap.py @@ -59,7 +59,7 @@ def create_message(self, operation, *args, **kwargs): envelope, http_headers = self._create(operation, args, kwargs) return envelope - def _create(self, operation, args, kwargs, client=None, options=None): + def _create(self, operation, args, kwargs, client=None, options=None, service=None): """Create the XML document to send to the server. Note that this generates the soap envelope without the wsse applied. @@ -78,8 +78,11 @@ def _create(self, operation, args, kwargs, client=None, options=None): # Apply ws-addressing if client: + if service is None: + service = client.service + if not options: - options = client.service._binding_options + options = service._binding_options if operation_obj.abstract.wsa_action: envelope, http_headers = wsa.WsAddressingPlugin().egress(