PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Web Services » SOAP » Bug #7224

Children of ComplexTypes

Details

Submitted2006-03-28 09:12 UTC
Frommarkus at emedia-solutions-wolf dot de
Assignedyunosh
StatusClosed
PackageSOAP
PHP VersionIrrelevant
OSLinux
Roadmaps(Not assigned)

Comments

[2006-03-28 09:12 UTC] markus at emedia-solutions-wolf dot de

Description:
------------
When one wants to get a child of a complex type but the complex type is a struct, then the method getComplexTypeChildType returns null.
This is, because the the method getComplexTypeForElement always returns null for struct types.
To get the child type in this case the method should be patched (see code below).

function getComplexTypeChildType($ns, $name, $child_ns, $child_name)
{
// is the type an element?
$t = $this->_getComplexTypeForElement($name, $ns);
if ($t) {
// no, get it from complex types directly
if (isset($t['elements'][$child_name]['type']))
return $t['elements'][$child_name]['type'];
} else {
// Type is not an element but complex
if (isset($this->ns[$ns]) &&
isset($this->elements[$this->ns[$ns]][$name]['complex']) &&
$this->elements[$this->ns[$ns]][$name]['complex']) {

return $this->elements[$this->ns[$ns]][$name]['elements'][$child_name]['type'];
}
}
return null;
}