Qore XML Module: XML-RPC Functions

Qore XML Module 1.1

- Main Page
- Modules
- Namespaces
- Classes

All Classes Namespaces Functions Variables Groups
Functions
XML-RPC Functions

## Functions
string | Qore::Xml::makeFormattedXMLRPCCallString (string method,...)
| Serializes the argument into an XML string in XML-RPC call format with whitespace formatting. More...
string | Qore::Xml::makeFormattedXMLRPCCallStringArgs (string method, any argv)
| Serializes the argument into an XML string in XML-RPC call format with whitespace formatting. More...
string | Qore::Xml::makeFormattedXMLRPCCallStringArgsWithEncoding (string encoding, string method, any argv)
| Serializes the argument into an XML string in XML-RPC call format with whitespace formatting. More...
string | Qore::Xml::makeFormattedXMLRPCCallStringWithEncoding (string encoding, string method,...)
| Serializes the argument into an XML string in XML-RPC call format with whitespace formatting with an explicit encoding. More...
string | Qore::Xml::makeFormattedXMLRPCFaultResponseString (softint code, string msg)
| Serializes the argument into an XML string in XML-RPC fault response format with whitespace formatting. More...
string | Qore::Xml::makeFormattedXMLRPCFaultResponseStringWithEncoding (string encoding, softint code, string msg)
| Serializes the argument into an XML string in XML-RPC fault response format with whitespace formatting with an explicit output encoding. More...
string | Qore::Xml::makeFormattedXMLRPCResponseString (...)
| Serializes the arguments into an XML string formatted for an XML-RPC response with whitespace formatting. More...
string | Qore::Xml::makeFormattedXMLRPCResponseStringWithEncoding (string encoding,...)
| Serializes the arguments into an XML string formatted for an XML-RPC response with whitespace formatting and with an explicit output encoding. More...
*string | Qore::Xml::makeFormattedXMLRPCValueString (any value, *string encoding)
| Serializes the arguments into an XML string in XML-RPC value format with whitespace formatting but without an XML header. More...
string | Qore::Xml::makeXMLRPCCallString (string method,...)
| Serializes the argument into an XML string in XML-RPC call format without whitespace formatting. More...
string | Qore::Xml::makeXMLRPCCallStringArgs (string method, any args)
| Serializes the argument into an XML string in XML-RPC call format without whitespace formatting. More...
string | Qore::Xml::makeXMLRPCCallStringArgsWithEncoding (string encoding, string method, any args)
| Serializes the argument into an XML string in XML-RPC call format without whitespace formatting with an explicit encoding. More...
string | Qore::Xml::makeXMLRPCCallStringWithEncoding (string encoding, string method,...)
| Serializes the argument into an XML string in XML-RPC call format without whitespace formatting with an explicit encoding. More...
string | Qore::Xml::makeXMLRPCFaultResponseString (softint code, string msg)
| Serializes the argument into an XML string in XML-RPC fault response format without whitespace formatting. More...
string | Qore::Xml::makeXMLRPCFaultResponseStringWithEncoding (string encoding, softint code, string msg)
| Serializes the argument into an XML string in XML-RPC fault response format without whitespace formatting with an explicit output encoding. More...
string | Qore::Xml::makeXMLRPCResponseString (...)
| Serializes the arguments into an XML string formatted for an XML-RPC response without whitespace formatting. More...
string | Qore::Xml::makeXMLRPCResponseStringWithEncoding (string encoding,...)
| Serializes the arguments into an XML string formatted for an XML-RPC response without whitespace formatting and with an explicit output encoding. More...
*string | Qore::Xml::makeXMLRPCValueString (any value, *string encoding)
| Serializes the arguments into an XML string in XML-RPC value format without whitespace formatting and without an XML header. More...
hash | Qore::Xml::parseXMLRPCCall (string xml, *string encoding)
| Deserializies an XML-RPC call string, returning a Qore data structure representing the call information. More...
nothing | Qore::Xml::parseXMLRPCCall ()
| This is a variant that is basically a noop, included for backwards-compatibility for functions that ignored type errors in the calling parameters. More...
hash | Qore::Xml::parseXMLRPCResponse (string xml, *string encoding)
| Deserializies an XML-RPC response string, returning a Qore data structure representing the response information. More...
nothing | Qore::Xml::parseXMLRPCResponse ()
| This is a variant that is basically a noop, included for backwards-compatibility for functions that ignored type errors in the calling parameters. More...
any | Qore::Xml::parseXMLRPCValue (string xml, *string encoding)
| Deserializies an XML-RPC value string and returns a Qore data structure representing the information. More...
nothing | Qore::Xml::parseXMLRPCValue ()
| This is a variant that is basically a noop, included for backwards-compatibility for functions that ignored type errors in the calling parameters. More...

