ePages 6.17.13 - DE_EPAGES/Envialia/API/SOAP/RemoteEnvialia.pm

Package DE_EPAGES::Envialia::API::SOAP::RemoteEnvialia

Functions

HTTPSOAPTransport
UserAgent
buildTrackingLink
cleanEnvialiaRequest
reportError
serviceCall

HTTPSOAPTransport

a Transport agent configured for Envialia communication

Syntax
HTTPSOAPTransport( $service_url, $verify_hostname );
Input
$service_url (boolean)
Return
$transport (CODEREF)
Envialia HTTP SOAP transport agent

UserAgent

a user agent configured for Envialia communication

Syntax
UserAgent( $verify_hostname );
Input
$verify_hostname (boolean)
When TRUE LWP will for secure protocol schemes ensure
it connects to servers that have a valid certificate matching the expected
hostname. If FALSE no checks are made and you can't be sure
that you communicate with the expected peer. Default value TRUE
Return
$UserAgent (LWP::UserAgent)
a user agent configured for Envialia SOAP

buildTrackingLink

It generates the correct tracking URL path from Envialia provided information (tracking URL format is returned by Envialia Web services )

Syntax
$self->buildTrackingLink($answer->{'parameters'}->{'strGuidOut'}, $pickupDate);
Input
$id (string)
Envialia tracking ID number
$date (date)
current date
Return
$trackingLink (string)
Envialia formed tracking link

cleanEnvialiaRequest

It checks $Envialia_request hash items and assigns blanck string values to undefined items. This is necessary because Envialia web service calls fail if undefined values are found.

Syntax
$self->cleanEnvialiaRequest($Envialia_request);
Input
$Envialia_request (hash)
Envialia request hash structure with possible undefined
values
Return
$Envialia_request (hash)
Cleaned Envialia request hash structure

reportError

It checks if Envialia web service answer was correct or not by returning a boolean value. Also, it logs appropriate information about the success or failure to the communications.log (if the reporting is activated).

Syntax
$self->reportError($answer, $trace);
Input
$asnwer (object)
Envialia web service request answer
$trace (object)
WSDL web service request error trace
$genericError (boolean)
provide generic error message or got from Envialia
Return
$Envialia_request (hash)
Cleaned Envialia request hash structure

serviceCall

Entry point for calling Envialia web services

Syntax
($answer, $trace) = $self->serviceCall( $service_method, $WSDL_Path_File, $request_parameters );
Input
$service_method (string)
Envialia service method
$wsdlPath (string)
Envialia WSDL configuration file path
$params (hash)
Envialia XML request parameters
Return
@call_result_array (Array)
Array with the resturned XML request answer and a
trace structure if XML call was wrong