xmlrpc_client::send PHP Method

send() public method

public send ( $msg, $timeout, $method = 'http' )
    function send($msg, $timeout = 0, $method = 'http')
    {
        // where msg is an xmlrpcmsg
        $msg->debug = $this->debug;
        if ($method == 'https') {
            return $this->sendPayloadHTTPS($msg, $this->server, $this->port, $timeout, $this->username, $this->password, $this->cert, $this->certpass);
        } else {
            return $this->sendPayloadHTTP10($msg, $this->server, $this->port, $timeout, $this->username, $this->password);
        }
    }

Usage Example

Exemplo n.º 1
1
 function callRemote($method)
 {
     // Curl is required so generate a fault if curl functions cannot be found.
     if (!$this->curl) {
         return array('faultCode' => -1, 'faultString' => 'Curl functions are unavailable.');
     }
     // The first argument will always be the method name while all remaining arguments need
     // to be passed along with the call.
     $args = func_get_args();
     array_shift($args);
     if ($this->xmlrpc) {
         // If php has xmlrpc support use the built in functions.
         $request = xmlrpc_encode_request($method, $args);
         $result = $this->__xmlrpc_call($request);
         $decodedResult = xmlrpc_decode($result);
     } else {
         // If no xmlrpc support is found, use the phpxmlrpc library. This involves containing
         // all variables inside the xmlrpcval class.
         $encapArgs = array();
         foreach ($args as $arg) {
             $encapArgs[] = $this->__phpxmlrpc_encapsulate($arg);
         }
         $msg = new xmlrpcmsg($method, $encapArgs);
         $client = new xmlrpc_client($this->url);
         $client->verifypeer = false;
         $result = $client->send($msg);
         if ($result->errno) {
             $decodedResult = array('faultCode' => $result->errno, 'faultString' => $result->errstr);
         } else {
             $decodedResult = php_xmlrpc_decode($result->value());
         }
     }
     return $decodedResult;
 }
All Usage Examples Of xmlrpc_client::send