Package DE_EPAGES::USPS::API::WebServices::Base::ServicesInterface
It manages operations from XMLrequest and XMLresponse modules, required operate with USPS Web Services
Functions
- callWebService
- constructor
- createCaller
- createRequest
- getCaller
- getErrorResponseDescriptionOrEmpty
- getErrorResponseHelpContextOrEmpty
- getErrorResponseHelpFileOrEmpty
- getErrorResponseNumberOrEmpty
- getErrorResponseSourceOrEmpty
- getRequest
- getRequestNodeContentOrError
- getResponse
- getResponseArrayNodesContentOrEmpty
- getResponseErrorNodeContentOrEmpty
- getResponseNodeContentOrEmpty
- getResponseNodeContentOrError
- getResponseNodesOrEmpty
- isErrorResponse
- isValidRequestOrError
- isValidResponse
- isValidResponseOrError
- requestToString
- responseToString
- setCaller
- setRequestNodeAttributeOrError
- setRequestNodeBooleanValueOrError
- setRequestNodeEnumValueOrError
callWebService
If request is well validated, it calls USPS web service and gets the answer.
Syntax |
$self->callWebService(); |
Input |
|
constructor
Creates a new Service Interface object .
Syntax |
$ServicesInterface = $self->constructor($ShippingFulfillmentMethod,$APItag,$RequestFilePath,$Client); |
Input |
|
Return |
|
createCaller
It creates and returns the Caller object.
Syntax |
$Caller = $self->createCaller(); |
Input |
|
Return |
|
createRequest
It creates and returns the XMLrequest object.
Syntax |
$XMLrequest = $self->createRequest(); |
Input |
|
Return |
|
getCaller
It returns the Caller object.
Syntax |
$Caller = $self->getCaller(); |
Return |
|
getErrorResponseDescriptionOrEmpty
It checks that the response is of APItag type, that the node name exists for the response and returns the content. It returns an empty string if no node can be found.
Syntax |
getErrorResponseDescriptionOrEmpty( ); |
Return |
|
getErrorResponseHelpContextOrEmpty
It checks that the response is of APItag type, that the node name exists for the response and returns the content. It returns an empty string if no node can be found.
Syntax |
getErrorResponseHelpContextOrEmpty( ); |
Return |
|
getErrorResponseHelpFileOrEmpty
It checks that the response is of APItag type, that the node name exists for the response and returns the content. It returns an empty string if no node can be found.
Syntax |
getErrorResponseHelpFileOrEmpty( ); |
Return |
|
getErrorResponseNumberOrEmpty
It checks that the response is of APItag type, that the node name exists for the response and returns the content. It returns an empty string if no node can be found.
Syntax |
getErrorResponseNumberOrEmpty( ); |
Return |
|
getErrorResponseSourceOrEmpty
It checks that the response is of APItag type, that the node name exists for the response and returns the content. It returns an empty string if no node can be found.
Syntax |
getErrorResponseSourceOrEmpty( ); |
Return |
|
getRequest
It returns the XMLrequest object.
Syntax |
$XMLrequest = $self->getRequest(); |
Return |
|
getRequestNodeContentOrError
It checks that the node name exists for the request and returns the content. It throws an error if no node can be found.
Syntax |
$nodeContent = $self->getRequestNodeContentOrError($nodeName); |
Input |
|
Return |
|
getResponse
It returns the XMLresponse object.
Syntax |
$XMLresponse = $self->getResponse(); |
Return |
|
getResponseArrayNodesContentOrEmpty
It checks that the response is of APItag type, that the node name exists for the response and returns the array content of all nodes with that node name. It returns an empty array if no node can be found.
Syntax |
@NodesContent = $self->getResponseArrayNodesContentOrEmpty($APItag, $nodeName); |
Input |
|
Return |
|
getResponseErrorNodeContentOrEmpty
It checks that the node name exists for the response and returns the content. It returns an empty string if no node can be found.
Syntax |
$nodeContent = $self->getResponseErrorNodeContentOrEmpty($nodeName); |
Input |
|
Return |
|
getResponseNodeContentOrEmpty
It checks that the response is of APItag type, that the node name exists for the response and returns the content. It returns an empty string if no node can be found.
Syntax |
$nodeContent = $self->getResponseNodeContentOrEmpty($APItag, $nodeName); |
Input |
|
Return |
|
getResponseNodeContentOrError
It checks that the response is of APItag type, that the node name exists for the response and returns the content. It throws an error if node can't be found.
Syntax |
$nodeContent = $self->getResponseNodeContentOrError($APItag, $nodeName); |
Input |
|
Return |
|
getResponseNodesOrEmpty
It checks that the response is of APItag type, that the node name exists for the response and returns an array including all nodes with that node name. It returns an empty array if no node can be found.
Syntax |
@Nodes = $self->getResponseNodesOrEmpty($APItag, $nodeName); |
Input |
|
Return |
|
isErrorResponse
It checks that the response is an error response.
Syntax |
$isError = $self->isErrorResponse(); |
Return |
|
isValidRequestOrError
It checks validity of the request based on documented (already known) requirements. It returns 1 (true) or throws an error.
Syntax |
$isValid = $self->isValidRequestOrError(); |
Return |
|
isValidResponse
It checks that the response is a valid API type response or not.
Syntax |
$isValid = $self->isValidResponse($APItag); |
Input |
|
Return |
|
isValidResponseOrError
It checks that the response is of API web service type. If it's not, it throws an error.
Syntax |
$isValid = $self->isValidResponseOrError($APItag); |
Input |
|
Return |
|
requestToString
It returns the request XML structure as a string.
Syntax |
$XML = $self->requestToString(); |
Return |
|
responseToString
It returns the response XML structure as a string.
Syntax |
$XML = $self->responseToString(); |
Return |
|
setCaller
It returns the Caller object.
Syntax |
$self->setCaller($Caller); |
Input |
|
setRequestNodeAttributeOrError
It sets the provided attribute value into the also provided attribute name for the specified XML node.
Syntax |
$self->setRequestNodeAttributeOrError($nodeName, $attributeName, $attributeValue); |
Input |
|
setRequestNodeBooleanValueOrError
It sets the boolean provided value ('true' or 'false') into the XML booleanAttribute structure of the web service object. It throws an error if booleanAttribute is not found or booleanValue is not defined or not valid.
Syntax |
$self->setRequestNodeBooleanValueOrError($booleanAttribute, $booleanValue); |
Input |
|
setRequestNodeEnumValueOrError
It sets the provided enumValue into the enumAttribute for the request XML structure of the web service object. It throws an error if enumAttribute is not found or enumValue is not defined or not valid.
Syntax |
$self->setRequestNodeEnumValueOrError($enumAttribute, $enumValue); |
Input |
|