Open Journal Systems  2.4.4
 All Classes Namespaces Functions Variables Groups Pages
WebService Class Reference
Inheritance diagram for WebService:
XmlWebService SolrWebService

Public Member Functions

 _authenticateRequest (&$ch)
 
 _buildHeaders (&$webServiceRequest)
 
 _callGetWebService (&$webServiceRequest)
 
 _callPostWebService ($webServiceRequest)
 
 _callPostWebServiceAsync ($webServiceRequest)
 
call (&$webServiceRequest)
 
 getLastResponseStatus ()
 
 setAuthPassword ($authPassword)
 
 setAuthUsername ($authUsername)
 

Detailed Description

Abstract base class for a web service.

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

Member Function Documentation

WebService::_authenticateRequest ( $ch)

Adds (optional) authentication information to a curl request

Parameters
$chobject Reference to a curl handle.

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

Referenced by _callGetWebService(), and _callPostWebService().

WebService::_buildHeaders ( $webServiceRequest)

Build and set the headers in a cURL request

Parameters
$webServiceRequestWebServiceRequest
Returns
An array with headers.

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

Referenced by _callGetWebService(), and _callPostWebServiceAsync().

WebService::_callGetWebService ( $webServiceRequest)

Call a GET based web services

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

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

References _authenticateRequest(), and _buildHeaders().

Referenced by call().

WebService::_callPostWebService (   $webServiceRequest)

Call a POST based web services

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

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

References _authenticateRequest().

Referenced by call().

WebService::_callPostWebServiceAsync (   $webServiceRequest)

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
Returns
string the web service result or null on failure

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

References _buildHeaders().

Referenced by 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.

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

References _callGetWebService(), _callPostWebService(), _callPostWebServiceAsync(), Config\getVar(), String\utf8_compliant(), and String\utf8_normalize().

WebService::getLastResponseStatus ( )

Returns the last error produced by a web service.

Returns
integer

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

Referenced by SolrWebService\_makeRequest().

WebService::setAuthPassword (   $authPassword)

Sets an (optional) authentication password.

Parameters
$authPasswordstring

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

Referenced by SolrWebService\SolrWebService().

WebService::setAuthUsername (   $authUsername)

Sets an (optional) authentication username.

Parameters
$authUsernamestring

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

Referenced by SolrWebService\SolrWebService().


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