Yahoo::Marketing::Service - a base class for Service modules
This module is a base class for various Service modules (CampaignService, AdGroupService, ForecastService, etc) to inherit from. It should not be used directly.
There are some methods common to all Services that are documented below.
See also perldoc Yahoo::Marketing::AccountService ...::AdGroupService ...::AdService ...::BasicReportService ...::BidInformationService ...::BudgetingService ...::CampaignService ...::ExcludedWordsService ...::ForecastService ...::KeywordResearchService ...::KeywordService ...::LocationService ...::MasterAccountService ...::UserManagementService
Please see the API docs at
for details about what methods are available from each of the Services.
No exported functions
Return all simple data type exceptions
Creates a new instance.
Get/set the username to be used for requests
Get/set the password to be used for requests
Get/set the license to be used for requests
Get/set the version to be used for requests
Get/set the URI to be used for requests.
Defaults to http://marketing.ews.yahooapis.com/V7
Get/set the master account to be used for requests
Get/set the account to be used for requests. Not all requests require an account. Any service that deals with Campaigns (or Ad Groups, Ads, or Keywords) requires account to be set.
If set to a true value, Yahoo::Marketing service objects will not die when a SOAP fault is encountered. Instead, $service->fault will be set to the ApiFault returned in the SOAP response.
Defaults to false.
Get/set the onBehalfOfUsername to be used for requests.
Get/set the onBehalfOfPassword to be used for requests.
If set to a true value, requests will use the WSSE headers for authentication. See http://schemas.xmlsoap.org/ws/2002/04/secext/
Defaults to true.
If set to a true value, LocationService will be used to determine the correct endpoint URL based on the account being used.
Defaults to true.
Allows the user to pass in a Cache::Cache object to be used for cacheing WSDL information and account locations.
Defaults to using Cache::FileCache
Set the amount of time WSDL information should be cached.
Defaults to 1 day.
Purges all expired items from the cache. See purge() documentation in perldoc Cache::Cache.
Clears all items from the cache. See clear() documentation in perldoc Cache::Cache.
After a request, this will be set to the name of the last command group used.
After a request, this will be set to the amount of quota associated with the last command group used.
Accesses the appropriate wsdl and parses it to determine how to serialize / deserialize requests and responses. Note that you must have set the endpoint.
If you do not call it, calling any soap method on the service will force it to be called.
Usage: ->parse_config( path => '/path/to/config.yml', section => 'some_section', # for example, 'sandbox' );
Defaults: path => 'yahoo-marketing.yml' # in current working directory section => 'default'
Attempts to parse the given config file, or yahoo-marketing.ysm in the current directory if no path is specified.
parse_config() returns $self, so you can do things like this:
my $service = Yahoo::Marketing::CampaignService->new->parse_config();
The default config section used is 'default'
Note that "default_account", "default_on_behalf_of_username", and "default_on_behalf_of_password" are not required. If present, they will be used to set "account", "on_behalf_of_username", and "on_behalf_of_password" *if* those values have not already been set.
See example config file in the EXAMPLES section of perldoc Yahoo::Marketing