from suds.client import Client # create a client for the SOAP-based web service url = 'http://www.example.com/soap-service' client = Client(url) # call a method exposed by the web service result = client.service.method_name(param1, param2, ...)
from suds.client import Client from suds.wsse import Security, UsernameToken # create a client for the SOAP-based web service url = 'http://www.example.com/soap-service' client = Client(url) # add authentication to the client security = Security() token = UsernameToken('username', 'password') security.tokens.append(token) client.set_options(wsse=security) # call a method exposed by the web service result = client.service.method_name(param1, param2, ...)In this example, we create a client for a SOAP-based web service located at the URL http://www.example.com/soap-service. The web service requires authentication, so we add authentication information to the client using the suds.wsse.Security and suds.wsse.UsernameToken classes. We then call a method exposed by the web service using the client object. Package library: suds