/** * Override some of the default SOAP:: package _decode behavior to * handle simpleTypes and complexTypes with simpleContent. */ function &_decode(&$soapval) { if (count($soapval->attributes)) { $attributes = $soapval->attributes; } $object =& PayPal::getType($soapval->type); if (PayPal::isError($object)) { return parent::_decode($soapval); } $this->_type_translation[$soapval->type] = $soapval->type; $result =& parent::_decode($soapval); if (!is_a($result, 'XSDType') && is_a($object, 'XSDSimpleType')) { $object->setval($result); if (isset($attributes)) { foreach ($attributes as $aname => $attribute) { $object->setattr($aname, $attribute); } } $result =& $object; } return $result; }