Skip to content

Commit

Permalink
FIX: support calls without payload in Zeep
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenein committed Nov 7, 2023
1 parent 94ff459 commit a4d4034
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions combadge/support/http/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ def ensure_payload(self) -> dict:
self.payload = {}
return self.payload

def get_payload(self) -> dict:
"""Get a validated request payload."""
if (payload := self.payload) is None:
raise ValueError("a request requires a non-empty payload")
return payload


class SupportsStatusCode(Protocol):
"""Supports a read-only status code attribute or property."""
Expand Down
2 changes: 1 addition & 1 deletion combadge/support/zeep/backends/async_.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ async def bound_method(self: BaseBoundService[ZeepBackend], *args: Any, **kwargs
operation = backend._get_operation(request.get_operation_name())
try:
async with self.backend._request_with(request):
response = await operation(**request.get_payload())
response = await operation(**(request.payload or {}))
except Fault as e:
return backend._parse_soap_fault(e, fault_type)
else:
Expand Down
2 changes: 1 addition & 1 deletion combadge/support/zeep/backends/sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def bound_method(self: BaseBoundService[ZeepBackend], *args: Any, **kwargs: Any)
operation = backend._get_operation(request.get_operation_name())
try:
with self.backend._request_with(request):
response = operation(**request.get_payload())
response = operation(**(request.payload or {}))
except Fault as e:
return backend._parse_soap_fault(e, fault_type)
else:
Expand Down

0 comments on commit a4d4034

Please sign in to comment.