CS fixes
This commit is contained in:
parent
8a886c7eda
commit
2e155db8f9
|
@ -50,8 +50,8 @@ class Curl
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param array $options
|
* @param array $options Options array from SoapClient constructor
|
||||||
* @param int $followLocationMaxRedirects
|
* @param int $followLocationMaxRedirects Redirection limit for Location header
|
||||||
*/
|
*/
|
||||||
public function __construct(array $options = array(), $followLocationMaxRedirects = 10)
|
public function __construct(array $options = array(), $followLocationMaxRedirects = 10)
|
||||||
{
|
{
|
||||||
|
@ -109,9 +109,10 @@ class Curl
|
||||||
* Execute HTTP request.
|
* Execute HTTP request.
|
||||||
* Returns true if request was successfull.
|
* Returns true if request was successfull.
|
||||||
*
|
*
|
||||||
* @param string $location
|
* @param string $location HTTP location
|
||||||
* @param string $request
|
* @param string $request Request body
|
||||||
* @param array $requestHeaders
|
* @param array $requestHeaders Request header strings
|
||||||
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function exec($location, $request = null, $requestHeaders = array())
|
public function exec($location, $request = null, $requestHeaders = array())
|
||||||
|
@ -136,9 +137,8 @@ class Curl
|
||||||
* Custom curl_exec wrapper that allows to follow redirects when specific
|
* Custom curl_exec wrapper that allows to follow redirects when specific
|
||||||
* http response code is set. SOAP only allows 307.
|
* http response code is set. SOAP only allows 307.
|
||||||
*
|
*
|
||||||
* @param resource $ch
|
* @param int $redirects Current redirection count
|
||||||
* @param int $maxRedirects
|
*
|
||||||
* @param int $redirects
|
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
private function execManualRedirect($redirects = 0)
|
private function execManualRedirect($redirects = 0)
|
||||||
|
@ -186,7 +186,7 @@ class Curl
|
||||||
*
|
*
|
||||||
* http://curl.haxx.se/libcurl/c/libcurl-errors.html
|
* http://curl.haxx.se/libcurl/c/libcurl-errors.html
|
||||||
*
|
*
|
||||||
* @var array(int=>string)
|
* @return array(int=>string)
|
||||||
*/
|
*/
|
||||||
protected function getErrorCodeMapping()
|
protected function getErrorCodeMapping()
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,7 +36,7 @@ class FilterHelper
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param \DOMDocument $domDocument
|
* @param \DOMDocument $domDocument SOAP document
|
||||||
*/
|
*/
|
||||||
public function __construct(\DOMDocument $domDocument)
|
public function __construct(\DOMDocument $domDocument)
|
||||||
{
|
{
|
||||||
|
@ -46,10 +46,11 @@ class FilterHelper
|
||||||
/**
|
/**
|
||||||
* Add new soap header.
|
* Add new soap header.
|
||||||
*
|
*
|
||||||
* @param \DOMElement $node
|
* @param \DOMElement $node DOMElement to add
|
||||||
* @param boolean $mustUnderstand
|
* @param boolean $mustUnderstand SOAP header mustUnderstand attribute
|
||||||
* @param string $actor
|
* @param string $actor SOAP actor/role
|
||||||
* @param string $soapVersion
|
* @param string $soapVersion SOAP version SOAP_1_1|SOAP_1_2
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addHeaderElement(\DOMElement $node, $mustUnderstand = null, $actor = null, $soapVersion = SOAP_1_1)
|
public function addHeaderElement(\DOMElement $node, $mustUnderstand = null, $actor = null, $soapVersion = SOAP_1_1)
|
||||||
|
@ -58,7 +59,7 @@ class FilterHelper
|
||||||
$namespace = $root->namespaceURI;
|
$namespace = $root->namespaceURI;
|
||||||
$prefix = $root->prefix;
|
$prefix = $root->prefix;
|
||||||
if (null !== $mustUnderstand) {
|
if (null !== $mustUnderstand) {
|
||||||
$node->appendChild(new \DOMAttr($prefix . ':mustUnderstand', (int)$mustUnderstand));
|
$node->appendChild(new \DOMAttr($prefix . ':mustUnderstand', (int) $mustUnderstand));
|
||||||
}
|
}
|
||||||
if (null !== $actor) {
|
if (null !== $actor) {
|
||||||
$attributeName = ($soapVersion == SOAP_1_1) ? 'actor' : 'role';
|
$attributeName = ($soapVersion == SOAP_1_1) ? 'actor' : 'role';
|
||||||
|
@ -86,7 +87,8 @@ class FilterHelper
|
||||||
/**
|
/**
|
||||||
* Add new soap body element.
|
* Add new soap body element.
|
||||||
*
|
*
|
||||||
* @param \DOMElement $node
|
* @param \DOMElement $node DOMElement to add
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addBodyElement(\DOMElement $node)
|
public function addBodyElement(\DOMElement $node)
|
||||||
|
@ -109,8 +111,9 @@ class FilterHelper
|
||||||
/**
|
/**
|
||||||
* Add new namespace to root tag.
|
* Add new namespace to root tag.
|
||||||
*
|
*
|
||||||
* @param string $prefix
|
* @param string $prefix Namespace prefix
|
||||||
* @param string $namespaceURI
|
* @param string $namespaceURI Namespace URI
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addNamespace($prefix, $namespaceURI)
|
public function addNamespace($prefix, $namespaceURI)
|
||||||
|
@ -125,9 +128,10 @@ class FilterHelper
|
||||||
/**
|
/**
|
||||||
* Create new element for given namespace.
|
* Create new element for given namespace.
|
||||||
*
|
*
|
||||||
* @param string $namespaceURI
|
* @param string $namespaceURI Namespace URI
|
||||||
* @param string $name
|
* @param string $name Element name
|
||||||
* @param string $value
|
* @param string $value Element value
|
||||||
|
*
|
||||||
* @return \DOMElement
|
* @return \DOMElement
|
||||||
*/
|
*/
|
||||||
public function createElement($namespaceURI, $name, $value = null)
|
public function createElement($namespaceURI, $name, $value = null)
|
||||||
|
@ -140,13 +144,14 @@ class FilterHelper
|
||||||
/**
|
/**
|
||||||
* Add new attribute to element with given namespace.
|
* Add new attribute to element with given namespace.
|
||||||
*
|
*
|
||||||
* @param \DOMElement $element
|
* @param \DOMElement $element DOMElement to edit
|
||||||
* @param string $namespaceURI
|
* @param string $namespaceURI Namespace URI
|
||||||
* @param string $name
|
* @param string $name Attribute name
|
||||||
* @param string $value
|
* @param string $value Attribute value
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setAttribute(\DOMElement $element, $namespaceURI = null, $name, $value)
|
public function setAttribute(\DOMElement $element, $namespaceURI, $name, $value)
|
||||||
{
|
{
|
||||||
if (null !== $namespaceURI) {
|
if (null !== $namespaceURI) {
|
||||||
$prefix = $this->namespaces[$namespaceURI];
|
$prefix = $this->namespaces[$namespaceURI];
|
||||||
|
@ -159,8 +164,9 @@ class FilterHelper
|
||||||
/**
|
/**
|
||||||
* Register namespace.
|
* Register namespace.
|
||||||
*
|
*
|
||||||
* @param string $prefix
|
* @param string $prefix Namespace prefix
|
||||||
* @param string $namespaceURI
|
* @param string $namespaceURI Namespace URI
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function registerNamespace($prefix, $namespaceURI)
|
public function registerNamespace($prefix, $namespaceURI)
|
||||||
|
|
|
@ -113,7 +113,8 @@ class SoapClient extends \SoapClient
|
||||||
/**
|
/**
|
||||||
* Perform HTTP request with cURL.
|
* Perform HTTP request with cURL.
|
||||||
*
|
*
|
||||||
* @param SoapRequest $soapRequest
|
* @param SoapRequest $soapRequest SoapRequest object
|
||||||
|
*
|
||||||
* @return SoapResponse
|
* @return SoapResponse
|
||||||
*/
|
*/
|
||||||
private function __doHttpRequest(SoapRequest $soapRequest)
|
private function __doHttpRequest(SoapRequest $soapRequest)
|
||||||
|
@ -126,7 +127,7 @@ class SoapClient extends \SoapClient
|
||||||
// execute HTTP request with cURL
|
// execute HTTP request with cURL
|
||||||
$responseSuccessfull = $this->curl->exec($soapRequest->getLocation(),
|
$responseSuccessfull = $this->curl->exec($soapRequest->getLocation(),
|
||||||
$soapRequest->getContent(),
|
$soapRequest->getContent(),
|
||||||
$headers);
|
$headers);
|
||||||
// tracing enabled: store last request header and body
|
// tracing enabled: store last request header and body
|
||||||
if ($this->tracingEnabled === true) {
|
if ($this->tracingEnabled === true) {
|
||||||
$this->lastRequestHeaders = $this->curl->getRequestHeaders();
|
$this->lastRequestHeaders = $this->curl->getRequestHeaders();
|
||||||
|
@ -136,7 +137,7 @@ class SoapClient extends \SoapClient
|
||||||
if ($responseSuccessfull === false) {
|
if ($responseSuccessfull === false) {
|
||||||
// get error message from curl
|
// get error message from curl
|
||||||
$faultstring = $this->curl->getErrorMessage();
|
$faultstring = $this->curl->getErrorMessage();
|
||||||
throw new \SoapFault( 'HTTP', $faultstring );
|
throw new \SoapFault('HTTP', $faultstring);
|
||||||
}
|
}
|
||||||
// tracing enabled: store last response header and body
|
// tracing enabled: store last response header and body
|
||||||
if ($this->tracingEnabled === true) {
|
if ($this->tracingEnabled === true) {
|
||||||
|
@ -144,24 +145,27 @@ class SoapClient extends \SoapClient
|
||||||
$this->lastResponse = $this->curl->getResponseBody();
|
$this->lastResponse = $this->curl->getResponseBody();
|
||||||
}
|
}
|
||||||
// wrap response data in SoapResponse object
|
// wrap response data in SoapResponse object
|
||||||
$soapResponse = SoapResponse::create($this->curl->getResponseBody(),
|
$soapResponse = SoapResponse::create(
|
||||||
|
$this->curl->getResponseBody(),
|
||||||
$soapRequest->getLocation(),
|
$soapRequest->getLocation(),
|
||||||
$soapRequest->getAction(),
|
$soapRequest->getAction(),
|
||||||
$soapRequest->getVersion(),
|
$soapRequest->getVersion(),
|
||||||
$this->curl->getResponseContentType());
|
$this->curl->getResponseContentType()
|
||||||
|
);
|
||||||
|
|
||||||
return $soapResponse;
|
return $soapResponse;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Custom request method to be able to modify the SOAP messages.
|
* Custom request method to be able to modify the SOAP messages.
|
||||||
* $oneWay parameter is not used at the moment.
|
* $oneWay parameter is not used at the moment.
|
||||||
*
|
*
|
||||||
* @param string $request
|
* @param string $request Request string
|
||||||
* @param string $location
|
* @param string $location Location
|
||||||
* @param string $action
|
* @param string $action SOAP action
|
||||||
* @param int $version
|
* @param int $version SOAP version
|
||||||
* @param int $oneWay 0|1
|
* @param int $oneWay 0|1
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function __doRequest($request, $location, $action, $version, $oneWay = 0)
|
public function __doRequest($request, $location, $action, $version, $oneWay = 0)
|
||||||
|
@ -180,7 +184,8 @@ class SoapClient extends \SoapClient
|
||||||
* Runs the currently registered request filters on the request, performs
|
* Runs the currently registered request filters on the request, performs
|
||||||
* the HTTP request and runs the response filters.
|
* the HTTP request and runs the response filters.
|
||||||
*
|
*
|
||||||
* @param SoapRequest $soapRequest
|
* @param SoapRequest $soapRequest SOAP request object
|
||||||
|
*
|
||||||
* @return SoapResponse
|
* @return SoapResponse
|
||||||
*/
|
*/
|
||||||
protected function __doRequest2(SoapRequest $soapRequest)
|
protected function __doRequest2(SoapRequest $soapRequest)
|
||||||
|
@ -262,7 +267,7 @@ class SoapClient extends \SoapClient
|
||||||
$contentType = $this->curl->getResponseContentType();
|
$contentType = $this->curl->getResponseContentType();
|
||||||
if ($contentType != 'application/soap+xml'
|
if ($contentType != 'application/soap+xml'
|
||||||
&& $contentType != 'application/soap+xml') {
|
&& $contentType != 'application/soap+xml') {
|
||||||
if (strncmp($response , "<?xml", 5)) {
|
if (strncmp($response, "<?xml", 5)) {
|
||||||
$isError = 1;
|
$isError = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -287,6 +292,7 @@ class SoapClient extends \SoapClient
|
||||||
*
|
*
|
||||||
* @param string $wsdl WSDL file
|
* @param string $wsdl WSDL file
|
||||||
* @param array(string=>mixed) $options Options array
|
* @param array(string=>mixed) $options Options array
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function loadWsdl($wsdl, array $options)
|
private function loadWsdl($wsdl, array $options)
|
||||||
|
|
|
@ -25,17 +25,18 @@ class SoapRequest extends CommonSoapRequest
|
||||||
/**
|
/**
|
||||||
* Factory function for SoapRequest.
|
* Factory function for SoapRequest.
|
||||||
*
|
*
|
||||||
* @param string $content
|
* @param string $content Content
|
||||||
* @param string $location
|
* @param string $location Location
|
||||||
* @param string $action
|
* @param string $action SOAP action
|
||||||
* @param string $version
|
* @param string $version SOAP version
|
||||||
|
*
|
||||||
* @return BeSimple\SoapClient\SoapRequest
|
* @return BeSimple\SoapClient\SoapRequest
|
||||||
*/
|
*/
|
||||||
public static function create($content, $location, $action, $version)
|
public static function create($content, $location, $action, $version)
|
||||||
{
|
{
|
||||||
$request = new SoapRequest();
|
$request = new SoapRequest();
|
||||||
// $content is if unmodified from SoapClient not a php string type!
|
// $content is if unmodified from SoapClient not a php string type!
|
||||||
$request->setContent((string)$content);
|
$request->setContent((string) $content);
|
||||||
$request->setLocation($location);
|
$request->setLocation($location);
|
||||||
$request->setAction($action);
|
$request->setAction($action);
|
||||||
$request->setVersion($version);
|
$request->setVersion($version);
|
||||||
|
|
|
@ -25,11 +25,12 @@ class SoapResponse extends CommonSoapResponse
|
||||||
/**
|
/**
|
||||||
* Factory function for SoapResponse.
|
* Factory function for SoapResponse.
|
||||||
*
|
*
|
||||||
* @param string $content
|
* @param string $content Content
|
||||||
* @param string $location
|
* @param string $location Location
|
||||||
* @param string $action
|
* @param string $action SOAP action
|
||||||
* @param string $version
|
* @param string $version SOAP version
|
||||||
* @param string $contentType
|
* @param string $contentType Content type header
|
||||||
|
*
|
||||||
* @return BeSimple\SoapClient\SoapResponse
|
* @return BeSimple\SoapClient\SoapResponse
|
||||||
*/
|
*/
|
||||||
public static function create($content, $location, $action, $version, $contentType)
|
public static function create($content, $location, $action, $version, $contentType)
|
||||||
|
|
|
@ -126,10 +126,11 @@ class WsAddressingFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Add additional reference parameters
|
* Add additional reference parameters
|
||||||
*
|
*
|
||||||
* @param string $ns
|
* @param string $ns Namespace URI
|
||||||
* @param string $pfx
|
* @param string $pfx Namespace prefix
|
||||||
* @param string $parameter
|
* @param string $parameter Parameter name
|
||||||
* @param string $value
|
* @param string $value Parameter value
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addReferenceParameter($ns, $pfx, $parameter, $value)
|
public function addReferenceParameter($ns, $pfx, $parameter, $value)
|
||||||
|
@ -145,8 +146,9 @@ class WsAddressingFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Get additional reference parameters.
|
* Get additional reference parameters.
|
||||||
*
|
*
|
||||||
* @param string $ns
|
* @param string $ns Namespace URI
|
||||||
* @param string $parameter
|
* @param string $parameter Parameter name
|
||||||
|
*
|
||||||
* @return string|null
|
* @return string|null
|
||||||
*/
|
*/
|
||||||
public function getReferenceParameter($ns, $parameter)
|
public function getReferenceParameter($ns, $parameter)
|
||||||
|
@ -162,7 +164,8 @@ class WsAddressingFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Set FaultTo address of type xs:anyURI.
|
* Set FaultTo address of type xs:anyURI.
|
||||||
*
|
*
|
||||||
* @param string $action
|
* @param string $faultTo xs:anyURI
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setFaultTo($faultTo)
|
public function setFaultTo($faultTo)
|
||||||
|
@ -173,7 +176,8 @@ class WsAddressingFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Set From address of type xs:anyURI.
|
* Set From address of type xs:anyURI.
|
||||||
*
|
*
|
||||||
* @param string $action
|
* @param string $from xs:anyURI
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setFrom($from)
|
public function setFrom($from)
|
||||||
|
@ -185,7 +189,8 @@ class WsAddressingFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
* Set MessageId of type xs:anyURI.
|
* Set MessageId of type xs:anyURI.
|
||||||
* Default: UUID v4 e.g. 'uuid:550e8400-e29b-11d4-a716-446655440000'
|
* Default: UUID v4 e.g. 'uuid:550e8400-e29b-11d4-a716-446655440000'
|
||||||
*
|
*
|
||||||
* @param string $messageId
|
* @param string $messageId xs:anyURI
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setMessageId($messageId = null)
|
public function setMessageId($messageId = null)
|
||||||
|
@ -200,8 +205,9 @@ class WsAddressingFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
* Set RelatesTo of type xs:anyURI with the optional relationType
|
* Set RelatesTo of type xs:anyURI with the optional relationType
|
||||||
* (of type xs:anyURI).
|
* (of type xs:anyURI).
|
||||||
*
|
*
|
||||||
* @param string $relatesTo
|
* @param string $relatesTo xs:anyURI
|
||||||
* @param string $relationType
|
* @param string $relationType xs:anyURI
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setRelatesTo($relatesTo, $relationType = null)
|
public function setRelatesTo($relatesTo, $relationType = null)
|
||||||
|
@ -216,7 +222,8 @@ class WsAddressingFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
* Set ReplyTo address of type xs:anyURI
|
* Set ReplyTo address of type xs:anyURI
|
||||||
* Default: self::ENDPOINT_REFERENCE_ANONYMOUS
|
* Default: self::ENDPOINT_REFERENCE_ANONYMOUS
|
||||||
*
|
*
|
||||||
* @param string $replyTo
|
* @param string $replyTo xs:anyURI
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setReplyTo($replyTo = null)
|
public function setReplyTo($replyTo = null)
|
||||||
|
@ -230,7 +237,8 @@ class WsAddressingFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Modify the given request XML.
|
* Modify the given request XML.
|
||||||
*
|
*
|
||||||
* @param SoapRequest $dom
|
* @param SoapRequest $request SOAP request
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function filterRequest(SoapRequest $request)
|
public function filterRequest(SoapRequest $request)
|
||||||
|
@ -298,7 +306,8 @@ class WsAddressingFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Modify the given response XML.
|
* Modify the given response XML.
|
||||||
*
|
*
|
||||||
* @param SoapResponse $response
|
* @param SoapResponse $response SOAP response
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function filterResponse(SoapResponse $response)
|
public function filterResponse(SoapResponse $response)
|
||||||
|
|
|
@ -152,8 +152,8 @@ class WsSecurityFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
* Constructor.
|
* Constructor.
|
||||||
*
|
*
|
||||||
* @param boolean $addTimestamp (SMS 10) Add security timestamp.
|
* @param boolean $addTimestamp (SMS 10) Add security timestamp.
|
||||||
* @param int $expires (SMS 10) Security timestamp expires time in seconds.
|
* @param int $expires (SMS 10) Security timestamp expires time in seconds.
|
||||||
* @param string $actor
|
* @param string $actor SOAP actor
|
||||||
*/
|
*/
|
||||||
public function __construct($addTimestamp = true, $expires = 300, $actor = null)
|
public function __construct($addTimestamp = true, $expires = 300, $actor = null)
|
||||||
{
|
{
|
||||||
|
@ -165,9 +165,10 @@ class WsSecurityFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Add user data.
|
* Add user data.
|
||||||
*
|
*
|
||||||
* @param string $username
|
* @param string $username Username
|
||||||
* @param string $password
|
* @param string $password Password
|
||||||
* @param int $passwordType self::PASSWORD_TYPE_DIGEST | self::PASSWORD_TYPE_TEXT
|
* @param int $passwordType self::PASSWORD_TYPE_DIGEST | self::PASSWORD_TYPE_TEXT
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addUserData($username, $password = null, $passwordType = self::PASSWORD_TYPE_DIGEST)
|
public function addUserData($username, $password = null, $passwordType = self::PASSWORD_TYPE_DIGEST)
|
||||||
|
@ -180,7 +181,8 @@ class WsSecurityFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Get service security key.
|
* Get service security key.
|
||||||
*
|
*
|
||||||
* @param \BeSimple\SoapCommon\WsSecurityKey $serviceSecurityKey
|
* @param \BeSimple\SoapCommon\WsSecurityKey $serviceSecurityKey Service security key
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setServiceSecurityKeyObject(WsSecurityKey $serviceSecurityKey)
|
public function setServiceSecurityKeyObject(WsSecurityKey $serviceSecurityKey)
|
||||||
|
@ -191,7 +193,8 @@ class WsSecurityFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Get user security key.
|
* Get user security key.
|
||||||
*
|
*
|
||||||
* @param \BeSimple\SoapCommon\WsSecurityKey $userSecurityKey
|
* @param \BeSimple\SoapCommon\WsSecurityKey $userSecurityKey User security key
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setUserSecurityKeyObject(WsSecurityKey $userSecurityKey)
|
public function setUserSecurityKeyObject(WsSecurityKey $userSecurityKey)
|
||||||
|
@ -202,8 +205,9 @@ class WsSecurityFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Set security options.
|
* Set security options.
|
||||||
*
|
*
|
||||||
* @param int $tokenReference self::TOKEN_REFERENCE_SUBJECT_KEY_IDENTIFIER | self::TOKEN_REFERENCE_SECURITY_TOKEN | self::TOKEN_REFERENCE_THUMBPRINT_SHA1
|
* @param int $tokenReference self::TOKEN_REFERENCE_SUBJECT_KEY_IDENTIFIER | self::TOKEN_REFERENCE_SECURITY_TOKEN | self::TOKEN_REFERENCE_THUMBPRINT_SHA1
|
||||||
* @param boolean $encryptSignature
|
* @param boolean $encryptSignature Encrypt signature
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setSecurityOptionsEncryption($tokenReference, $encryptSignature = false)
|
public function setSecurityOptionsEncryption($tokenReference, $encryptSignature = false)
|
||||||
|
@ -215,8 +219,9 @@ class WsSecurityFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Set security options.
|
* Set security options.
|
||||||
*
|
*
|
||||||
* @param int $tokenReference self::TOKEN_REFERENCE_SUBJECT_KEY_IDENTIFIER | self::TOKEN_REFERENCE_SECURITY_TOKEN | self::TOKEN_REFERENCE_THUMBPRINT_SHA1
|
* @param int $tokenReference self::TOKEN_REFERENCE_SUBJECT_KEY_IDENTIFIER | self::TOKEN_REFERENCE_SECURITY_TOKEN | self::TOKEN_REFERENCE_THUMBPRINT_SHA1
|
||||||
* @param boolean $signAllHeaders
|
* @param boolean $signAllHeaders Sign all headers?
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function setSecurityOptionsSignature($tokenReference, $signAllHeaders = false)
|
public function setSecurityOptionsSignature($tokenReference, $signAllHeaders = false)
|
||||||
|
@ -228,7 +233,8 @@ class WsSecurityFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Modify the given request XML.
|
* Modify the given request XML.
|
||||||
*
|
*
|
||||||
* @param SoapRequest $dom
|
* @param SoapRequest $request SOAP request to modify
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function filterRequest(SoapRequest $request)
|
public function filterRequest(SoapRequest $request)
|
||||||
|
@ -278,7 +284,7 @@ class WsSecurityFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
|
|
||||||
if (self::PASSWORD_TYPE_DIGEST === $this->passwordType) {
|
if (self::PASSWORD_TYPE_DIGEST === $this->passwordType) {
|
||||||
$nonce = mt_rand();
|
$nonce = mt_rand();
|
||||||
$password = base64_encode(sha1($nonce . $createdTimestamp . $this->password , true));
|
$password = base64_encode(sha1($nonce . $createdTimestamp . $this->password, true));
|
||||||
$passwordType = Helper::NAME_WSS_UTP . '#PasswordDigest';
|
$passwordType = Helper::NAME_WSS_UTP . '#PasswordDigest';
|
||||||
} else {
|
} else {
|
||||||
$password = $this->password;
|
$password = $this->password;
|
||||||
|
@ -349,7 +355,8 @@ class WsSecurityFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Modify the given request XML.
|
* Modify the given request XML.
|
||||||
*
|
*
|
||||||
* @param SoapResponse $response
|
* @param SoapResponse $response SOAP response to modify
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function filterResponse(SoapResponse $response)
|
public function filterResponse(SoapResponse $response)
|
||||||
|
@ -397,12 +404,11 @@ class WsSecurityFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Adds the configured KeyInfo to the parentNode.
|
* Adds the configured KeyInfo to the parentNode.
|
||||||
*
|
*
|
||||||
* @param FilterHelper $filterHelper
|
* @param FilterHelper $filterHelper Filter helper object
|
||||||
* @param int $tokenReference
|
* @param int $tokenReference Token reference type
|
||||||
* @param \DOMNode $parentNode
|
* @param string $guid Unique ID
|
||||||
* @param string $guid
|
* @param \ass\XmlSecurity\Key $xmlSecurityKey XML security key
|
||||||
* @param \ass\XmlSecurity\Key $xmlSecurityKey
|
*
|
||||||
* @param \DOMNode $insertBefore
|
|
||||||
* @return \DOMElement
|
* @return \DOMElement
|
||||||
*/
|
*/
|
||||||
protected function createKeyInfo(FilterHelper $filterHelper, $tokenReference, $guid, XmlSecurityKey $xmlSecurityKey = null)
|
protected function createKeyInfo(FilterHelper $filterHelper, $tokenReference, $guid, XmlSecurityKey $xmlSecurityKey = null)
|
||||||
|
@ -444,8 +450,9 @@ class WsSecurityFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Create a list of \DOMNodes that should be encrypted.
|
* Create a list of \DOMNodes that should be encrypted.
|
||||||
*
|
*
|
||||||
* @param \DOMDocument $dom
|
* @param \DOMDocument $dom DOMDocument to query
|
||||||
* @param \DOMElement $security
|
* @param \DOMElement $security Security element
|
||||||
|
*
|
||||||
* @return \DOMNodeList
|
* @return \DOMNodeList
|
||||||
*/
|
*/
|
||||||
protected function createNodeListForEncryption(\DOMDocument $dom, \DOMElement $security)
|
protected function createNodeListForEncryption(\DOMDocument $dom, \DOMElement $security)
|
||||||
|
@ -465,8 +472,9 @@ class WsSecurityFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Create a list of \DOMNodes that should be signed.
|
* Create a list of \DOMNodes that should be signed.
|
||||||
*
|
*
|
||||||
* @param \DOMDocument $dom
|
* @param \DOMDocument $dom DOMDocument to query
|
||||||
* @param \DOMElement $security
|
* @param \DOMElement $security Security element
|
||||||
|
*
|
||||||
* @return array(\DOMNode)
|
* @return array(\DOMNode)
|
||||||
*/
|
*/
|
||||||
protected function createNodeListForSigning(\DOMDocument $dom, \DOMElement $security)
|
protected function createNodeListForSigning(\DOMDocument $dom, \DOMElement $security)
|
||||||
|
@ -496,8 +504,9 @@ class WsSecurityFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Gets the referenced node for the given URI.
|
* Gets the referenced node for the given URI.
|
||||||
*
|
*
|
||||||
* @param \DOMElement $node
|
* @param \DOMElement $node Node
|
||||||
* @param string $uri
|
* @param string $uri URI
|
||||||
|
*
|
||||||
* @return \DOMElement
|
* @return \DOMElement
|
||||||
*/
|
*/
|
||||||
protected function getReferenceNodeForUri(\DOMElement $node, $uri)
|
protected function getReferenceNodeForUri(\DOMElement $node, $uri)
|
||||||
|
@ -514,8 +523,9 @@ class WsSecurityFilter implements SoapRequestFilter, SoapResponseFilter
|
||||||
/**
|
/**
|
||||||
* Tries to resolve a key from the given \DOMElement.
|
* Tries to resolve a key from the given \DOMElement.
|
||||||
*
|
*
|
||||||
* @param \DOMElement $node
|
* @param \DOMElement $node Node where to resolve the key
|
||||||
* @param string $algorithm
|
* @param string $algorithm XML security key algorithm
|
||||||
|
*
|
||||||
* @return \ass\XmlSecurity\Key|null
|
* @return \ass\XmlSecurity\Key|null
|
||||||
*/
|
*/
|
||||||
public function keyInfoSecurityTokenReferenceResolver(\DOMElement $node, $algorithm)
|
public function keyInfoSecurityTokenReferenceResolver(\DOMElement $node, $algorithm)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the BeSimpleSoapClient.
|
* This file is part of the BeSimpleSoapClient.
|
||||||
|
@ -71,7 +71,7 @@ class WsdlDownloader
|
||||||
$this->curl = $curl;
|
$this->curl = $curl;
|
||||||
$this->resolveRemoteIncludes = $resolveRemoteIncludes;
|
$this->resolveRemoteIncludes = $resolveRemoteIncludes;
|
||||||
// get current WSDL caching config
|
// get current WSDL caching config
|
||||||
$this->cacheEnabled = (bool)ini_get('soap.wsdl_cache_enabled');
|
$this->cacheEnabled = (bool) ini_get('soap.wsdl_cache_enabled');
|
||||||
if ($this->cacheEnabled === true
|
if ($this->cacheEnabled === true
|
||||||
&& $cacheWsdl === WSDL_CACHE_NONE) {
|
&& $cacheWsdl === WSDL_CACHE_NONE) {
|
||||||
$this->cacheEnabled = false;
|
$this->cacheEnabled = false;
|
||||||
|
@ -87,7 +87,8 @@ class WsdlDownloader
|
||||||
/**
|
/**
|
||||||
* Download given WSDL file and return name of cache file.
|
* Download given WSDL file and return name of cache file.
|
||||||
*
|
*
|
||||||
* @param string $wsdl
|
* @param string $wsdl WSDL file URL/path
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function download($wsdl)
|
public function download($wsdl)
|
||||||
|
@ -134,7 +135,8 @@ class WsdlDownloader
|
||||||
/**
|
/**
|
||||||
* Do we have a remote file?
|
* Do we have a remote file?
|
||||||
*
|
*
|
||||||
* @param string $file
|
* @param string $file File URL/path
|
||||||
|
*
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
private function isRemoteFile($file)
|
private function isRemoteFile($file)
|
||||||
|
@ -153,9 +155,10 @@ class WsdlDownloader
|
||||||
/**
|
/**
|
||||||
* Resolves remote WSDL/XSD includes within the WSDL files.
|
* Resolves remote WSDL/XSD includes within the WSDL files.
|
||||||
*
|
*
|
||||||
* @param string $xml
|
* @param string $xml XML file
|
||||||
* @param string $cacheFile
|
* @param string $cacheFile Cache file name
|
||||||
* @param unknown_type $parentIsRemote
|
* @param boolean $parentFile Parent file name
|
||||||
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
private function resolveRemoteIncludes($xml, $cacheFile, $parentFile = null)
|
private function resolveRemoteIncludes($xml, $cacheFile, $parentFile = null)
|
||||||
|
@ -203,8 +206,9 @@ class WsdlDownloader
|
||||||
/**
|
/**
|
||||||
* Resolves the relative path to base into an absolute.
|
* Resolves the relative path to base into an absolute.
|
||||||
*
|
*
|
||||||
* @param string $base
|
* @param string $base Base path
|
||||||
* @param string $relative
|
* @param string $relative Relative path
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
private function resolveRelativePathInUrl($base, $relative)
|
private function resolveRelativePathInUrl($base, $relative)
|
||||||
|
|
Loading…
Reference in New Issue