Skip to content
Open
Show file tree
Hide file tree
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
363 changes: 182 additions & 181 deletions src/Artisaninweb/SoapWrapper/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,186 +6,187 @@

class Client extends SoapClient
{
/**
* @var string
*/
protected $wsdl;

/**
* Client constructor.
*
* @param string $wsdl
* @param array $options
* @param array $headers
*/
public function __construct($wsdl, $options, array $headers = [])
{
parent::SoapClient($wsdl, $options);

if (!empty($headers)) {
$this->headers($headers);
/**
* @var string
*/
protected $wsdl;

/**
* Client constructor.
*
* @param string $wsdl
* @param array $options
* @param array $headers
*/
public function __construct($wsdl, $options, array $headers = [])
{
parent::SoapClient($wsdl, $options);

if (!empty($headers)) {
$this->headers($headers);
}
}

/**
* Get all functions from the service
*
* @return mixed
*/
public function getFunctions()
{
return $this->__getFunctions();
}

/**
* Get the last request
*
* @return mixed
*/
public function getLastRequest()
{
return $this->__getLastRequest();
}

/**
* Get the last response
*
* @return mixed
*/
public function getLastResponse()
{
return $this->__getLastResponse();
}

/**
* Get the last request headers
*
* @return mixed
*/
public function getLastRequestHeaders()
{
return $this->__getLastRequestHeaders();
}

/**
* Get the last response headers
*
* @return mixed
*/
public function getLastResponseHeaders()
{
return $this->__getLastResponseHeaders();
}

/**
* Get the types
*
* @return mixed
*/
public function getTypes()
{
return $this->__getTypes();
}

/**
* Get all the set cookies
*
* @return mixed
*/
public function getCookies()
{
return $this->__getCookies();
}

/**
* Set a new cookie
*
* @param string $name
* @param string $value
*
* @return $this
*/
public function cookie($name, $value)
{
$this->__setCookie($name, $value);

return $this;
}

/**
* Set the location
*
* @param string $location
*
* @return $this
*/
public function location($location = '')
{
$this->__setLocation($location);

return $this;
}

/**
* Set the Soap headers
*
* @param array $headers
*
* @return $this
*/
protected function headers(array $headers = [])
{
$this->__setSoapHeaders($headers);

return $this;
}

/**
* Do soap request
*
* @param string $request
* @param string $location
* @param string $action
* @param string $version
* @param string $one_way
*
* @return mixed
*/
public function doRequest($request, $location, $action, $version, $one_way)
{
return $this->__doRequest($request, $location, $action, $version, $one_way);
}

/**
* Do a soap call on the webservice client
*
* @param string $function
* @param array $params
*
* @return mixed
*/
public function call($function, $params)
{
return call_user_func_array([$this, $function], $params);
}

/**
* Allias to do a soap call on the webservice client
*
* @param string $function
* @param array $params
* @param array $options
* @param null $inputHeader
* @param null $outputHeaders
*
* @return mixed
*/
public function SoapCall(
$function,
array $params,
array $options = null,
$inputHeader = null,
&$outputHeaders = null
) {
return $this->__soapCall($function, $params, $options, $inputHeader, $outputHeaders);
}
}

/**
* Get all functions from the service
*
* @return mixed
*/
public function getFunctions()
{
return $this->__getFunctions();
}

/**
* Get the last request
*
* @return mixed
*/
public function getLastRequest()
{
return $this->__getLastRequest();
}

/**
* Get the last response
*
* @return mixed
*/
public function getLastResponse()
{
return $this->__getLastResponse();
}

/**
* Get the last request headers
*
* @return mixed
*/
public function getLastRequestHeaders()
{
return $this->__getLastRequestHeaders();
}

/**
* Get the last response headers
*
* @return mixed
*/
public function getLastResponseHeaders()
{
return $this->__getLastResponseHeaders();
}

/**
* Get the types
*
* @return mixed
*/
public function getTypes()
{
return $this->__getTypes();
}

/**
* Get all the set cookies
*
* @return mixed
*/
public function getCookies()
{
return $this->__getCookies();
}

/**
* Set a new cookie
*
* @param string $name
* @param string $value
*
* @return $this
*/
public function cookie($name, $value)
{
$this->__setCookie($name, $value);

return $this;
}

/**
* Set the location
*
* @param string $location
*
* @return $this
*/
public function location($location = '')
{
$this->__setLocation($location);

return $this;
}

/**
* Set the Soap headers
*
* @param array $headers
*
* @return $this
*/
protected function headers(array $headers = [])
{
$this->__setSoapHeaders($headers);

return $this;
}

/**
* Do soap request
*
* @param string $request
* @param string $location
* @param string $action
* @param string $version
* @param string $one_way
*
* @return mixed
*/
public function doRequest($request, $location, $action, $version, $one_way)
{
return $this->__doRequest($request, $location, $action, $version, $one_way);
}

/**
* Do a soap call on the webservice client
*
* @param string $function
* @param array $params
*
* @return mixed
*/
public function call($function, $params)
{
return call_user_func_array([$this, $function], $params);
}

/**
* Allias to do a soap call on the webservice client
*
* @param string $function
* @param array $params
* @param array $options
* @param null $inputHeader
* @param null $outputHeaders
*
* @return mixed
*/
public function SoapCall($function,
array $params,
array $options = null,
$inputHeader = null,
&$outputHeaders = null
) {
return $this->__soapCall($function, $params, $options, $inputHeader, $outputHeaders);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

class ServiceAlreadyExists extends Exception
{
//
//
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

class ServiceMethodNotExists extends Exception
{
//
//
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@

class ServiceNotFound extends Exception
{
//
//
}
Loading