Changeset 21410 for branches/version-2_11-dev/data/module/SOAP/Value.php
- Timestamp:
- 2012/01/17 16:32:25 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_11-dev/data/module/SOAP/Value.php
r21318 r21410 41 41 { 42 42 /** 43 * The actual value. 44 * 45 * @var mixed 43 * @var string 46 44 */ 47 45 var $value = null; 48 46 49 47 /** 50 * QName instance representing the value name. 51 * 52 * @var QName 53 */ 48 * @var string 49 */ 50 var $name = ''; 51 52 /** 53 * @var string 54 */ 55 var $type = ''; 56 57 /** 58 * Namespace 59 * 60 * @var string 61 */ 62 var $namespace = ''; 63 var $type_namespace = ''; 64 65 var $attributes = array(); 66 67 /** 68 * @var string 69 */ 70 var $arrayType = ''; 71 72 var $options = array(); 73 54 74 var $nqn; 55 56 /**57 * The value name, without namespace information.58 *59 * @var string60 */61 var $name = '';62 63 /**64 * The namespace of the value name.65 *66 * @var string67 */68 var $namespace = '';69 70 /**71 * QName instance representing the value type.72 *73 * @var QName74 */75 75 var $tqn; 76 77 /**78 * The value type, without namespace information.79 *80 * @var string81 */82 var $type = '';83 84 /**85 * The namespace of the value type.86 *87 * @var string88 */89 var $type_namespace = '';90 91 /**92 * The type of the array elements, if this value is an array.93 *94 * @var string95 */96 var $arrayType = '';97 98 /**99 * A hash of additional attributes.100 *101 * @see SOAP_Value()102 * @var array103 */104 var $attributes = array();105 106 /**107 * List of encoding and serialization options.108 *109 * @see SOAP_Value()110 * @var array111 */112 var $options = array();113 76 114 77 /** … … 119 82 * automatically if not set. 120 83 * @param mixed $value Value to set. 121 * @param array $attributes A has of additional XML attributes to be 122 * added to the serialized value. 123 * @param array $options A list of encoding and serialization options: 124 * - 'attachment': array with information about 125 * the attachment 126 * - 'soap_encoding': defines encoding for SOAP 127 * message part of a MIME encoded SOAP request 128 * (default: base64) 129 * - 'keep_arrays_flat': use the tag name 130 * multiple times for each element when 131 * passing in an array in literal mode 132 * - 'no_type_prefix': supress adding of the 133 * namespace prefix 84 * @param array $attributes Attributes. 134 85 */ 135 86 function SOAP_Value($name = '', $type = false, $value = null, 136 $attributes = array(), $options = array()) 137 { 87 $attributes = array()) 88 { 89 // Detect type if not passed. 138 90 $this->nqn = new QName($name); 139 91 $this->name = $this->nqn->name; 140 92 $this->namespace = $this->nqn->namespace; 141 if ($type) { 142 $this->tqn = new QName($type); 143 $this->type = $this->tqn->name; 144 $this->type_namespace = $this->tqn->namespace; 145 } 93 $this->tqn = new QName($type); 94 $this->type = $this->tqn->name; 95 $this->type_prefix = $this->tqn->ns; 96 $this->type_namespace = $this->tqn->namespace; 146 97 $this->value = $value; 147 98 $this->attributes = $attributes; 148 $this->options = $options;149 99 } 150 100 … … 160 110 { 161 111 return $serializer->_serializeValue($this->value, 162 $this->nqn, 163 $this->tqn, 112 $this->name, 113 $this->type, 114 $this->namespace, 115 $this->type_namespace, 164 116 $this->options, 165 117 $this->attributes, … … 205 157 206 158 if (isset($actor)) { 207 $this->attributes[ SOAP_BASE::SOAPENVPrefix().':actor'] = $actor;208 } elseif (!isset($this->attributes[ SOAP_BASE::SOAPENVPrefix().':actor'])) {209 $this->attributes[ SOAP_BASE::SOAPENVPrefix().':actor'] = 'http://schemas.xmlsoap.org/soap/actor/next';210 } 211 $this->attributes[ SOAP_BASE::SOAPENVPrefix().':mustUnderstand'] = (int)$mustunderstand;159 $this->attributes['SOAP-ENV:actor'] = $actor; 160 } elseif (!isset($this->attributes['SOAP-ENV:actor'])) { 161 $this->attributes['SOAP-ENV:actor'] = 'http://schemas.xmlsoap.org/soap/actor/next'; 162 } 163 $this->attributes['SOAP-ENV:mustUnderstand'] = (int)$mustunderstand; 212 164 } 213 165 … … 232 184 * is provide. 233 185 * @param string $file The attachment data. 234 * @param array $attributes Attributes.235 186 */ 236 187 function SOAP_Attachment($name = '', $type = 'application/octet-stream', 237 $filename, $file = null , $attributes = null)188 $filename, $file = null) 238 189 { 239 190 parent::SOAP_Value($name, null, null); 240 191 241 $filedata = $file === null? $this->_file2str($filename) : $file;192 $filedata = ($file === null) ? $this->_file2str($filename) : $file; 242 193 $filename = basename($filename); 243 194 if (PEAR::isError($filedata)) { … … 248 199 $cid = md5(uniqid(time())); 249 200 250 $this->attributes = $attributes; 251 $this->attributes['href'] = 'cid:' . $cid; 201 $this->attributes['href'] = 'cid:' . $cid; 252 202 253 203 $this->options['attachment'] = array('body' => $filedata,
Note: See TracChangeset
for help on using the changeset viewer.