Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the create_message function for clients with no default service. #1427

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/zeep/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 5 additions & 2 deletions src/zeep/wsdl/bindings/soap.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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(
Expand Down