eBay::API::XML::BaseCall

eBay::API::XML::BaseCall is a library intended to provide a Perl based interface for the public eBay web services API.
Download

eBay::API::XML::BaseCall Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Jeff Nokes
  • Publisher web site:
  • http://search.cpan.org/~ebay/eBay-API-0.22/lib/eBay/API/XML/BaseDataType.pm

eBay::API::XML::BaseCall Tags


eBay::API::XML::BaseCall Description

eBay::API::XML::BaseCall is a library intended to provide a Perl based interface for the public eBay web services API. eBay::API::XML::BaseCall is a library intended to provide a Perl based interface for the public eBay web services API.Subroutines:new()reset()Description: Use 'reset' method in cases when you want to reuse a Call instanceexecute()_getHttpRequestObject()getHttpRequestAsString()Arguments: 1 - isPrettyPrint - if set then XML is pretty printedReturns: string Method returning a textual representation of the request (request type, url, query string, header and content)._getRequestHeader()getRequestDataType()getResponseDataType()_setHttpResponseObject()_getHttpResponseObject()isHttpRequestSubmitted()Tells to a programmer whether a request has been submitted or not. This method is mainly used in Session in sequential mode.getHttpResponseAsString()getResponseRawXml()_setXmlSimpleDataStructure()Keep XML::Simple data structure after parsing the response XMLgetXmlSimpleDataStructure()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 anythingNotice 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_setResponseValidXml()Access: private Sets whether a response is a valid XML document or not.isResponseValidXml()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.hasErrors()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).hasWarnings()getErrors()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 BaseCallGengetWarnings()_hasErrorsForSeverityCode()_getErrorsForSeverityCode()getErrorsAndWarnings()Returns: reference to an array Array contains all errors returned by API call, regardless of SeverityCode Includes both SeverityCodes: 'Error' and 'Warning'hasError()Arguments: - errorCodeReturns: 1 - if an error with the given error code is found 0 - if no error with the given error code is returnedgetResponsErrors()getEBayOfficialTime()_prettyPrintFormat()Arguments: 1 pHttpR - either an HTTP::Request or HTTP:Response object Description: Formats HTTP::Request/HTTP::Response as a string. Includes: header and content. XML content is pretty printed.setRequestRawXml()getRequestRawXml()_initRequest()_initResponse()forceError()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::SystemErrorExample: $call->forceError ( 'sErrorCode' => '1025' ,'sShortMsg' => 'Test error short message' ,'sLongMsg' => 'Test error long message' );Description: 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.getApiCallName()An abstract method - it has to be implemented in a class extending BaseCall classgetRequestDataTypeFullPackage()An abstract method - it has to be implemented in a class extending BaseCall classgetResponseDataTypeFullPackage()An abstract method - it has to be implemented in a class extending BaseCall classprocessResponse()# RESPONSE_handleNoResponseContent()_handleApiBadGataway()_handleResposeParsedButStructureEmpty()_addHTTP_XMLParse_Error()_populateHTTP_XMLParse_Error()_handleIfItIsOldStyle() Requirements: · Perl


eBay::API::XML::BaseCall Related Software