I have a Java based XMLRPC server which sends back a struct from a method call. In this struct there can be many key/value pairs where the value is a blank string.

These blank strings don't get added to the returned struct (array). The check 'empty($member->value)' is catching this case and preventing the value from being added to the struct. From reading the spec this is perfectly valid. An example XML (part) output is

<member>
 <name>
address </name>
 <value></value>
 </member>

which should be valid because if no type is defined in between <value></value> then string is assumed. (Similar discussion http://framework.zend.com/issues/browse/ZF-1364)

The relavent code is Zend/XmlRpc/Value.php:371

               // Parse all the memebers of the struct from the XML string
               // (simple xml element) to Zend_XmlRpc_Value objects
               foreach ($value->member as $member) {
// @todo? If a member doesn't have a <value> tag, we don't add it to the struct
                   // Maybe we want to throw an exception here ?
if ((!$member->value instanceof SimpleXMLElement) || empty($member->value)) {
                       continue;
//throw new Zend_XmlRpc_Value_Exception('Member of the '. self::XMLRPC_TYPE_STRUCT .' XML-RPC native type must contain a VALUE tag');
                   }
$values[(string)$member->name] = self::_xmlStringToNativeXmlRpc($member->value);
               }

Should I create a bug report for this?

--

James Lucas



--
UTS CRICOS Provider Code:  00099F
DISCLAIMER: This email message and any accompanying attachments may contain
confidential information.  If you are not the intended recipient, do not
read, use, disseminate, distribute or copy this message or attachments.  If
you have received this message in error, please notify the sender
immediately and delete this message. Any views expressed in this message
are those of the individual sender, except where the sender expressly, and
with authority, states them to be the views the University of Technology,
Sydney. Before opening any attachments, please check them for viruses and
defects.

Reply via email to