Zeep - Python SOAP Client
raw JSON → 4.3.2 verified Tue May 12 auth: no python install: verified quickstart: verified
Zeep is a fast and modern Python SOAP client library, currently at version 4.3.2. It simplifies interactions with SOAP web services by inspecting WSDL documents and generating a Pythonic interface. The library is considered stable, focusing on bug fixes, with major releases occurring less frequently, typically when significant changes to Python support or underlying dependencies are required.
pip install zeep Common errors
error ModuleNotFoundError: No module named 'zeep' ↓
cause The `zeep` library has not been installed in the active Python environment or the environment is not correctly selected.
fix
Install the library using pip in your active Python environment:
pip install zeep error xml.etree.ElementTree.ParseError: syntax error: line 1, column 0 ↓
cause Zeep failed to parse the WSDL document because it was not valid XML, often due to an incorrect URL or a server returning an HTML error page.
fix
Verify the WSDL URL is correct and directly points to a valid XML WSDL document, checking network access and server responses.
error zeep.exceptions.ValidationError: Missing required element {http://...}ElementName ↓
cause A required element for the SOAP operation, as defined in the WSDL, was omitted or incorrectly provided when making the service call.
fix
Consult the WSDL or the service's documentation to identify all mandatory parameters for the specific operation and ensure they are passed correctly.
error requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: ... ↓
cause The WSDL document requires authentication, and the Zeep client was initialized without providing the necessary HTTP basic authentication credentials.
fix
Pass a
requests session configured with requests.auth.HTTPBasicAuth (e.g., session.auth = HTTPBasicAuth('user', 'pass')) to the zeep.Client constructor's transport argument. error zeep.exceptions.Fault: Server Error ↓
cause The remote SOAP web service encountered an error and returned a SOAP Fault, indicating a problem on the server side or with the request's content.
fix
Inspect the
Fault object's details (code, message) to understand the service-side error, correct your request parameters, or contact the service provider. Warnings
breaking Zeep v4.3.0 dropped official support for Python 3.7 and 3.8. Version 4.2.0 dropped support for Python 3.6. Ensure your Python environment meets the `requires_python>=3.8` requirement. ↓
fix Upgrade your Python environment to 3.9 or newer. The latest versions of Zeep (e.g., 4.3.2) support Python 3.9 through 3.13.
breaking Starting with Zeep v4.3.0, the project fully migrated to `pyproject.toml`, removing `setup.py`. This impacts build systems that might rely on the presence of `setup.py`. ↓
fix Update your build and packaging tools to correctly handle projects using `pyproject.toml` and PEP 517/518 standards.
gotcha A regression in parsing `xsd:Date` with negative timezones was introduced and fixed in version 4.3.1. This issue could occur when using `isodate==0.7.2` with `zeep` versions prior to 4.3.1, leading to incorrect date interpretations or exceptions. ↓
fix Upgrade to Zeep 4.3.1 or newer to correctly handle `xsd:Date` values, especially when dealing with negative timezone offsets.
gotcha When using `httpx` for asynchronous transport, passing `data` for POST requests might trigger `DeprecationWarning` in older `httpx` versions. Zeep v4.2.0 includes a fix for this. ↓
fix Upgrade to Zeep 4.2.0 or newer to avoid `httpx` deprecation warnings related to `post data`. Ensure your `httpx` version is also up-to-date.
gotcha Disabling TLS/SSL verification (e.g., `session.verify = False` for synchronous `requests`-based transport, or similar for `httpx`) is generally discouraged in production environments due to security risks. Zeep will pass these settings to the underlying transport. ↓
fix Always use proper certificate validation by providing a path to a CA bundle (`session.verify = 'path/to/ca_bundle.pem'`) or a client certificate, rather than disabling verification.
gotcha Zeep operates in a 'strict' mode by default, which rigorously checks WSDL and XML against standards. While robust, some non-compliant SOAP servers might require disabling strict mode (`zeep.Settings(strict=False)`), which could potentially lead to data-loss or unexpected behavior. ↓
fix Only disable strict mode as a last resort for known non-compliant services, and thoroughly test the interaction to ensure data integrity.
breaking For `AsyncTransport` (used with `AsyncClient`), the `session` argument that previously accepted a `requests.Session` object is deprecated. It now expects an `httpx.AsyncClient` object to be passed via the `client` argument. ↓
fix When initializing `AsyncTransport`, provide an `httpx.AsyncClient` instance to the `client` parameter, e.g., `AsyncTransport(client=httpx.AsyncClient())`.
breaking Zeep failed to parse the WSDL due to invalid or malformed XML content received from the WSDL URL. This can occur if the URL is incorrect, the server is unreachable, or returns an error page (e.g., HTML) or corrupt data instead of a valid WSDL document. The error manifests as an 'Opening and ending tag mismatch' or similar low-level XML parsing error. ↓
fix Ensure the WSDL URL is correct and accessible. Verify that the server hosting the WSDL is operational and consistently returns a well-formed XML document conforming to the WSDL standard. Inspect the actual content returned by the WSDL URL to diagnose the issue (e.g., using `curl` or a web browser).
Install compatibility verified last tested: 2026-05-12
python os / libc status wheel install import disk
3.10 alpine (musl) wheel - 0.85s 38.4M
3.10 alpine (musl) - - 0.73s 38.4M
3.10 slim (glibc) wheel 3.5s 0.55s 39M
3.10 slim (glibc) - - 0.53s 39M
3.11 alpine (musl) wheel - 0.91s 40.8M
3.11 alpine (musl) - - 0.97s 40.8M
3.11 slim (glibc) wheel 3.7s 0.80s 41M
3.11 slim (glibc) - - 0.76s 41M
3.12 alpine (musl) wheel - 0.79s 32.6M
3.12 alpine (musl) - - 0.83s 32.6M
3.12 slim (glibc) wheel 3.0s 0.80s 33M
3.12 slim (glibc) - - 0.81s 33M
3.13 alpine (musl) wheel - 0.79s 32.4M
3.13 alpine (musl) - - 0.79s 32.2M
3.13 slim (glibc) wheel 2.8s 0.79s 33M
3.13 slim (glibc) - - 1.29s 33M
3.9 alpine (musl) wheel - 0.69s 37.6M
3.9 alpine (musl) - - 0.67s 37.8M
3.9 slim (glibc) wheel 4.0s 0.65s 38M
3.9 slim (glibc) - - 0.56s 38M
Imports
- Client
from zeep import Client - AsyncClient
from zeep import AsyncClient - Settings
from zeep import Settings - Transport
from zeep.transports import Transport - AsyncTransport
from zeep.transports import AsyncTransport
Quickstart verified last tested: 2026-04-24
import os
from zeep import Client
# A public WSDL for demonstration purposes
wsdl_url = os.environ.get('ZEEP_WSDL_URL', 'http://www.webservicex.net/ConvertSpeed.asmx?WSDL')
try:
client = Client(wsdl_url)
# Inspect available services and operations
print(f"Service operations: {list(client.service._operations.keys())}")
# Call a service operation
result = client.service.ConvertSpeed(100, 'kilometersPerhour', 'milesPerhour')
print(f"100 km/h in mph: {result}")
except Exception as e:
print(f"An error occurred: {e}")
print("Please ensure the WSDL URL is accessible and valid.")
print("You can try setting the ZEEP_WSDL_URL environment variable.")