thyXMLRPCProtocol

This class implements the XMLRPC specific methods.

Summary
This class implements the XMLRPC specific methods.
Encode the data in XMLRPC protocol and returns the appropriate string
Decodes received XML in XMLRPC response format to JS data structure
Returns the content type of XML document
Returns the server URL
Converts the passed string to another one with all XML entities encoded correctly
Remove all childNodes that are not NonElement Nodes
Parses methodResponse element and resturns its value
Parses <value> elements
Parses <struct> elements
Parses <array> elements
Parses <i4>, <int> and <double> elements
Parses <string> elements
Convert JS entities to XMLRPC entities

encode

p.encode = function (method,
params)

Encode the data in XMLRPC protocol and returns the appropriate string

Parameters

methodThe name of the method to be called
paramsThe params to be passed to this method

decode

p.decode = function (response)

Decodes received XML in XMLRPC response format to JS data structure

Parameter

responseThe response from server, that can be either a DOM XML document or a XML string to be parsed

getContentType

p.getContentType = function()

Returns the content type of XML document

getServerURL

p.getServerURL = function()

Returns the server URL

Private Methods

_encodeXMLEntities

p._encodeXMLEntities = function (toEncode)

Converts the passed string to another one with all XML entities encoded correctly

Parameter

toEncodeThe string to be encoded

_removeNonElementNodes

p._removeNonElementNodes = function (node)

Remove all childNodes that are not NonElement Nodes

Parameter

nodeThe node

_decodeMethodResponse

p._decodeMethodResponse = function (node)

Parses methodResponse element and resturns its value

Parameter

nodeThe methodResponse node

_decodeValue

p._decodeValue = function (node)

Parses <value> elements

_decodeStruct

p._decodeStruct = function (node)

Parses <struct> elements

_decodeArray

p._decodeArray = function (node)

Parses <array> elements

_decodeNumber

p._decodeNumber = function (node)

Parses <i4>, <int> and <double> elements

_decodeString

p._decodeString = function (node)

Parses <string> elements

_processParameter

p._processParameter = function (param)

Convert JS entities to XMLRPC entities

p.encode = function (method,
params)
Encode the data in XMLRPC protocol and returns the appropriate string
p.decode = function (response)
Decodes received XML in XMLRPC response format to JS data structure
p.getContentType = function()
Returns the content type of XML document
p.getServerURL = function()
Returns the server URL
p._encodeXMLEntities = function (toEncode)
Converts the passed string to another one with all XML entities encoded correctly
p._removeNonElementNodes = function (node)
Remove all childNodes that are not NonElement Nodes
p._decodeMethodResponse = function (node)
Parses methodResponse element and resturns its value
p._decodeValue = function (node)
Parses value elements
p._decodeStruct = function (node)
Parses struct elements
p._decodeArray = function (node)
Parses array elements
p._decodeNumber = function (node)
Parses i4, int and double elements
p._decodeString = function (node)
Parses string elements
p._processParameter = function (param)
Convert JS entities to XMLRPC entities