Package fedex :: Module base_service :: Class FedexBaseService
[hide private]
[frames] | no frames]

Class FedexBaseService

source code


This class is the master class for all Fedex request objects. It gets all of the common SOAP objects created via suds and populates them with values from a FedexConfig object, along with keyword arguments via __init__.


Note: This object should never be used directly, use one of the included sub-classes.

Instance Methods [hide private]
 
__init__(self, config_obj, wsdl_name, *args, **kwargs)
This constructor should only be called by children of the class.
source code
 
__set_web_authentication_detail(self)
Sets up the WebAuthenticationDetail node.
source code
 
__set_client_detail(self)
Sets up the ClientDetail node, which is required for all shipping related requests.
source code
 
__set_transaction_detail(self, *args, **kwargs)
Checks kwargs for 'customer_transaction_id' and sets it if present.
source code
 
__set_version_id(self)
Pulles the versioning info for the request from the child request.
source code
 
__prepare_wsdl_objects(self)
This method should be over-ridden on each sub-class.
source code
 
__check_response_for_fedex_error(self)
This checks the response for general Fedex errors that aren't related to any one WSDL.
source code
 
_check_response_for_request_errors(self)
Override this in each service module to check for errors that are specific to that module.
source code
 
create_wsdl_object_of_type(self, type_name)
Creates and returns a WSDL object of the specified type.
source code
 
send_request(self, send_function=None)
Sends the assembled request on the child object.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables [hide private]
  logger
Python logger instance with name 'fedex'.
  config_obj
The FedexConfig object to pull auth info from.
  VersionId
Holds details on the version numbers of the WSDL.
  WebAuthenticationDetail
WSDL object that holds authentication info.
  ClientDetail
WSDL object that holds client account details.
  response
The response from Fedex.
  TransactionDetail
Holds customer-specified transaction IDs.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, config_obj, wsdl_name, *args, **kwargs)
(Constructor)

source code 

This constructor should only be called by children of the class. As is such, only the optional keyword arguments caught by **kwargs will be documented.

Parameters:
  • customer_transaction_id (str) - A user-specified identifier to differentiate this transaction from others. This value will be returned with the response from Fedex.
Overrides: object.__init__

__set_web_authentication_detail(self)

source code 

Sets up the WebAuthenticationDetail node. This is required for all requests.

__prepare_wsdl_objects(self)

source code 

This method should be over-ridden on each sub-class. It instantiates any of the required WSDL objects so the user can just print their __str__() methods and see what they need to fill in.

_check_response_for_request_errors(self)

source code 

Override this in each service module to check for errors that are specific to that module. For example, invalid tracking numbers in a Tracking request.

send_request(self, send_function=None)

source code 

Sends the assembled request on the child object.

Parameters:
  • send_function (function reference) - A function reference (passed without the parenthesis) to a function that will send the request. This allows for overriding the default function in cases such as validation requests.

Instance Variable Details [hide private]

response

The response from Fedex. You will want to pick what you want out here here. This object does have a __str__() method, you'll want to print or log it to see what possible values you can pull.