/** * Dumps data of the last request. * * @param SoapClient $client */ public function dumpLastRequest(SoapClient $client) { $requestId = $client->getRequestId(); if (!empty($requestId)) { $this->dump($requestId, $client->getLastRequest(), $client->getLastResponse()); } }
/** * Constructor. * * @param string $wsdl URI of the WSDL file * @param EventDispatcherInterface $dispatcher The event dispatcher * @param User $user The profile * @param array $options The options */ public function __construct($wsdl, EventDispatcherInterface $dispatcher, User $user, array $options = array()) { $defaults = array('soap_version' => SOAP_1_1, 'encoding' => 'UTF-8', 'trace' => true, 'exception' => true, 'cache_wsdl' => WSDL_CACHE_BOTH, 'features' => SOAP_SINGLE_ELEMENT_ARRAYS); parent::__construct($wsdl, $options + $user->getSoapOptions() + $defaults); $this->dispatcher = $dispatcher; $this->user = $user; }
/** * {@inheritdoc} * * @internal */ public function __soapCall($methodName, $arguments, $options = null, $inputHeaders = null, &$outputHeaders = null) { if ($this->isFinancialMethod($methodName, $arguments)) { $usedMethod = $methodName; if ($methodName === 'AccountManagement') { $usedMethod = $arguments[0]->getAction(); } $operationNum = time(); $financeToken = $this->user->createFinanceToken($usedMethod, $operationNum); if (!is_array($inputHeaders)) { $inputHeaders = array(); } $inputHeaders[] = new \SoapHeader('API', 'finance_token', $financeToken); $inputHeaders[] = new \SoapHeader('API', 'operation_num', $operationNum); } return parent::__soapCall($methodName, $arguments, $options, $inputHeaders, $outputHeaders); }
public function __construct($wsdl, EventDispatcherInterface $dispatcher, User $user, array $options = array()) { $options['stream_context'] = stream_context_create(array('http' => array('header' => $this->createHttpHeaders($user)))); parent::__construct($wsdl, $dispatcher, $user, $options); }