{"id":732,"library":"zeep","title":"Zeep - Python SOAP Client","description":"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.","status":"active","version":"4.3.2","language":"python","source_language":"en","source_url":"https://github.com/mvantellingen/python-zeep","tags":["SOAP","XML","client","WSDL","web services","async"],"install":[{"cmd":"pip install zeep","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Core dependency for high-performance XML parsing and manipulation. Requires C development headers for libxml2 and libxslt.","package":"lxml"},{"reason":"Default HTTP transport layer for synchronous operations.","package":"requests"},{"reason":"Underlying HTTP client for asynchronous operations (via zeep.AsyncTransport).","package":"httpx"},{"reason":"Used for parsing and handling ISO 8601 date and time formats within SOAP messages.","package":"isodate"}],"imports":[{"symbol":"Client","correct":"from zeep import Client"},{"symbol":"AsyncClient","correct":"from zeep import AsyncClient"},{"symbol":"Settings","correct":"from zeep import Settings"},{"symbol":"Transport","correct":"from zeep.transports import Transport"},{"symbol":"AsyncTransport","correct":"from zeep.transports import AsyncTransport"}],"quickstart":{"code":"import os\nfrom zeep import Client\n\n# A public WSDL for demonstration purposes\nwsdl_url = os.environ.get('ZEEP_WSDL_URL', 'http://www.webservicex.net/ConvertSpeed.asmx?WSDL')\n\ntry:\n    client = Client(wsdl_url)\n    # Inspect available services and operations\n    print(f\"Service operations: {list(client.service._operations.keys())}\")\n\n    # Call a service operation\n    result = client.service.ConvertSpeed(100, 'kilometersPerhour', 'milesPerhour')\n    print(f\"100 km/h in mph: {result}\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Please ensure the WSDL URL is accessible and valid.\")\n    print(\"You can try setting the ZEEP_WSDL_URL environment variable.\")","lang":"python","description":"Initializes a Zeep client with a WSDL URL and makes a synchronous call to a public SOAP service. This example demonstrates basic client instantiation and calling a service operation. Replace the WSDL_URL with your target service's WSDL. For asynchronous operations, use `AsyncClient` and `AsyncTransport`."},"warnings":[{"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.","message":"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.","severity":"breaking","affected_versions":">=4.3.0, >=4.2.0"},{"fix":"Update your build and packaging tools to correctly handle projects using `pyproject.toml` and PEP 517/518 standards.","message":"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`.","severity":"breaking","affected_versions":">=4.3.0"},{"fix":"Upgrade to Zeep 4.3.1 or newer to correctly handle `xsd:Date` values, especially when dealing with negative timezone offsets.","message":"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.","severity":"gotcha","affected_versions":"<4.3.1"},{"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.","message":"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.","severity":"gotcha","affected_versions":"<4.2.0"},{"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.","message":"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.","severity":"gotcha","affected_versions":"All"},{"fix":"Only disable strict mode as a last resort for known non-compliant services, and thoroughly test the interaction to ensure data integrity.","message":"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.","severity":"gotcha","affected_versions":"All"},{"fix":"When initializing `AsyncTransport`, provide an `httpx.AsyncClient` instance to the `client` parameter, e.g., `AsyncTransport(client=httpx.AsyncClient())`.","message":"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.","severity":"breaking","affected_versions":">=4.0.0"},{"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).","message":"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.","severity":"breaking","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-05-12T18:22:40.562Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"Install the library using pip in your active Python environment: `pip install zeep`","cause":"The `zeep` library has not been installed in the active Python environment or the environment is not correctly selected.","error":"ModuleNotFoundError: No module named 'zeep'"},{"fix":"Verify the WSDL URL is correct and directly points to a valid XML WSDL document, checking network access and server responses.","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.","error":"xml.etree.ElementTree.ParseError: syntax error: line 1, column 0"},{"fix":"Consult the WSDL or the service's documentation to identify all mandatory parameters for the specific operation and ensure they are passed correctly.","cause":"A required element for the SOAP operation, as defined in the WSDL, was omitted or incorrectly provided when making the service call.","error":"zeep.exceptions.ValidationError: Missing required element {http://...}ElementName"},{"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.","cause":"The WSDL document requires authentication, and the Zeep client was initialized without providing the necessary HTTP basic authentication credentials.","error":"requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: ..."},{"fix":"Inspect the `Fault` object's details (code, message) to understand the service-side error, correct your request parameters, or contact the service provider.","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.","error":"zeep.exceptions.Fault: Server Error"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":80,"quickstart_tag":"verified","pypi_latest":"4.3.2","install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":0.85,"mem_mb":13.2,"disk_size":"38.4M"},{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.73,"mem_mb":13.1,"disk_size":"38.4M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":3.5,"import_time_s":0.55,"mem_mb":13.2,"disk_size":"39M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.53,"mem_mb":13.1,"disk_size":"39M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":0.91,"mem_mb":14.5,"disk_size":"40.8M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.97,"mem_mb":14.5,"disk_size":"40.8M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":3.7,"import_time_s":0.8,"mem_mb":14.5,"disk_size":"41M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.76,"mem_mb":14.5,"disk_size":"41M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":0.79,"mem_mb":14.3,"disk_size":"32.6M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.83,"mem_mb":14.2,"disk_size":"32.6M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":3,"import_time_s":0.8,"mem_mb":14.3,"disk_size":"33M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.81,"mem_mb":14.2,"disk_size":"33M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":0.79,"mem_mb":15.2,"disk_size":"32.4M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.79,"mem_mb":15.1,"disk_size":"32.2M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":2.8,"import_time_s":0.79,"mem_mb":15.2,"disk_size":"33M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":1.29,"mem_mb":15.1,"disk_size":"33M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":null,"import_time_s":0.69,"mem_mb":12.8,"disk_size":"37.6M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.67,"mem_mb":12.9,"disk_size":"37.8M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":" $EXIT -eq 0 ","exit_code":0,"wheel_type":"wheel","failure_reason":null,"install_time_s":4,"import_time_s":0.65,"mem_mb":12.8,"disk_size":"38M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.56,"mem_mb":12.9,"disk_size":"38M"}]},"quickstart_checks":{"last_tested":"2026-04-24","tag":"verified","tag_description":"quickstart runs on critical runtimes, recently tested","results":[{"runtime":"python:3.10-alpine","exit_code":0},{"runtime":"python:3.10-slim","exit_code":0},{"runtime":"python:3.11-alpine","exit_code":0},{"runtime":"python:3.11-slim","exit_code":0},{"runtime":"python:3.12-alpine","exit_code":0},{"runtime":"python:3.12-slim","exit_code":0},{"runtime":"python:3.13-alpine","exit_code":0},{"runtime":"python:3.13-slim","exit_code":0},{"runtime":"python:3.9-alpine","exit_code":0},{"runtime":"python:3.9-slim","exit_code":0}]}}