Skip to content

Commit

Permalink
Adding create_service for AsyncClient
Browse files Browse the repository at this point in the history
  • Loading branch information
smilingDima committed Sep 26, 2024
1 parent 8738d02 commit bf5760a
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/zeep/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,22 @@ async def __aenter__(self):
async def __aexit__(self, exc_type=None, exc_value=None, traceback=None) -> None:
await self.transport.aclose()

def create_service(self, binding_name, address):
"""Create a new AsyncServiceProxy for the given binding name and address.
:param binding_name: The QName of the binding
:param address: The address of the endpoint
"""
try:
binding = self.wsdl.bindings[binding_name]
except KeyError:
raise ValueError(
"No binding found with the given QName. Available bindings "
"are: %s" % (", ".join(self.wsdl.bindings.keys()))
)
return AsyncServiceProxy(self, binding, address=address)

async def create_message(self, service, operation_name, *args, **kwargs):
"""Create the payload for the given operation.
Expand Down

0 comments on commit bf5760a

Please sign in to comment.