thekid/rfc — Issue #128: RFC 0128: webservices.xmlrpc handling of NULL
Author: thekid
Created: 2011-10-09 15:16:59+00:00
State: open
Labels: implemented, rfc

Scope of Change
====
The XmlRpcDecoder and XmlRpcEncoder classes will provide functionality
to handle NULL values.

Rationale
====
- Prevent thrown exceptions when trying to encode/decode NULL.

Functionality
====
In cases where the encoder/decoder gets a value containing NULL an
exception is thrown. Although the xml-rpc specification does not cover
handling of NULL, there is an extension[1] solving this problem.
According to this extension NULL will be encoded as .

Example structure
----

lowerBound
18

upperBound

Changes in webservices.xmlrpc.XmlRpcDecoder
----

```php
children[0]->getName()) {
[...]
case 'nil':
$n= NULL;
return $n;
[...]
}

Changes in webservices.xmlrpc.XmlRpcEncoder
----

switch (xp::typeOf($data)) {
[...]
case 'NULL':
$value->addChild(new Node('nil'));
break;
[...]
}

Security considerations
====
n/a

Speed impact
====
n/a

Dependencies
====
n/a

Related documents
====
- http://ontosys.com/xml-rpc/extensions.php
[1] XML-RPC nil extension

Comments
====