Skip to content

Soapclient

flowtask.interfaces.SOAPClient

NoProxyAsyncTransport

NoProxyAsyncTransport(client, cache=None, timeout=300, operation_timeout=None)

Bases: AsyncTransport

Zeep AsyncTransport subclass that: - Omits 'proxies=' when building the sync httpx.Client (avoids httpx>=0.28 errors). - Provides the attributes Zeep expects (client, logger, _close_session). - Disables automatic session close in destructor to avoid AsyncClient.close errors.

SOAPClient

SOAPClient(*, credentials, httpx_client=None, redis_url='redis://localhost:6379/0', redis_key='soap:access_token', timeout=30, **kwargs)

Bases: ABC

SOAPClient

Overview

    The SOAPClient class is a generic asynchronous base for SOAP integrations.
    It provides OAuth2 refresh_token grant, Redis caching of access_token, and
    customizable httpx.AsyncClient for Zeep. Designed for easy extension to
    specific SOAP APIs.

.. table:: Properties
:widths: auto

    +-------------------+----------+-----------+---------------------------------------------------------------+
    | Name              | Required | Summary                                                           |
    +-------------------+----------+-----------+---------------------------------------------------------------+
    | credentials       |   Yes    | Dict with client_id, client_secret, token_url, wsdl_path, refresh_token |
    | httpx_client      |   No     | Optionally inject a configured AsyncClient                        |
    | redis_url         |   No     | Redis DSN for token cache                                         |
    | redis_key         |   No     | Key under which to cache the access token                         |
    | timeout           |   No     | HTTP request timeout (seconds)                                    |
    +-------------------+----------+-----------+---------------------------------------------------------------+

Returns

    This component provides an async interface to SOAP APIs, handling authentication,
    caching, and Zeep client/service setup. Subclasses should implement specific
    SOAP operations.

Example:

```python
class MyClient(SOAPClient):
    ...
```
"client_secret": str,
"token_url": str,
"wsdl_path": Union[str, Path],
"refresh_token": str

} :param httpx_client: optionally inject a configured AsyncClient :param redis_url: Redis DSN for token cache :param redis_key: key under which to cache the access token :param timeout: HTTP request timeout (seconds)

bind_service

bind_service()

Return the bound service proxy from Zeep.

close async

close()

Cleanup HTTP session and Redis connection.

get_client

get_client()

Instantiate the Zeep AsyncClient for our WSDL.

get_settings

get_settings()

Zeep settings: non-strict, support huge XML trees.

get_transport

get_transport()

Wrap an AsyncClient in our NoProxyAsyncTransport.

run async

run(operation, **kwargs)

Invoke a named SOAP operation with kwargs.

start async

start()

1) Connect to Redis 2) Get or refresh the bearer token 3) Build Zeep transport, client, and bind the service