{"id":6259,"library":"suds","title":"suds (community fork)","description":"Suds is a lightweight SOAP-based web service client for Python. This is a community fork of the `suds-jurko` fork, actively maintained to support modern Python versions (>=3.7). It provides an intuitive RPC-like interface to consume web services by objectifying WSDL-defined types without explicit class generation. The latest version is 1.2.0, released in August 2024, with a release cadence that has seen several updates in recent years.","status":"active","version":"1.2.0","language":"en","source_language":"en","source_url":"https://github.com/suds-community/suds","tags":["SOAP","client","web services","WSDL","xml"],"install":[{"cmd":"pip install suds","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"While `import suds.client` works, `from suds.client import Client` is the idiomatic and recommended way to access the primary client class.","wrong":"import suds.client; client = suds.client.Client(...)","symbol":"Client","correct":"from suds.client import Client"}],"quickstart":{"code":"import logging\nimport os\nfrom suds.client import Client\n\n# Configure logging to see SOAP requests/responses for debugging\nlogging.basicConfig(level=logging.INFO)\nlogging.getLogger('suds.client').setLevel(logging.DEBUG)\n\n# A public WSDL for temperature conversion\nwsdl_url = 'http://www.w3schools.com/xml/tempconvert.asmx?WSDL'\n\ntry:\n    # Create a Suds client\n    client = Client(wsdl_url)\n    print(f\"Connected to SOAP service at: {wsdl_url}\")\n    print(\"\\nAvailable service methods:\")\n    print(client)\n\n    # Invoke a method: FahrenheitToCelsius\n    fahrenheit_temp = 68.0\n    result = client.service.FahrenheitToCelsius(fahrenheit_temp)\n    print(f\"\\n{fahrenheit_temp}°F is {result}°C\")\n\n    # Invoke another method: CelsiusToFahrenheit\n    celsius_temp = 20.0\n    result = client.service.CelsiusToFahrenheit(celsius_temp)\n    print(f\"{celsius_temp}°C is {result}°F\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")\n    print(\"Ensure the WSDL URL is correct and reachable, and that the service is active.\")","lang":"python","description":"This quickstart demonstrates how to create a `suds` client, inspect available service methods, and invoke a simple SOAP operation using a publicly available temperature conversion WSDL. It also includes basic logging configuration essential for debugging SOAP interactions."},"warnings":[{"fix":"Ensure your project uses Python 3.7 or a newer version. Install using `pip install suds` to get the latest Python 3 compatible community fork.","message":"The `suds` project (version 1.x) is a community fork that explicitly supports Python 3.7+ only. Older versions of `suds` (0.4 and prior) were Python 2.x only. Trying to use this `suds` version with Python 2.x or an older Python 3.x interpreter (e.g., <3.7) will result in compatibility errors. Users migrating from the original `suds` or `suds-jurko` must ensure their Python environment is 3.7 or newer.","severity":"breaking","affected_versions":"<1.0.0 (Python 2.x only); <1.2.0 (Python <3.7 support dropped)"},{"fix":"Always use `client.factory.create('TypeName')` to instantiate complex types defined in the WSDL. This ensures `suds` correctly sets the `xsi:type` attribute in the SOAP request.","message":"When dealing with complex WSDL types that are subclasses or extensions of other types, directly passing a Python dictionary to represent these objects may cause issues. `suds` might not correctly infer the `xsi:type`, leading the server to reject the request (e.g., trying to instantiate an abstract base type instead of the concrete subclass).","severity":"gotcha","affected_versions":"All versions"},{"fix":"To enable detailed logging, configure Python's standard `logging` module. Set levels to `DEBUG` for `suds.client`, `suds.transport`, `suds.xsd.schema`, and `suds.wsdl` to see SOAP messages and other internal processes.","message":"By default, `suds` logging is not verbose. It's common to miss crucial debug information (like the actual SOAP request/response XML or HTTP headers) when troubleshooting issues with web service calls.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Review code that relies on optional attributes being implicitly present in instantiated objects. You may need to explicitly check for attribute existence or modify your handling of service object structures.","message":"Version 0.8.0 introduced a change where objects are no longer instantiated with empty optional attributes by default. This changes the behavior from previous versions where such attributes might have been present as empty lists or `None` without explicit definition.","severity":"breaking","affected_versions":">=0.8.0 (compared to <0.8.0)"},{"fix":"Use the `suds.xsd.doctor.ImportDoctor` to fix broken schema imports at runtime if you encounter `schema not found` or similar errors during client initialization. This allows you to patch WSDLs with missing or incorrect schema references. For example: `from suds.xsd.doctor import Import, ImportDoctor; imp = Import('http://schemas.xmlsoap.org/soap/encoding/'); doctor = ImportDoctor(imp); client = Client(wsdl_url, doctor=doctor)`.","message":"Many WSDLs or their imported schemas can be malformed or follow incorrect import rules, causing `suds` to fail during WSDL parsing or schema digestion. This is a common external factor leading to `suds` errors.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-14T00:00:00.000Z","next_check":"2026-07-13T00:00:00.000Z"}