Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

fix: problem with function call soap #3 #4

Merged
merged 1 commit into from
Aug 31, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions src/Pixi/API/Soap/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,24 @@ public function __construct(?string $wsdl = null, ?array $options = null)
parent::__construct($wsdl, $options);

}

}

/**
* @param string $function_name
* @param array $arguments
* @return mixed|object|Result\ResultInterface|string
*/
public function __soapCall(
string $name, array $args,
?array $options = null,
$inputHeaders = null,
&$outputHeaders = null
): mixed
#[\ReturnTypeWillChange]
public function __call(string $function_name, array $arguments)
{
if (str_starts_with($name, 'pixi')) {
if (substr($function_name, 0, 4) == 'pixi') {

$vars = array();

$uri = $this->uri ?? '';
$uri = '';
if (isset($this->uri)) {
$uri = $this->uri;
}

if (isset($arguments[0]) and is_array($arguments[0]) and count($arguments[0]) > 0) {

Expand All @@ -109,7 +109,7 @@ public function __soapCall(
[
'http' => [
'header' => 'xapp: ' . Environment::getAppId() . "\r\n" .
'soapaction: "' . $uri . $name . '"' . "\r\n",
'soapaction: "' . $uri . $function_name . '"' . "\r\n",
],
]
);
Expand All @@ -118,15 +118,15 @@ public function __soapCall(

$this->content = $this->getResultObject();

$result = parent::__soapCall($name, $vars, $options, $inputHeaders, $outputHeaders);

$this->content->setResultSet($result);
$this->content->setResultSet(
parent::__call($function_name, $vars)
);

return $this->content;

}

return parent::__soapCall($name, $args, $options, $inputHeaders, $outputHeaders);
return parent::__call($function_name, $arguments);
}

/**
Expand Down