<?php
namespace OfficeBrain\Bundle\ShippingEstimatorBundle\ApiClient;

use OfficeBrain\Bundle\ApiClientBundle\ApiClient\AbstractSoapApiClient;

/**
 * @author OfficeBrain 4471 <info@officebrain.com>
 *
 * Description : Shipping Estimator Soap Api Client
 */
class ShippingEstimatorSoapClient extends AbstractSoapApiClient
{
    /**
     * @author Employee Id: 4471
     * Description : call loomis express Soap Api Client.
     *
     * @throws Exception
     * */
    public function doProcess() {        
        switch ($this->apiCallType) {
            case 'loomis_express_public_rate' :
            		$this->setSoapBaseUrl('loomis_soap_service_url');
                    $this->soapUrl = $this->getSoapParameter('loomis_express','soap_methods','get_public_rate','url');
                    $this->soapFunction = $this->getSoapParameter('loomis_express','soap_methods','get_public_rate','method');
                    $this->soapParameter = array(
                      "userId" => $this->getSoapParameter('loomis_express','soap_auth','svc','user'), 
                      "password" =>$this->getSoapParameter('loomis_express','soap_auth','svc','password'), 
                      "request"=>$this->getCallParameters(),                      
                    );
                    $this->setResponseTag('loomisPublicRateDetail');
                break;

            default:
                $this->setError('error', 'INVALID_API_CALL');
                return true;
        }

        $this->callApi();
    }
    public function getExplodedArray($explodeString,$delimiter)
    {
    	return explode($delimiter, $explodeString);
    }
}