Open Journal Systems  3.3.0
WebService Class Reference
Inheritance diagram for WebService:
XmlWebService

Public Member Functions

 _authenticateRequest (&$ch)
 
 _buildHeaders (&$webServiceRequest)
 
 _callGetWebService (&$webServiceRequest)
 
 _callPostWebService ($webServiceRequest, $usePut=false)
 
 _callPostWebServiceAsync ($webServiceRequest, $usePut=false)
 
 _checkSSL ($ch, $url)
 
call (&$webServiceRequest)
 
 getLastResponseStatus ()
 
 setAuthPassword ($authPassword)
 
 setAuthUsername ($authUsername)
 
 setSslVersion ($sslVersion)
 

Data Fields

 $_authPassword
 
 $_authUsername
 
 $_lastResponseStatus
 
 $_sslVersion
 

Detailed Description

Abstract base class for a web service.

Definition at line 25 of file WebService.inc.php.

Member Function Documentation

◆ _authenticateRequest()

WebService::_authenticateRequest ( $ch)

Adds (optional) authentication information to a curl request

Parameters
$chobject Reference to a curl handle.

Definition at line 320 of file WebService.inc.php.

References $_authPassword, and $_authUsername.

Referenced by _callGetWebService(), and _callPostWebService().

◆ _buildHeaders()

WebService::_buildHeaders ( $webServiceRequest)

Build and set the headers in a cURL request

Parameters
$webServiceRequestWebServiceRequest
Returns
An array with headers.

Definition at line 348 of file WebService.inc.php.

Referenced by _callGetWebService(), and _callPostWebServiceAsync().

◆ _callGetWebService()

WebService::_callGetWebService ( $webServiceRequest)

Call a GET based web services

Parameters
$webServiceRequestWebServiceRequest
Returns
string the web service result or null on failure

Definition at line 198 of file WebService.inc.php.

References _authenticateRequest(), _buildHeaders(), _checkSSL(), and PKPCurlHelper\getCurlObject().

Referenced by call().

◆ _callPostWebService()

WebService::_callPostWebService (   $webServiceRequest,
  $usePut = false 
)

Call a POST (or PUT) based web services

Parameters
$webServiceRequestWebServiceRequest
$usePutboolean
Returns
string the web service result or null on failure

Definition at line 140 of file WebService.inc.php.

References _authenticateRequest(), _checkSSL(), and PKPCurlHelper\getCurlObject().

Referenced by call().

◆ _callPostWebServiceAsync()

WebService::_callPostWebServiceAsync (   $webServiceRequest,
  $usePut = false 
)

Execute an asynchronous web service request.

NB: Web services must read the request all at once (i.e. they may not stream content in bit by bit) as we close the connection before we get a response. This also means that web services must be immune to the client closing the connection.

Parameters
$webServiceRequestWebServiceRequest
$usePutboolean
Returns
string the web service result or null on failure

Definition at line 262 of file WebService.inc.php.

References $_authPassword, $_authUsername, and _buildHeaders().

Referenced by call().

◆ _checkSSL()

WebService::_checkSSL (   $ch,
  $url 
)

Configures SSL if necessary.

Parameters
$chobject Reference to a curl handle.
$urlstring The URL to access.

Definition at line 334 of file WebService.inc.php.

Referenced by _callGetWebService(), and _callPostWebService().

◆ call()

& WebService::call ( $webServiceRequest)

Call a web service

Parameters
$webServiceRequestWebServiceRequest
Returns
string the result of the web service or null in case of an error.

Reimplemented in XmlWebService.

Definition at line 92 of file WebService.inc.php.

References _callGetWebService(), _callPostWebService(), and _callPostWebServiceAsync().

◆ getLastResponseStatus()

WebService::getLastResponseStatus ( )

Returns the last error produced by a web service.

Returns
integer

Definition at line 79 of file WebService.inc.php.

References $_lastResponseStatus.

◆ setAuthPassword()

WebService::setAuthPassword (   $authPassword)

Sets an (optional) authentication password.

Parameters
$authPasswordstring

Definition at line 63 of file WebService.inc.php.

◆ setAuthUsername()

WebService::setAuthUsername (   $authUsername)

Sets an (optional) authentication username.

Parameters
$authUsernamestring

Definition at line 55 of file WebService.inc.php.

◆ setSslVersion()

WebService::setSslVersion (   $sslVersion)

Sets an (optional) ssl version.

Parameters
$sslVersionint CURL_SSLVERSION_...

Definition at line 71 of file WebService.inc.php.

Field Documentation

◆ $_authPassword

string WebService::$_authPassword

Definition at line 35 of file WebService.inc.php.

Referenced by _authenticateRequest(), and _callPostWebServiceAsync().

◆ $_authUsername

string WebService::$_authUsername

Definition at line 30 of file WebService.inc.php.

Referenced by _authenticateRequest(), and _callPostWebServiceAsync().

◆ $_lastResponseStatus

integer WebService::$_lastResponseStatus

Definition at line 46 of file WebService.inc.php.

Referenced by getLastResponseStatus().

◆ $_sslVersion

int WebService::$_sslVersion

Definition at line 40 of file WebService.inc.php.


The documentation for this class was generated from the following file: