suds-community
suds-community is a lightweight SOAP-based web service client for Python, designed to provide an RPC-like interface to SOAP services and abstract away the complexities of WSDLs. It is a community-maintained fork of the 'suds-jurko' project, which itself originated from the unmaintained 'suds' library. The project is actively developed, with the current version being 1.2.0, released in August 2024.
Warnings
- breaking The `suds-community` package is a fork of `suds-jurko`, which itself forked the original `suds` library. Ensure you install `suds-community` as 'pip install suds-community' and import from `suds` (e.g., `from suds.client import Client`). Do not confuse it with the unmaintained original `suds` or `suds-jurko`, which may have Python 2 compatibility issues or different behaviors.
- gotcha When dealing with WSDLs that define multiple services or ports, `suds-community` will default to the first service and first port if not explicitly specified. This can lead to unexpected behavior if the desired service or port is not the default.
- deprecated Earlier versions of `suds` (prior to `suds-community` and even `suds-jurko` forks) had a known security vulnerability (CVE-2013-2217) related to the default cache location. `suds-community` has implemented a fix for this by using a separate temporary folder per process.
- gotcha Due to how `suds-community` is packaged and named versus the historical `suds` package, a `pip download suds` command might fail with a message like "has inconsistent name: expected 'suds', but metadata has 'suds-community'".
Install
-
pip install suds-community
Imports
- Client
from suds.client import Client
Quickstart
from suds.client import Client
# A public WSDL for a simple calculator service
# NOTE: This WSDL is an example, real-world services require valid endpoints and proper authentication
wsdl_url = 'http://www.dneonline.com/calculator.asmx?WSDL'
try:
client = Client(wsdl_url)
print(f"Connected to service: {client.service}")
print("Available methods:")
print(client.service)
# Example: Call the 'Add' method
result = client.service.Add(10, 5)
print(f"10 + 5 = {result}")
# Example: Call the 'Divide' method
result = client.service.Divide(10, 2)
print(f"10 / 2 = {result}")
except Exception as e:
print(f"An error occurred: {e}")