## Detailed Description

## Function Documentation

string Qore::Xml::makeFormattedXMLRPCCallString | ( | string | method,
|  |  | ...
| ) |  |

Serializes the argument into an XML string in XML-RPC call format with whitespace formatting.

Code Flags:
  RET_VALUE_ONLY

Parameters

  method | the method name for the XML-RPC call
  ... | additional arguments are serialized according to the default XML-RPC serialization rules

Returns
  an XML string in XML-RPC call format in the default encoding, with whitespace formatting

Exceptions

  XMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object)

Example:
  my string $xmlcall = makeFormattedXMLRPCCallString("omq.system.start-workflow", $hash);

See Also
  XML-RPC

string Qore::Xml::makeFormattedXMLRPCCallStringArgs | ( | string | method,
|  | any | argv
| ) |  |

Serializes the argument into an XML string in XML-RPC call format with whitespace formatting.

Code Flags:
  RET_VALUE_ONLY

Parameters

  method | the method name for the XML-RPC call
  argv | a single argument or a list of arguments to the call

Returns
  an XML string in XML-RPC call format in the default encoding, with whitespace formatting

Exceptions

  XMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object)

Example:
  my string $xmlcall = makeFormattedXMLRPCCallStringArgs("omq.system.start-workflow", $hash);

See Also
  XML-RPC

string Qore::Xml::makeFormattedXMLRPCCallStringArgsWithEncoding | ( | string | encoding,
|  | string | method,
|  | any | argv
| ) |  |

Serializes the argument into an XML string in XML-RPC call format with whitespace formatting.

Code Flags:
  RET_VALUE_ONLY

Parameters

  encoding | a string giving the output encoding for the resulting XML string
  method | the method name for the XML-RPC call
  argv | a single argument or a list of arguments to the call

Returns
  a string in XML-RPC call format in the encoding given by the first argument, with whitespace formatting

Exceptions

  XMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object)

Example:
  my string $xmlcall = makeFormattedXMLRPCCallStringArgsWithEncoding("utf8", "omq.system.start-workflow", $hash);

See Also
  XML-RPC

string Qore::Xml::makeFormattedXMLRPCCallStringWithEncoding | ( | string | encoding,
|  | string | method,
|  |  | ...
| ) |  |

Serializes the argument into an XML string in XML-RPC call format with whitespace formatting with an explicit encoding.

Code Flags:
  RET_VALUE_ONLY

Parameters

  encoding | a string giving the output encoding for the resulting XML string
  method | the method name for the XML-RPC call

Additional arguments are serialized according to the default XML-RPC serialization rules

Returns
  an XML string in XML-RPC call format in the encoding given by the first argument, with whitespace formatting

Exceptions

  XMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object)

Example:
  my string $xmlcall = makeFormattedXMLRPCCallStringWithEncoding("utf8", "omq.system.start-workflow", $hash);

See Also
  XML-RPC

string Qore::Xml::makeFormattedXMLRPCFaultResponseString | ( | softint | code,
|  | string | msg
| ) |  |

Serializes the argument into an XML string in XML-RPC fault response format with whitespace formatting.

Code Flags:
  CONSTANT

Parameters

  code | the fault code for the response; will be converted to an integer (stored under key `'faultCode'` as an int)
  msg | the fault message string; the encoding of this argument will define the output encoding of the fault string returned (stored under key `'faultString'` as a string)

Returns
  a string in XML-RPC fault format in the same encoding as given by the $msg argument, with whitespace formatting

Example:
  my string $response = makeFormattedXMLRPCFaultResponseString(500, $errmsg);

