suds-community

1.2.0 · active · verified Fri Apr 10

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

Install

Imports

Quickstart

Initialize a `Client` with a WSDL URL to interact with a SOAP web service. The `client.service` object exposes available methods directly, which can be inspected by printing the object itself. The `client.factory` can be used to create complex types if required by the service.

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}")

view raw JSON →