Package suds :: Module client :: Class PortSelector
[hide private]
[frames] | no frames]

Class PortSelector

source code

The port selector is used to select a web service port. In cases where multiple ports have been defined and no default has been specified, the port is found by name (or index) and a MethodSelector for the port is returned. In all cases, attribute access is forwarded to the MethodSelector for either the first port or the default port (when specified).

Instance Methods [hide private]
 
__init__(self, client, ports, qn) source code
MethodSelector.
__getattr__(self, name)
Request to access an attribute is forwarded to the MethodSelector for either the first port or the default port (when specified).
source code
MethodSelector.
__getitem__(self, name)
Provides selection of the port by name (string) or index (integer).
source code
MethodSelector.
__find(self, name)
Find a port by name (string) or index (integer).
source code
MethodSelector.
__dp(self)
Get the default port if defined in the options.
source code
Instance Variables [hide private]
Client __client
A suds client.
list __ports
A list of service ports.
str __qn
The qualified name of the port (used for logging).
Method Details [hide private]

__init__(self, client, ports, qn)
(Constructor)

source code 
Parameters:
  • client (Client) - A suds client.
  • ports (list) - A list of service ports.
  • qn (str) - The name of the service.

__getattr__(self, name)
(Qualification operator)

source code 

Request to access an attribute is forwarded to the MethodSelector for either the first port or the default port (when specified).

Parameters:
  • name (str) - The name of a method.
Returns: MethodSelector.
A MethodSelector.

__getitem__(self, name)
(Indexing operator)

source code 

Provides selection of the port by name (string) or index (integer). In cases where only (1) port is defined or a default has been specified, the request is forwarded to the MethodSelector.

Parameters:
  • name ((int|str)) - The name (or index) of a port.
Returns: MethodSelector.
A MethodSelector for the specified port.

__find(self, name)

source code 

Find a port by name (string) or index (integer).

Parameters:
  • name ((int|str)) - The name (or index) of a port.
Returns: MethodSelector.
A MethodSelector for the found port.

__dp(self)

source code 

Get the default port if defined in the options.

Returns: MethodSelector.
A MethodSelector for the default port.