51 lines
1.7 KiB
PHP
51 lines
1.7 KiB
PHP
|
<?php
|
||
|
Class WSgiant extends Zend_Soap_Client
|
||
|
{
|
||
|
protected $wsService = array();
|
||
|
protected $header;
|
||
|
|
||
|
function __construct($parametres)
|
||
|
{
|
||
|
$this->wsService = new Zend_Config_Ini(APPLICATION_PATH.'/configs/giantwebservice.ini');
|
||
|
|
||
|
if($parametres InstanceOF stdClass)
|
||
|
self::init($parametres);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* init
|
||
|
* @param unknown_type $parametres
|
||
|
*/
|
||
|
private function init($parametres)
|
||
|
{
|
||
|
parent::setOptions($this->wsService->options);
|
||
|
$options = array('features' => SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS,
|
||
|
'soapVersion' => SOAP_1_1,
|
||
|
'compression' => SOAP_COMPRESSION_ACCEPT);
|
||
|
parent::setOptions($options);
|
||
|
|
||
|
$giantHeader = new stdClass();
|
||
|
$giantHeader->ConsumerId = $this->wsService->header->ConsumerId;
|
||
|
|
||
|
$giantHeader->Provider = new stdClass();
|
||
|
$giantHeader->Provider->CountryCode = $parametres->CountryCode;
|
||
|
$giantHeader->Provider->ProviderId = $parametres->ProviderId;
|
||
|
$giantHeader->TimeStamp = time();
|
||
|
$giantHeader->TestIndication = $parametres->TestIndication;
|
||
|
|
||
|
$this->header = new SoapHeader($this->wsService->header->url,
|
||
|
$this->wsService->header->serviceName, $giantHeader);
|
||
|
parent::addSoapInputHeader($this->header, true);
|
||
|
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* getAllMethodesFromWsdl
|
||
|
* @param unknown_type $service
|
||
|
*/
|
||
|
public function getAllMethodesFromWsdl($service)
|
||
|
{
|
||
|
parent::setWsdl($this->wsService->$service->wsdl);
|
||
|
return ($this);
|
||
|
}
|
||
|
}
|