7 * For creating serializable abstractions of native PHP types. This class
8 * allows element name/namespace, XSD type, and XML attributes to be
9 * associated with a value. This is extremely useful when WSDL is not
10 * used, but is also useful when WSDL is used with polymorphic types, including
11 * xsd:anyType and user-defined types.
13 * @author Dietrich Ayala <dietrich@ganx4.com>
14 * @version $Id: class.soap_val.php,v 1.11 2007/04/06 13:56:32 snichol Exp $
17 class soapval extends nusoap_base {
19 * The XML element name
26 * The XML type name (string or false)
40 * The XML element namespace (string or false)
47 * The XML type namespace (string or false)
54 * The XML element attributes (array or false)
64 * @param string $name optional name
65 * @param mixed $type optional type name
66 * @param mixed $value optional value
67 * @param mixed $element_ns optional namespace of value
68 * @param mixed $type_ns optional namespace of type
69 * @param mixed $attributes associative array of attributes to add to element serialization
72 function soapval($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) {
73 parent::nusoap_base();
76 $this->value = $value;
77 $this->element_ns = $element_ns;
78 $this->type_ns = $type_ns;
79 $this->attributes = $attributes;
83 * return serialized value
85 * @param string $use The WSDL use value (encoded|literal)
86 * @return string XML data
89 function serialize($use='encoded') {
90 return $this->serialize_val($this->value, $this->name, $this->type, $this->element_ns, $this->type_ns, $this->attributes, $use, true);
94 * decodes a soapval object into a PHP native type