Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
WebService Class Reference
Inheritance diagram for WebService:
JSONWebService XmlWebService

Public Member Functions

 _authenticateRequest (&$ch)
 
 _buildHeaders (&$webServiceRequest)
 
 _callGetWebService (&$webServiceRequest)
 
 _callPostWebService ($webServiceRequest)
 
 _callPostWebServiceAsync ($webServiceRequest)
 
 _checkSSL ($ch, $url)
 
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 283 of file WebService.inc.php.

WebService::_buildHeaders ( $webServiceRequest)

Build and set the headers in a cURL request

Parameters
$webServiceRequestWebServiceRequest
Returns
An array with headers.

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

WebService::_callGetWebService ( $webServiceRequest)

Call a GET based web services

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

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

WebService::_callPostWebService (   $webServiceRequest)

Call a POST based web services

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

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

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 225 of file WebService.inc.php.

WebService::_checkSSL (   $ch,
  $url 
)

Configures SSL if necessary.

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

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

& 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 78 of file WebService.inc.php.

WebService::getLastResponseStatus ( )

Returns the last error produced by a web service.

Returns
integer

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

WebService::setAuthPassword (   $authPassword)

Sets an (optional) authentication password.

Parameters
$authPasswordstring

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

WebService::setAuthUsername (   $authUsername)

Sets an (optional) authentication username.

Parameters
$authUsernamestring

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


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