eBay::API::XML::BaseCall
eBay::API::XML::BaseCall inherits from the eBay::API::XML::BaseCallGen class
See the parent constructor for detailed docs about object instantiation
Use 'reset' method in cases when you want to reuse a Call instance
Executes the current API call
Arguments: 1 [O] - isPrettyPrint - if set then XML is pretty printed
Returns: string Method returning a textual representation of the request (request type, url, query string, header and content).
Returns the RequestDataType object,
Returnst the ResponseDataType object
Tells to a programmer whether a request has been submitted or not. This method is mainly used in Session in sequential mode.
Method returning a textual representation of the response
Arguments: 1 [O] - isPrettyPrint - if set then XML is pretty printed Returns: string
Method returning the raw XML reponse
Returns XML::Simple data structure for a given path. Path is defined as a reference to an array of node names, starting with the top level node and ending with lowest level node.
Path IS NOT an XPATH string!!!!
Path examples for VerifyAddItem call:
@path = ( 'Fees','Fee' ); # Returns fees as an XML::Simple data structure @path = ( 'Errors' ); # Returns Response errors as an XML::Simple # data structure @path = ( 'Errors-xxxx' ); # Will not find anything
Notice that root node is not being specified. The reason for that is that we XML::Simple is configured not to put root node into its data structure (that is a default behaviour for XML::Simple).
If path is not submitted return the whole XML::Simple data structure
Access: public Returns: true (1) if a response is a valid XML document or not. false (0) if a response is NOT a valid XML document or not. Note: It allows us to differentiate cases the following cases: a) Response is a valid XML with API errors b) Response is not a valid XML document at all or HTTP connection failed. Most likely it should not be used a lot.
If an API call return errors (API, HTTP connection or XML parsing errors) the application should stop normal processing and return a "system error" message to an application user. The only things that it makes sense to read from ResponseDataType objects are: errors and rawResponse (which in this case might not even be a valid XML document).
Return true if the API has errors.
Returns: a reference to an array of errors (it can retu This method overrides BaseCallGen::getErrors method, while _getResponseErrors is basically the same method that exists in BaseCallGen
Return a reference to an array of warnings
Returns: reference to an array
Array contains all errors returned by API call, regardless of SeverityCode Includes both SeverityCodes: 'Error' and 'Warning'
Arguments: [0] [R] - errorCode
Returns: 1 - if an error with the given error code is found 0 - if no error with the given error code is returned
my $boolean = $self->hasError( '304' );
Returns the officaial eBay time.
2008-07-03T23:46:36.234Z
Method for setting some raw xml content to be used for the request.
my $call = new eBay::API::XML::Call::FetchToken( site_id => 0, proxy => __API_URL__, dev_id => __DEVELOPER_ID__, app_id => __APPLICATION_ID__, cert_id => __CERT_ID__, user_auth_token => __AUTH_TOKEN__, ); $call->setRequestRawXml('<?xml version="1.0" encoding="UTF-8"?> <FetchTokenRequest xmlns="urn:ebay:apis:eBLBaseComponents"> <SecretID> R2n6MQr@LDMAABeDFY8.1025449191.1198127665.563330 </SecretID> <RequesterCredentials><Username>__USERNAME__</Username> </RequesterCredentials> </FetchTokenRequest>' ); $call->execute(); print $call->getResponseRawXml();
Method returning the raw XML request content
This method is used to force a given error when a call is being executed. If the forced error is set, then that error is being returned by the call without executing the call (sending request to the API Server and receiving the response.
This method is used for test purposes when a programmer wants to test how the application handles an API error.
Arguments: This method uses named argument calling style that looks like this:
$self->forceError ( sErrorCode => '1025', sShortMsg => 'Test API error', ... ); Required arguments 1 - sErrorCode - API error code 2 - sShortMsg - short error message 3 - sLongMsg - long error message Optional arguments 4 - sSeverityCode - severity code default severity code: eBay::API::XML::DataType::Enum::SeverityCodeType::Error 5 - sErrorClassificationCode - error classification code default error classification code eBay::API::XML::DataType::Enum::ErrorClassificationCodeType::SystemError
Example:
$call->forceError ( 'sErrorCode' => '1025' ,'sShortMsg' => 'Test error short message' ,'sLongMsg' => 'Test error long message' );
Method resonsible for process the http response when it arrives.
Methods that HAVE TO BE IMPLEMENTED IN each specific API CALL
An abstract method - it has to be implemented in a class extending BaseCall class
To install eBay::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm eBay::API
CPAN shell
perl -MCPAN -e shell install eBay::API
For more information on module installation, please visit the detailed CPAN module installation guide.