See Also
  XML-RPC

string Qore::Xml::makeFormattedXMLRPCFaultResponseStringWithEncoding | ( | string | encoding,
|  | softint | code,
|  | string | msg
| ) |  |

Serializes the argument into an XML string in XML-RPC fault response format with whitespace formatting with an explicit output encoding.

Code Flags:
  RET_VALUE_ONLY

Parameters

  encoding | a string giving the output encoding for the resulting XML string
  code | the fault code for the response; will be converted to an integer (stored under key `'faultCode'` as an int)
  msg | the fault message string (stored under key `'faultString'` as a string)

Returns
  a string in XML-RPC fault format in the encoding given by the first argument, with whitespace formatting

Exceptions

  ENCODING-CONVERSION-ERROR | error converting message string to specified output encoding

Example:
  my string $response = makeFormattedXMLRPCFaultResponseStringWithEncoding("utf8", 500, $errmsg);

See Also
  XML-RPC

string Qore::Xml::makeFormattedXMLRPCResponseString | ( |  | ... | ) |

Serializes the arguments into an XML string formatted for an XML-RPC response with whitespace formatting.

Code Flags:
  RET_VALUE_ONLY

Parameters

  ... | any top-level arguments to the function will be serialized as the top-level params of the response message

Returns
  a string in XML-RPC response format with whitespace formatting; the encoding of the resulting string will always be the default encoding

Exceptions

  XMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object)

Example:
  my string $response = makeFormattedXMLRPCResponseString($answer);

See Also
  XML-RPC

string Qore::Xml::makeFormattedXMLRPCResponseStringWithEncoding | ( | string | encoding,
|  |  | ...
| ) |  |

Serializes the arguments into an XML string formatted for an XML-RPC response with whitespace formatting and with an explicit output encoding.

Code Flags:
  RET_VALUE_ONLY

Parameters

  encoding | a string giving the output encoding for the resulting XML string
  ... | any top-level arguments after the first argument will be serialized as the top-level params of the response message

Returns
  a string in XML-RPC response format with whitespace formatting; the encoding will be that given by the first argument

Exceptions

  XMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object)

Example:
  my string $response = makeFormattedXMLRPCResponseStringWithEncoding("utf8", $answer);

See Also
  XML-RPC

*string Qore::Xml::makeFormattedXMLRPCValueString | ( | any | value,
|  | *string | encoding
| ) |  |

Serializes the arguments into an XML string in XML-RPC value format with whitespace formatting but without an XML header.

Code Flags:
  RET_VALUE_ONLY

Parameters

  value | the value to serialize to XML-RPC format
  encoding | an optional string giving the encoding for the output XML string; if this parameter is missing, the output string will have the default encoding

Returns
  if the $value argument is NOTHING, then NOTHING is returned, otherwise an XML string in XML-RPC value format with whitespace formatting but without an XML header is returned

Exceptions

  XMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object)

Example:
  my *string $val = makeFormattedXMLRPCValueString($v);

See Also
  XML-RPC

string Qore::Xml::makeXMLRPCCallString | ( | string | method,
|  |  | ...
| ) |  |

Serializes the argument into an XML string in XML-RPC call format without whitespace formatting.

Code Flags:
  RET_VALUE_ONLY

Parameters

  method | the method name for the XML-RPC call Additional arguments are serialized according to the default XML-RPC serialization rules

Returns
  an XML string in XML-RPC call format in the default encoding, without whitespace formatting

Exceptions

  XMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object)

Example:
  my string $xmlcall = makeXMLRPCCallString("omq.system.start-workflow", $hash);

See Also
  XML-RPC

string Qore::Xml::makeXMLRPCCallStringArgs | ( | string | method,
|  | any | args
| ) |  |

Serializes the argument into an XML string in XML-RPC call format without whitespace formatting.

Code Flags:
  RET_VALUE_ONLY

Parameters

  method | the method name for the XML-RPC call
  args | a single argument or a list of arguments to the call

Returns
  an XML string in XML-RPC call format in the default encoding, without whitespace formatting

Exceptions

  XMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object)

Example:
  my string $xmlcall = makeXMLRPCCallStringArgs("omq.system.start-workflow", $hash);

