function __construct($server, $path = '/', $port = 80, $protocol = null) { $this->ResponseClass = 'ggJSONRPCResponse'; $this->UserAgent = 'gg eZ JSONRPC client'; $this->ContentType = 'application/json'; parent::__construct($server, $path, $port, $protocol); }
function __construct($server, $path = '/', $port = 80, $protocol = null) { $this->ResponseClass = 'ggXMLRPCResponse'; $this->UserAgent = 'gg eZ XMLRPC client'; $this->ContentType = 'text/xml'; parent::__construct($server, $path, $port, $protocol); }
function __construct($server, $path = '/', $port = 80, $protocol = null) { $this->ResponseClass = 'ggeZJSCoreResponse'; $this->UserAgent = 'gg eZJSCore client'; $this->ContentType = 'application/x-www-form-urlencoded'; parent::__construct($server, $path, $port, $protocol); }
function getOption($option) { switch ($option) { case 'soapVersion': return $this->SoapVersion; default: return parent::getOption($option); } }
function getOption($option) { switch ($option) { case 'nameVariable': return $this->NameVar; case 'responseType': return $this->ResponseType; case 'requestType': return $this->RequestType; case 'accept': return $this->Accept; case 'requestHeaders': return $this->RequestHeaders; default: return parent::getOption($option); } }
public function setOption($option, $value) { if ($option == 'soapVersion') { $this->SoapVersion = $value; } else { if ($option == 'cacheWSDL') { $this->CacheWSDL = $value; } else { if ($option == 'returnArrays') { $this->returnArrays = $value; } else { return parent::setOption($option, $value); } } } }
function __construct($server, $path = '/', $port = 80, $protocol = null) { $this->ResponseClass = 'ggHTTPResponse'; $this->UserAgent = 'gg eZ HTTP client'; parent::__construct($server, $path, $port, $protocol); }
/** * Sample xmlrpc client that uses the ggws classes outside of an eZ Publish context * The server endpoint in use is the public one of the phpxmlrpc.sourceforge.net lib * * @author Gaetano Giunta * @copyright (c) 2010-2016 G. Giunta * @license code licensed under the GNU GPL. See LICENSE file */ // include client classes (this is done by autload when within an eZP context) include_once "ggwebservices/classes/ggwebservicesclient.php"; include_once "ggwebservices/classes/ggwebservicesrequest.php"; include_once "ggwebservices/classes/ggxmlrpcrequest.php"; include_once "ggwebservices/classes/ggwebservicesresponse.php"; include_once "ggwebservices/classes/ggxmlrpcresponse.php"; // create a new client $client = new ggWebservicesClient("phpxmlrpc.sourceforge.net", "/server.php"); // define the request $request = new ggXMLRPCRequest("examples.addtwo", array(44, 45)); // send the request to the server and fetch the response $response = $client->send($request); if (!$response) { print "<pre>Error: " . $client->errorNumber() . " - \"" . $client->errorString() . "\""; } else { // check if the server returned a fault, if not print out the result if ($response->isFault()) { print "<pre>Fault: " . $response->faultCode() . " - \"" . $response->faultString() . "\""; } else { print "<pre>Returned value was: \"" . $response->value() . "\""; } }