PRADO Component Framework for PHP 5
  • Home
  • About
  • Testimonials
  • Demos
  • Download
  • Documentation
  • Forum
  • Development
  • Tutorials
  • Class Docs
  • API Manual
  • Wiki

Packages

  • None
  • System
    • Caching
    • Collections
    • Data
      • ActiveRecord
        • Relations
        • Scaffold
          • InputBuilder
      • Commom
        • Sqlite
      • Common
        • Mssql
        • Mysql
        • Oracle
        • Pgsql
        • Sqlite
      • DataGateway
      • SqlMap
        • Configuration
        • Statements
    • Exceptions
    • I18N
    • IO
    • Security
    • Util
    • Web
      • Javascripts
      • Services
      • UI
        • ActiveControls
        • WebControls
    • Xml
  • Wsat
    • pages
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class TRpcClient

TRpcClient class

Note: When using setIsNotification(true), every following request is also considered to be a notification until you use setIsNotification(false).

Usage:

First, you can use the factory:

$_rpcClient = TRpcClient::create('xml', 'http://host/server');
$_result = $_rpcClient->remoteMethodName($param, $otherParam);

or as oneliner:

$_result = TRpcClient::create('json', 'http://host/server')->remoteMethod($param, ...);

Second, you can also use the specific implementation directly:

$_rpcClient = new TXmlRpcClient('http://host/server');
$_result = $_rpcClient->remoteMethod($param, ...);

or as oneliner:

$_result = TXmlRpcClient('http://host/server')->hello();
TComponent
Extended by TApplicationComponent
Extended by TRpcClient

Direct known subclasses

TJsonRpcClient, TXmlRpcClient
Package: System\Util
Copyright: 2010 Bigpoint GmbH
License: http://www.pradosoft.com/license/
Author: Robin J. Rogge <rrogge@bigpoint.net>
Version: $Id$
Since: 3.2
Located at Util/TRpcClient.php
Methods summary
public
# __construct( string $serverUrl, boolean $isNotification = false )

Parameters

$serverUrl
string
url to RPC server
$isNotification
boolean
whether requests are considered to be notifications (completely ignoring the response) (default: false)

Overrides

TComponent::__construct()
public static TRpcClient
# create( mixed $type, mixed $serverUrl, mixed $isNotification = false )

Creates an instance of the requested RPC client type

Creates an instance of the requested RPC client type

Returns

TRpcClient
instance

Throws

TApplicationException
if an unsupported RPC client type was specified
protected
# createStreamContext( mixed $content, string $contentType )

Creates a stream context resource

Creates a stream context resource

Parameters

$content
mixed
$content
$contentType
string
$contentType mime type
protected
# performRequest( string $serverUrl, array $payload, string $mimeType )

Performs the actual request

Performs the actual request

Parameters

$serverUrl
string
RPC server URL
$payload
array
payload data
$mimeType
string
request mime type
public boolean
# getIsNotification( )

Returns

boolean
whether requests are considered to be notifications (completely ignoring the response)
public
# setIsNotification( string $bool )

Parameters

$bool
string
boolean whether the requests are considered to be notifications (completely ignoring the response) (default: false)
public string
# getServerUrl( )

Returns

string
url of the RPC server
public
# setServerUrl( string $value )

Parameters

$value
string
url of the RPC server
Methods inherited from TApplicationComponent
getApplication(), getRequest(), getResponse(), getService(), getSession(), getUser(), publishAsset(), publishFilePath()
Methods inherited from TComponent
__call(), __destruct(), __get(), __isset(), __set(), __sleep(), __unset(), __wakeup(), addParsedObject(), asa(), attachBehavior(), attachBehaviors(), attachClassBehavior(), attachEventHandler(), canGetProperty(), canSetProperty(), clearBehaviors(), createdOnTemplate(), detachBehavior(), detachBehaviors(), detachClassBehavior(), detachEventHandler(), disableBehavior(), disableBehaviors(), enableBehavior(), enableBehaviors(), evaluateExpression(), evaluateStatements(), fxAttachClassBehavior(), fxDetachClassBehavior(), getAutoGlobalListen(), getBehaviorsEnabled(), getClassHierarchy(), getEventHandlers(), getListeningToGlobalEvents(), getSubProperty(), hasEvent(), hasEventHandler(), hasProperty(), isa(), listen(), raiseEvent(), setSubProperty(), unlisten()
Constants inherited from TComponent
GLOBAL_RAISE_EVENT_LISTENER
Terms of Service | Contact Us
PRADO v3.2.4 API Manual API documentation generated by ApiGen 2.8.0
Copyright © 2006-2014 by the PRADO Group.
Powered by PRADO