See Also
  XML-RPC

string Qore::Xml::makeXMLRPCCallStringArgsWithEncoding | ( | string | encoding,
|  | string | method,
|  | any | args
| ) |  |

Serializes the argument into an XML string in XML-RPC call format without whitespace formatting with an explicit encoding.

Code Flags:
  RET_VALUE_ONLY

Parameters

  encoding | a string giving the output encoding for the resulting XML string
  method | the method name for the XML-RPC call
  args | a single argument or a list of arguments to the call

Returns
  a string in XML-RPC call format in the encoding given by the first argument, without whitespace formatting

Exceptions

  XMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object)

Example:
  my string $xmlcall = makeXMLRPCCallStringArgsWithEncoding("utf8", "omq.system.start-workflow", $hash);

See Also
  XML-RPC

string Qore::Xml::makeXMLRPCCallStringWithEncoding | ( | string | encoding,
|  | string | method,
|  |  | ...
| ) |  |

Serializes the argument into an XML string in XML-RPC call format without whitespace formatting with an explicit encoding.

Code Flags:
  RET_VALUE_ONLY

Parameters

  encoding | a string giving the output encoding for the resulting XML string
  method | the method name for the XML-RPC call Additional arguments are serialized according to the default XML-RPC serialization rules

Returns
  an XML string in XML-RPC call format in the encoding given by the first argument, without whitespace formatting

Exceptions

  XMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object)

Example:
  my string $xmlcall = makeXMLRPCCallStringWithEncoding("utf8", "omq.system.start-workflow", $hash);

See Also
  XML-RPC

string Qore::Xml::makeXMLRPCFaultResponseString | ( | softint | code,
|  | string | msg
| ) |  |

Serializes the argument into an XML string in XML-RPC fault response format without whitespace formatting.

Code Flags:
  CONSTANT

Parameters

  code | the fault code for the response; will be converted to an integer (stored under key `'faultCode'` as an int)
  msg | the fault message string; the encoding of this argument will define the output encoding of the fault string returned (stored under key `'faultString'` as a string)

Returns
  a string in XML-RPC fault format in the same encoding as given by the $msg argument, without whitespace formatting

Example:
  my string $response = makeXMLRPCFaultResponseString(500, $errmsg);

See Also
  XML-RPC

string Qore::Xml::makeXMLRPCFaultResponseStringWithEncoding | ( | string | encoding,
|  | softint | code,
|  | string | msg
| ) |  |

Serializes the argument into an XML string in XML-RPC fault response format without whitespace formatting with an explicit output encoding.

Code Flags:
  RET_VALUE_ONLY

Parameters

  encoding | a string giving the output encoding for the resulting XML string
  code | the fault code for the response; will be converted to an integer (stored under key `'faultCode'` as an int)
  msg | the fault message string (stored under key `'faultString'` as a string)

Returns
  a string in XML-RPC fault format in the encoding given by the first argument, without whitespace formatting

Exceptions

  ENCODING-CONVERSION-ERROR | error converting message string to specified output encoding

Example:
  my string $response = makeXMLRPCFaultResponseStringWithEncoding("utf8", 500, $errmsg);

See Also
  XML-RPC

string Qore::Xml::makeXMLRPCResponseString | ( |  | ... | ) |

Serializes the arguments into an XML string formatted for an XML-RPC response without whitespace formatting.

Any top-level arguments to the function will be serialized as the top-level params of the response message

Returns
  a string in XML-RPC response format; the encoding of the resulting string will always be the default encoding

Exceptions

  XMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object)

Code Flags:
  RET_VALUE_ONLY

Example:
  my string $response = makeXMLRPCResponseString($answer);

See Also
  XML-RPC

string Qore::Xml::makeXMLRPCResponseStringWithEncoding | ( | string | encoding,
|  |  | ...
| ) |  |

Serializes the arguments into an XML string formatted for an XML-RPC response without whitespace formatting and with an explicit output encoding.

Code Flags:
  RET_VALUE_ONLY

Parameters

  encoding | a string giving the output encoding for the resulting XML string Any top-level arguments after the first argument will be serialized as the top-level params of the response message

Returns
  a string in XML-RPC response format; the encoding will be that given by the first argument

