xmlrpcmsg Class Reference

List of all members.

Public Member Functions

 xmlrpcmsg ($meth, $pars=0)
 xml_header ($charset_encoding='')
 xml_footer ()
 kindOf ()
 createPayload ($charset_encoding='')
 method ($meth='')
 serialize ($charset_encoding='')
 addParam ($par)
 getParam ($i)
 getNumParams ()
parseResponseFile ($fp)
parseResponseHeaders (&$data, $headers_processed=false)
parseResponse ($data='', $headers_processed=false, $return_type='xmlrpcvals')

Public Attributes

 $payload
 $methodname
 $params = array()
 $debug = 0
 $content_type = 'text/xml'


Detailed Description

Definition at line 2030 of file xmlrpc.inc.php.


Member Function Documentation

xmlrpcmsg::xmlrpcmsg ( meth,
pars = 0 
)

Parameters:
string $meth the name of the method to invoke
array $pars array of parameters to be paased to the method (xmlrpcval objects)

Definition at line 2042 of file xmlrpc.inc.php.

References addParam().

xmlrpcmsg::xml_header ( charset_encoding = ''  ) 

private

Definition at line 2057 of file xmlrpc.inc.php.

Referenced by createPayload().

xmlrpcmsg::xml_footer (  ) 

private

Definition at line 2072 of file xmlrpc.inc.php.

Referenced by createPayload().

xmlrpcmsg::kindOf (  ) 

private

Definition at line 2080 of file xmlrpc.inc.php.

xmlrpcmsg::createPayload ( charset_encoding = ''  ) 

private

Definition at line 2088 of file xmlrpc.inc.php.

References xml_footer(), and xml_header().

Referenced by serialize().

xmlrpcmsg::method ( meth = ''  ) 

Gets/sets the xmlrpc method to be invoked

Parameters:
string $meth the method to be set (leave empty not to set it)
Returns:
string the method that will be invoked public

Definition at line 2113 of file xmlrpc.inc.php.

xmlrpcmsg::serialize ( charset_encoding = ''  ) 

Returns xml representation of the message. XML prologue included

Returns:
string the xml representation of the message, xml prologue included public

Definition at line 2127 of file xmlrpc.inc.php.

References createPayload().

xmlrpcmsg::addParam ( par  ) 

Add a parameter to the list of parameters to be used upon method invocation

Parameters:
xmlrpcval $par
Returns:
boolean false on failure public

Definition at line 2139 of file xmlrpc.inc.php.

Referenced by xmlrpcmsg().

xmlrpcmsg::getParam ( i  ) 

Returns the nth parameter in the message. The index zero-based.

Parameters:
integer $i the index of the parameter to fetch (zero based)
Returns:
xmlrpcval the i-th parameter public

Definition at line 2159 of file xmlrpc.inc.php.

xmlrpcmsg::getNumParams (  ) 

Returns the number of parameters in the messge.

Returns:
integer the number of parameters currently set public

Definition at line 2166 of file xmlrpc.inc.php.

& xmlrpcmsg::parseResponseFile ( fp  ) 

Given an open file handle, read all data available and parse it as axmlrpc response. NB: the file handle is not closed by this function. public

Returns:
xmlrpcresp
Todo:
add 2nd & 3rd param to be passed to ParseResponse() ???

Definition at line 2175 of file xmlrpc.inc.php.

References parseResponse().

& xmlrpcmsg::parseResponseHeaders ( &$  data,
headers_processed = false 
)

Parses HTTP headers and separates them from data. private

Todo:
some other headers (the ones that allow a CSV list of values) do allow many values to be passed using multiple header lines. We should add content to $GLOBALS['_xh']['headers'][$header_name] instead of replacing it for those...

Todo:
with version 1 cookies, we should strip leading and trailing " chars

Todo:
version1 cookies might span multiple lines, thus breaking the parsing above

Definition at line 2191 of file xmlrpc.inc.php.

References $GLOBALS, and debug().

Referenced by parseResponse().

& xmlrpcmsg::parseResponse ( data = '',
headers_processed = false,
return_type = 'xmlrpcvals' 
)

Parse the xmlrpc response contained in the string $data and return an xmlrpcresp object.

Parameters:
string $data the xmlrpc response, eventually including http headers
bool $headers_processed when true prevents parsing HTTP headers for interpretation of content-encoding and consequent decoding
string $return_type decides return type, i.e. content of response->value(). Either 'xmlrpcvals', 'xml' or 'phpvals'
Returns:
xmlrpcresp public

Todo:
return an error msg if $data=='' ?

Todo:
echo something for user?

Todo:
we should test here if server sent an int and a string, and/or coerce them into such...

Definition at line 2425 of file xmlrpc.inc.php.

References $GLOBALS, debug(), and parseResponseHeaders().

Referenced by parseResponseFile().


Member Data Documentation

xmlrpcmsg::$payload

Definition at line 2032 of file xmlrpc.inc.php.

xmlrpcmsg::$methodname

Definition at line 2033 of file xmlrpc.inc.php.

xmlrpcmsg::$params = array()

Definition at line 2034 of file xmlrpc.inc.php.

xmlrpcmsg::$debug = 0

Definition at line 2035 of file xmlrpc.inc.php.

xmlrpcmsg::$content_type = 'text/xml'

Definition at line 2036 of file xmlrpc.inc.php.


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



Generated on Wed Jun 25 17:26:03 2008 by  doxygen 1.5.5