Exceptions

  XMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object)

Example:
  my string $response = makeXMLRPCResponseStringWithEncoding("utf8", $answer);

See Also
  XML-RPC

*string Qore::Xml::makeXMLRPCValueString | ( | any | value,
|  | *string | encoding
| ) |  |

Serializes the arguments into an XML string in XML-RPC value format without whitespace formatting and without an XML header.

Code Flags:
  RET_VALUE_ONLY

Parameters

  value | the value to serialize to XML-RPC format
  encoding | an optional string giving the encoding for the output XML string; if this parameter is missing, the output string will have the default encoding

Returns
  if the $value argument is NOTHING, then NOTHING is returned, otherwise an XML string in XML-RPC value format without whitespace formatting and without an XML header is returned

Exceptions

  XMLRPC-SERIALIZATION-ERROR | empty member name in hash or cannot serialize type to XML-RPC (ex: object)

Example:
  my *string $val = makeXMLRPCValueString($v);

See Also
  XML-RPC

hash Qore::Xml::parseXMLRPCCall | ( | string | xml,
|  | *string | encoding
| ) |  |

Deserializies an XML-RPC call string, returning a Qore data structure representing the call information.

Code Flags:
  RET_VALUE_ONLY

Parameters

  xml | the XML string in XML-RPC call format to deserialize
  encoding | an optional string giving the string encoding of any strings output; if this parameter is missing, the any strings output in the output hash will have the default encoding

Returns
  a hash representing the XML-RPC call with the following keys:
  - `methodName:` the name of the method being called
  - `params:` the arguments to the method

Exceptions

  PARSE-XMLRPC-CALL-ERROR | missing 'methodCall' or 'methodName' element or other syntax error
  PARSE-XMLRPC-ERROR | syntax error parsing XML-RPC string

Example:
  my hash $h = parseXMLRPCCall($xml);

See Also
  XML-RPC

nothing Qore::Xml::parseXMLRPCCall | ( |  | ) |

This is a variant that is basically a noop, included for backwards-compatibility for functions that ignored type errors in the calling parameters.

Code Flags:
  RUNTIME_NOOP

hash Qore::Xml::parseXMLRPCResponse | ( | string | xml,
|  | *string | encoding
| ) |  |

Deserializies an XML-RPC response string, returning a Qore data structure representing the response information.

Code Flags:
  RET_VALUE_ONLY

Parameters

  xml | the XML string in XML-RPC call format to deserialize
  encoding | an optional string giving the string encoding of any strings output; if this parameter is missing, the any strings output in the output hash will have the default encoding

Returns
  a hash with one of the following keys:
  - `fault:` a hash describing a fault response
  - `params:` a hash describing a normal, non-fault response

Exceptions

  PARSE-XMLRPC-RESPONSE-ERROR | missing required element or other syntax error
  PARSE-XMLRPC-ERROR | syntax error parsing XML-RPC string

Example:
  my hash $h = parseXMLRPCResponse($xml);

See Also
  XML-RPC

nothing Qore::Xml::parseXMLRPCResponse | ( |  | ) |

This is a variant that is basically a noop, included for backwards-compatibility for functions that ignored type errors in the calling parameters.

Code Flags:
  RUNTIME_NOOP

any Qore::Xml::parseXMLRPCValue | ( | string | xml,
|  | *string | encoding
| ) |  |

Deserializies an XML-RPC value string and returns a Qore data structure representing the information.

Code Flags:
  RET_VALUE_ONLY

Parameters

  xml | the XML string in XML-RPC value format to deserialize
  encoding | an optional string giving the string encoding of any strings output; if this parameter is missing, the any strings output in the output hash will have the default encoding

Returns
  the Qore value corresponding to the XML-RPC value string

Exceptions

  PARSE-XMLRPC-ERROR | syntax error parsing XML-RPC string

Example:
  my any $data = parseXMLRPCValue($xml);

See Also
  XML-RPC

nothing Qore::Xml::parseXMLRPCValue | ( |  | ) |

This is a variant that is basically a noop, included for backwards-compatibility for functions that ignored type errors in the calling parameters.

Code Flags:
  RUNTIME_NOOP