| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
$GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel = 9; |
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
class nusoap_base { |
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
var $title = 'NuSOAP'; |
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 |
var $version = '0.7.2'; |
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
var $revision = '$Revision: 1.94 $'; |
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 |
|
|---|
| 93 |
var $error_str = ''; |
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
var $debug_str = ''; |
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
var $charencoding = true; |
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 |
|
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 |
var $debugLevel; |
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 |
|
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 |
var $XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema'; |
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 |
var $soap_defencoding = 'ISO-8859-1'; |
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 |
|
|---|
| 138 |
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 |
var $namespaces = array( |
|---|
| 143 |
'SOAP-ENV' => 'http://schemas.xmlsoap.org/soap/envelope/', |
|---|
| 144 |
'xsd' => 'http://www.w3.org/2001/XMLSchema', |
|---|
| 145 |
'xsi' => 'http://www.w3.org/2001/XMLSchema-instance', |
|---|
| 146 |
'SOAP-ENC' => 'http://schemas.xmlsoap.org/soap/encoding/' |
|---|
| 147 |
); |
|---|
| 148 |
|
|---|
| 149 |
|
|---|
| 150 |
|
|---|
| 151 |
|
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 |
|
|---|
| 155 |
var $usedNamespaces = array(); |
|---|
| 156 |
|
|---|
| 157 |
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 |
var $typemap = array( |
|---|
| 165 |
'http://www.w3.org/2001/XMLSchema' => array( |
|---|
| 166 |
'string'=>'string','boolean'=>'boolean','float'=>'double','double'=>'double','decimal'=>'double', |
|---|
| 167 |
'duration'=>'','dateTime'=>'string','time'=>'string','date'=>'string','gYearMonth'=>'', |
|---|
| 168 |
'gYear'=>'','gMonthDay'=>'','gDay'=>'','gMonth'=>'','hexBinary'=>'string','base64Binary'=>'string', |
|---|
| 169 |
|
|---|
| 170 |
'anyType'=>'string','anySimpleType'=>'string', |
|---|
| 171 |
|
|---|
| 172 |
'normalizedString'=>'string','token'=>'string','language'=>'','NMTOKEN'=>'','NMTOKENS'=>'','Name'=>'','NCName'=>'','ID'=>'', |
|---|
| 173 |
'IDREF'=>'','IDREFS'=>'','ENTITY'=>'','ENTITIES'=>'','integer'=>'integer','nonPositiveInteger'=>'integer', |
|---|
| 174 |
'negativeInteger'=>'integer','long'=>'integer','int'=>'integer','short'=>'integer','byte'=>'integer','nonNegativeInteger'=>'integer', |
|---|
| 175 |
'unsignedLong'=>'','unsignedInt'=>'','unsignedShort'=>'','unsignedByte'=>'','positiveInteger'=>''), |
|---|
| 176 |
'http://www.w3.org/2000/10/XMLSchema' => array( |
|---|
| 177 |
'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double', |
|---|
| 178 |
'float'=>'double','dateTime'=>'string', |
|---|
| 179 |
'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'), |
|---|
| 180 |
'http://www.w3.org/1999/XMLSchema' => array( |
|---|
| 181 |
'i4'=>'','int'=>'integer','boolean'=>'boolean','string'=>'string','double'=>'double', |
|---|
| 182 |
'float'=>'double','dateTime'=>'string', |
|---|
| 183 |
'timeInstant'=>'string','base64Binary'=>'string','base64'=>'string','ur-type'=>'array'), |
|---|
| 184 |
'http://soapinterop.org/xsd' => array('SOAPStruct'=>'struct'), |
|---|
| 185 |
'http://schemas.xmlsoap.org/soap/encoding/' => array('base64'=>'string','array'=>'array','Array'=>'array'), |
|---|
| 186 |
'http://xml.apache.org/xml-soap' => array('Map') |
|---|
| 187 |
); |
|---|
| 188 |
|
|---|
| 189 |
|
|---|
| 190 |
|
|---|
| 191 |
|
|---|
| 192 |
|
|---|
| 193 |
|
|---|
| 194 |
|
|---|
| 195 |
|
|---|
| 196 |
|
|---|
| 197 |
var $xmlEntities = array('quot' => '"','amp' => '&', |
|---|
| 198 |
'lt' => '<','gt' => '>','apos' => "'"); |
|---|
| 199 |
|
|---|
| 200 |
|
|---|
| 201 |
|
|---|
| 202 |
|
|---|
| 203 |
|
|---|
| 204 |
|
|---|
| 205 |
function nusoap_base() { |
|---|
| 206 |
$this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel; |
|---|
| 207 |
} |
|---|
| 208 |
|
|---|
| 209 |
|
|---|
| 210 |
|
|---|
| 211 |
|
|---|
| 212 |
|
|---|
| 213 |
|
|---|
| 214 |
|
|---|
| 215 |
function getGlobalDebugLevel() { |
|---|
| 216 |
return $GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel; |
|---|
| 217 |
} |
|---|
| 218 |
|
|---|
| 219 |
|
|---|
| 220 |
|
|---|
| 221 |
|
|---|
| 222 |
|
|---|
| 223 |
|
|---|
| 224 |
|
|---|
| 225 |
function setGlobalDebugLevel($level) { |
|---|
| 226 |
$GLOBALS['_transient']['static']['nusoap_base']->globalDebugLevel = $level; |
|---|
| 227 |
} |
|---|
| 228 |
|
|---|
| 229 |
|
|---|
| 230 |
|
|---|
| 231 |
|
|---|
| 232 |
|
|---|
| 233 |
|
|---|
| 234 |
|
|---|
| 235 |
function getDebugLevel() { |
|---|
| 236 |
return $this->debugLevel; |
|---|
| 237 |
} |
|---|
| 238 |
|
|---|
| 239 |
|
|---|
| 240 |
|
|---|
| 241 |
|
|---|
| 242 |
|
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 |
function setDebugLevel($level) { |
|---|
| 246 |
$this->debugLevel = $level; |
|---|
| 247 |
} |
|---|
| 248 |
|
|---|
| 249 |
|
|---|
| 250 |
|
|---|
| 251 |
|
|---|
| 252 |
|
|---|
| 253 |
|
|---|
| 254 |
|
|---|
| 255 |
function debug($string){ |
|---|
| 256 |
if ($this->debugLevel > 0) { |
|---|
| 257 |
$this->appendDebug($this->getmicrotime().' '.get_class($this).": $string\n"); |
|---|
| 258 |
} |
|---|
| 259 |
} |
|---|
| 260 |
|
|---|
| 261 |
|
|---|
| 262 |
|
|---|
| 263 |
|
|---|
| 264 |
|
|---|
| 265 |
|
|---|
| 266 |
|
|---|
| 267 |
function appendDebug($string){ |
|---|
| 268 |
if ($this->debugLevel > 0) { |
|---|
| 269 |
|
|---|
| 270 |
|
|---|
| 271 |
$this->debug_str .= $string; |
|---|
| 272 |
} |
|---|
| 273 |
} |
|---|
| 274 |
|
|---|
| 275 |
|
|---|
| 276 |
|
|---|
| 277 |
|
|---|
| 278 |
|
|---|
| 279 |
|
|---|
| 280 |
function clearDebug() { |
|---|
| 281 |
|
|---|
| 282 |
|
|---|
| 283 |
$this->debug_str = ''; |
|---|
| 284 |
} |
|---|
| 285 |
|
|---|
| 286 |
|
|---|
| 287 |
|
|---|
| 288 |
|
|---|
| 289 |
|
|---|
| 290 |
|
|---|
| 291 |
|
|---|
| 292 |
function &getDebug() { |
|---|
| 293 |
|
|---|
| 294 |
|
|---|
| 295 |
return $this->debug_str; |
|---|
| 296 |
} |
|---|
| 297 |
|
|---|
| 298 |
|
|---|
| 299 |
|
|---|
| 300 |
|
|---|
| 301 |
|
|---|
| 302 |
|
|---|
| 303 |
|
|---|
| 304 |
|
|---|
| 305 |
function &getDebugAsXMLComment() { |
|---|
| 306 |
|
|---|
| 307 |
|
|---|
| 308 |
while (strpos($this->debug_str, '--')) { |
|---|
| 309 |
$this->debug_str = str_replace('--', '- -', $this->debug_str); |
|---|
| 310 |
} |
|---|
| 311 |
return "<!--\n" . $this->debug_str . "\n-->"; |
|---|
| 312 |
} |
|---|
| 313 |
|
|---|
| 314 |
|
|---|
| 315 |
|
|---|
| 316 |
|
|---|
| 317 |
|
|---|
| 318 |
|
|---|
| 319 |
|
|---|
| 320 |
function expandEntities($val) { |
|---|
| 321 |
if ($this->charencoding) { |
|---|
| 322 |
$val = str_replace('&', '&', $val); |
|---|
| 323 |
$val = str_replace("'", ''', $val); |
|---|
| 324 |
$val = str_replace('"', '"', $val); |
|---|
| 325 |
$val = str_replace('<', '<', $val); |
|---|
| 326 |
$val = str_replace('>', '>', $val); |
|---|
| 327 |
} |
|---|
| 328 |
return $val; |
|---|
| 329 |
} |
|---|
| 330 |
|
|---|
| 331 |
|
|---|
| 332 |
|
|---|
| 333 |
|
|---|
| 334 |
|
|---|
| 335 |
|
|---|
| 336 |
|
|---|
| 337 |
function getError(){ |
|---|
| 338 |
if($this->error_str != ''){ |
|---|
| 339 |
return $this->error_str; |
|---|
| 340 |
} |
|---|
| 341 |
return false; |
|---|
| 342 |
} |
|---|
| 343 |
|
|---|
| 344 |
|
|---|
| 345 |
|
|---|
| 346 |
|
|---|
| 347 |
|
|---|
| 348 |
|
|---|
| 349 |
|
|---|
| 350 |
function setError($str){ |
|---|
| 351 |
$this->error_str = $str; |
|---|
| 352 |
} |
|---|
| 353 |
|
|---|
| 354 |
|
|---|
| 355 |
|
|---|
| 356 |
|
|---|
| 357 |
|
|---|
| 358 |
|
|---|
| 359 |
|
|---|
| 360 |
|
|---|
| 361 |
function isArraySimpleOrStruct($val) { |
|---|
| 362 |
$keyList = array_keys($val); |
|---|
| 363 |
foreach ($keyList as $keyListValue) { |
|---|
| 364 |
if (!is_int($keyListValue)) { |
|---|
| 365 |
return 'arrayStruct'; |
|---|
| 366 |
} |
|---|
| 367 |
} |
|---|
| 368 |
return 'arraySimple'; |
|---|
| 369 |
} |
|---|
| 370 |
|
|---|
| 371 |
|
|---|
| 372 |
|
|---|
| 373 |
|
|---|
| 374 |
|
|---|
| 375 |
|
|---|
| 376 |
|
|---|
| 377 |
|
|---|
| 378 |
|
|---|
| 379 |
|
|---|
| 380 |
|
|---|
| 381 |
|
|---|
| 382 |
|
|---|
| 383 |
|
|---|
| 384 |
|
|---|
| 385 |
function serialize_val($val,$name=false,$type=false,$name_ns=false,$type_ns=false,$attributes=false,$use='encoded'){ |
|---|
| 386 |
$this->debug("in serialize_val: name=$name, type=$type, name_ns=$name_ns, type_ns=$type_ns, use=$use"); |
|---|
| 387 |
$this->appendDebug('value=' . $this->varDump($val)); |
|---|
| 388 |
$this->appendDebug('attributes=' . $this->varDump($attributes)); |
|---|
| 389 |
|
|---|
| 390 |
if(is_object($val) && get_class($val) == 'soapval'){ |
|---|
| 391 |
return $val->serialize($use); |
|---|
| 392 |
} |
|---|
| 393 |
|
|---|
| 394 |
if (is_numeric($name)) { |
|---|
| 395 |
$name = '__numeric_' . $name; |
|---|
| 396 |
} elseif (! $name) { |
|---|
| 397 |
$name = 'noname'; |
|---|
| 398 |
} |
|---|
| 399 |
|
|---|
| 400 |
$xmlns = ''; |
|---|
| 401 |
if($name_ns){ |
|---|
| 402 |
$prefix = 'nu'.rand(1000,9999); |
|---|
| 403 |
$name = $prefix.':'.$name; |
|---|
| 404 |
$xmlns .= " xmlns:$prefix=\"$name_ns\""; |
|---|
| 405 |
} |
|---|
| 406 |
|
|---|
| 407 |
if($type_ns != '' && $type_ns == $this->namespaces['xsd']){ |
|---|
| 408 |
|
|---|
| 409 |
|
|---|
| 410 |
$type_prefix = 'xsd'; |
|---|
| 411 |
} elseif($type_ns){ |
|---|
| 412 |
$type_prefix = 'ns'.rand(1000,9999); |
|---|
| 413 |
$xmlns .= " xmlns:$type_prefix=\"$type_ns\""; |
|---|
| 414 |
} |
|---|
| 415 |
|
|---|
| 416 |
$atts = ''; |
|---|
| 417 |
if($attributes){ |
|---|
| 418 |
foreach($attributes as $k => $v){ |
|---|
| 419 |
$atts .= " $k=\"".$this->expandEntities($v).'"'; |
|---|
| 420 |
} |
|---|
| 421 |
} |
|---|
| 422 |
|
|---|
| 423 |
if (is_null($val)) { |
|---|
| 424 |
if ($use == 'literal') { |
|---|
| 425 |
|
|---|
| 426 |
return "<$name$xmlns $atts/>"; |
|---|
| 427 |
} else { |
|---|
| 428 |
if (isset($type) && isset($type_prefix)) { |
|---|
| 429 |
$type_str = " xsi:type=\"$type_prefix:$type\""; |
|---|
| 430 |
} else { |
|---|
| 431 |
$type_str = ''; |
|---|
| 432 |
} |
|---|
| 433 |
return "<$name$xmlns$type_str $atts xsi:nil=\"true\"/>"; |
|---|
| 434 |
} |
|---|
| 435 |
} |
|---|
| 436 |
|
|---|
| 437 |
if($type != '' && isset($this->typemap[$this->XMLSchemaVersion][$type])){ |
|---|
| 438 |
if (is_bool($val)) { |
|---|
| 439 |
if ($type == 'boolean') { |
|---|
| 440 |
$val = $val ? 'true' : 'false'; |
|---|
| 441 |
} elseif (! $val) { |
|---|
| 442 |
$val = 0; |
|---|
| 443 |
} |
|---|
| 444 |
} else if (is_string($val)) { |
|---|
| 445 |
$val = $this->expandEntities($val); |
|---|
| 446 |
} |
|---|
| 447 |
if ($use == 'literal') { |
|---|
| 448 |
return "<$name$xmlns $atts>$val</$name>"; |
|---|
| 449 |
} else { |
|---|
| 450 |
return "<$name$xmlns $atts xsi:type=\"xsd:$type\">$val</$name>"; |
|---|
| 451 |
} |
|---|
| 452 |
} |
|---|
| 453 |
|
|---|
| 454 |
$xml = ''; |
|---|
| 455 |
switch(true) { |
|---|
| 456 |
case (is_bool($val) || $type == 'boolean'): |
|---|
| 457 |
if ($type == 'boolean') { |
|---|
| 458 |
$val = $val ? 'true' : 'false'; |
|---|
| 459 |
} elseif (! $val) { |
|---|
| 460 |
$val = 0; |
|---|
| 461 |
} |
|---|
| 462 |
if ($use == 'literal') { |
|---|
| 463 |
$xml .= "<$name$xmlns $atts>$val</$name>"; |
|---|
| 464 |
} else { |
|---|
| 465 |
$xml .= "<$name$xmlns xsi:type=\"xsd:boolean\"$atts>$val</$name>"; |
|---|
| 466 |
} |
|---|
| 467 |
break; |
|---|
| 468 |
case (is_int($val) || is_long($val) || $type == 'int'): |
|---|
| 469 |
if ($use == 'literal') { |
|---|
| 470 |
$xml .= "<$name$xmlns $atts>$val</$name>"; |
|---|
| 471 |
} else { |
|---|
| 472 |
$xml .= "<$name$xmlns xsi:type=\"xsd:int\"$atts>$val</$name>"; |
|---|
| 473 |
} |
|---|
| 474 |
break; |
|---|
| 475 |
case (is_float($val)|| is_double($val) || $type == 'float'): |
|---|
| 476 |
if ($use == 'literal') { |
|---|
| 477 |
$xml .= "<$name$xmlns $atts>$val</$name>"; |
|---|
| 478 |
} else { |
|---|
| 479 |
$xml .= "<$name$xmlns xsi:type=\"xsd:float\"$atts>$val</$name>"; |
|---|
| 480 |
} |
|---|
| 481 |
break; |
|---|
| 482 |
case (is_string($val) || $type == 'string'): |
|---|
| 483 |
$val = $this->expandEntities($val); |
|---|
| 484 |
if ($use == 'literal') { |
|---|
| 485 |
$xml .= "<$name$xmlns $atts>$val</$name>"; |
|---|
| 486 |
} else { |
|---|
| 487 |
$xml .= "<$name$xmlns xsi:type=\"xsd:string\"$atts>$val</$name>"; |
|---|
| 488 |
} |
|---|
| 489 |
break; |
|---|
| 490 |
case is_object($val): |
|---|
| 491 |
if (! $name) { |
|---|
| 492 |
$name = get_class($val); |
|---|
| 493 |
$this->debug("In serialize_val, used class name $name as element name"); |
|---|
| 494 |
} else { |
|---|
| 495 |
$this->debug("In serialize_val, do not override name $name for element name for class " . get_class($val)); |
|---|
| 496 |
} |
|---|
| 497 |
foreach(get_object_vars($val) as $k => $v){ |
|---|
| 498 |
$pXml = isset($pXml) ? $pXml.$this->serialize_val($v,$k,false,false,false,false,$use) : $this->serialize_val($v,$k,false,false,false,false,$use); |
|---|
| 499 |
} |
|---|
| 500 |
$xml .= '<'.$name.'>'.$pXml.'</'.$name.'>'; |
|---|
| 501 |
break; |
|---|
| 502 |
break; |
|---|
| 503 |
case (is_array($val) || $type): |
|---|
| 504 |
|
|---|
| 505 |
$valueType = $this->isArraySimpleOrStruct($val); |
|---|
| 506 |
if($valueType=='arraySimple' || ereg('^ArrayOf',$type)){ |
|---|
| 507 |
$i = 0; |
|---|
| 508 |
if(is_array($val) && count($val)> 0){ |
|---|
| 509 |
foreach($val as $v){ |
|---|
| 510 |
if(is_object($v) && get_class($v) == 'soapval'){ |
|---|
| 511 |
$tt_ns = $v->type_ns; |
|---|
| 512 |
$tt = $v->type; |
|---|
| 513 |
} elseif (is_array($v)) { |
|---|
| 514 |
$tt = $this->isArraySimpleOrStruct($v); |
|---|
| 515 |
} else { |
|---|
| 516 |
$tt = gettype($v); |
|---|
| 517 |
} |
|---|
| 518 |
$array_types[$tt] = 1; |
|---|
| 519 |
|
|---|
| 520 |
$xml .= $this->serialize_val($v,'item',false,false,false,false,$use); |
|---|
| 521 |
++$i; |
|---|
| 522 |
} |
|---|
| 523 |
if(count($array_types) > 1){ |
|---|
| 524 |
$array_typename = 'xsd:anyType'; |
|---|
| 525 |
} elseif(isset($tt) && isset($this->typemap[$this->XMLSchemaVersion][$tt])) { |
|---|
| 526 |
if ($tt == 'integer') { |
|---|
| 527 |
$tt = 'int'; |
|---|
| 528 |
} |
|---|
| 529 |
$array_typename = 'xsd:'.$tt; |
|---|
| 530 |
} elseif(isset($tt) && $tt == 'arraySimple'){ |
|---|
| 531 |
$array_typename = 'SOAP-ENC:Array'; |
|---|
| 532 |
} elseif(isset($tt) && $tt == 'arrayStruct'){ |
|---|
| 533 |
$array_typename = 'unnamed_struct_use_soapval'; |
|---|
| 534 |
} else { |
|---|
| 535 |
|
|---|
| 536 |
if ($tt_ns != '' && $tt_ns == $this->namespaces['xsd']){ |
|---|
| 537 |
$array_typename = 'xsd:' . $tt; |
|---|
| 538 |
} elseif ($tt_ns) { |
|---|
| 539 |
$tt_prefix = 'ns' . rand(1000, 9999); |
|---|
| 540 |
$array_typename = "$tt_prefix:$tt"; |
|---|
| 541 |
$xmlns .= " xmlns:$tt_prefix=\"$tt_ns\""; |
|---|
| 542 |
} else { |
|---|
| 543 |
$array_typename = $tt; |
|---|
| 544 |
} |
|---|
| 545 |
} |
|---|
| 546 |
$array_type = $i; |
|---|
| 547 |
if ($use == 'literal') { |
|---|
| 548 |
$type_str = ''; |
|---|
| 549 |
} else if (isset($type) && isset($type_prefix)) { |
|---|
| 550 |
$type_str = " xsi:type=\"$type_prefix:$type\""; |
|---|
| 551 |
} else { |
|---|
| 552 |
$type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"".$array_typename."[$array_type]\""; |
|---|
| 553 |
} |
|---|
| 554 |
|
|---|
| 555 |
} else { |
|---|
| 556 |
if ($use == 'literal') { |
|---|
| 557 |
$type_str = ''; |
|---|
| 558 |
} else if (isset($type) && isset($type_prefix)) { |
|---|
| 559 |
$type_str = " xsi:type=\"$type_prefix:$type\""; |
|---|
| 560 |
} else { |
|---|
| 561 |
$type_str = " xsi:type=\"SOAP-ENC:Array\" SOAP-ENC:arrayType=\"xsd:anyType[0]\""; |
|---|
| 562 |
} |
|---|
| 563 |
} |
|---|
| 564 |
|
|---|
| 565 |
$xml = "<$name$xmlns$type_str$atts>".$xml."</$name>"; |
|---|
| 566 |
} else { |
|---|
| 567 |
|
|---|
| 568 |
if(isset($type) && isset($type_prefix)){ |
|---|
| 569 |
$type_str = " xsi:type=\"$type_prefix:$type\""; |
|---|
| 570 |
} else { |
|---|
| 571 |
$type_str = ''; |
|---|
| 572 |
} |
|---|
| 573 |
if ($use == 'literal') { |
|---|
| 574 |
$xml .= "<$name$xmlns $atts>"; |
|---|
| 575 |
} else { |
|---|
| 576 |
$xml .= "<$name$xmlns$type_str$atts>"; |
|---|
| 577 |
} |
|---|
| 578 |
foreach($val as $k => $v){ |
|---|
| 579 |
|
|---|
| 580 |
if ($type == 'Map' && $type_ns == 'http://xml.apache.org/xml-soap') { |
|---|
| 581 |
$xml .= '<item>'; |
|---|
| 582 |
$xml .= $this->serialize_val($k,'key',false,false,false,false,$use); |
|---|
| 583 |
$xml .= $this->serialize_val($v,'value',false,false,false,false,$use); |
|---|
| 584 |
$xml .= '</item>'; |
|---|
| 585 |
} else { |
|---|
| 586 |
$xml .= $this->serialize_val($v,$k,false,false,false,false,$use); |
|---|
| 587 |
} |
|---|
| 588 |
} |
|---|
| 589 |
$xml .= "</$name>"; |
|---|
| 590 |
} |
|---|
| 591 |
break; |
|---|
| 592 |
default: |
|---|
| 593 |
$xml .= 'not detected, got '.gettype($val).' for '.$val; |
|---|
| 594 |
break; |
|---|
| 595 |
} |
|---|
| 596 |
return $xml; |
|---|
| 597 |
} |
|---|
| 598 |
|
|---|
| 599 |
|
|---|
| 600 |
|
|---|
| 601 |
|
|---|
| 602 |
|
|---|
| 603 |
|
|---|
| 604 |
|
|---|
| 605 |
|
|---|
| 606 |
|
|---|
| 607 |
|
|---|
| 608 |
|
|---|
| 609 |
|
|---|
| 610 |
|
|---|
| 611 |
function serializeEnvelope($body,$headers=false,$namespaces=array(),$style='rpc',$use='encoded',$encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'){ |
|---|
| 612 |
|
|---|
| 613 |
|
|---|
| 614 |
|
|---|
| 615 |
|
|---|
| 616 |
$this->debug("In serializeEnvelope length=" . strlen($body) . " body (max 1000 characters)=" . substr($body, 0, 1000) . " style=$style use=$use encodingStyle=$encodingStyle"); |
|---|
| 617 |
$this->debug("headers:"); |
|---|
| 618 |
$this->appendDebug($this->varDump($headers)); |
|---|
| 619 |
$this->debug("namespaces:"); |
|---|
| 620 |
$this->appendDebug($this->varDump($namespaces)); |
|---|
| 621 |
|
|---|
| 622 |
|
|---|
| 623 |
$ns_string = ''; |
|---|
| 624 |
foreach(array_merge($this->namespaces,$namespaces) as $k => $v){ |
|---|
| 625 |
$ns_string .= " xmlns:$k=\"$v\""; |
|---|
| 626 |
} |
|---|
| 627 |
if($encodingStyle) { |
|---|
| 628 |
$ns_string = " SOAP-ENV:encodingStyle=\"$encodingStyle\"$ns_string"; |
|---|
| 629 |
} |
|---|
| 630 |
|
|---|
| 631 |
|
|---|
| 632 |
if($headers){ |
|---|
| 633 |
if (is_array($headers)) { |
|---|
| 634 |
$xml = ''; |
|---|
| 635 |
foreach ($headers as $header) { |
|---|
| 636 |
$xml .= $this->serialize_val($header, false, false, false, false, false, $use); |
|---|
| 637 |
} |
|---|
| 638 |
$headers = $xml; |
|---|
| 639 |
$this->debug("In serializeEnvelope, serialzied array of headers to $headers"); |
|---|
| 640 |
} |
|---|
| 641 |
$headers = "<SOAP-ENV:Header>".$headers."</SOAP-ENV:Header>"; |
|---|
| 642 |
} |
|---|
| 643 |
|
|---|
| 644 |
return |
|---|
| 645 |
'<?xml version="1.0" encoding="'.$this->soap_defencoding .'"?'.">". |
|---|
| 646 |
'<SOAP-ENV:Envelope'.$ns_string.">". |
|---|
| 647 |
$headers. |
|---|
| 648 |
"<SOAP-ENV:Body>". |
|---|
| 649 |
$body. |
|---|
| 650 |
"</SOAP-ENV:Body>". |
|---|
| 651 |
"</SOAP-ENV:Envelope>"; |
|---|
| 652 |
} |
|---|
| 653 |
|
|---|
| 654 |
|
|---|
| 655 |
|
|---|
| 656 |
|
|---|
| 657 |
|
|---|
| 658 |
|
|---|
| 659 |
|
|---|
| 660 |
|
|---|
| 661 |
|
|---|
| 662 |
function formatDump($str){ |
|---|
| 663 |
$str = htmlspecialchars($str); |
|---|
| 664 |
return nl2br($str); |
|---|
| 665 |
} |
|---|
| 666 |
|
|---|
| 667 |
|
|---|
| 668 |
|
|---|
| 669 |
|
|---|
| 670 |
|
|---|
| 671 |
|
|---|
| 672 |
|
|---|
| 673 |
|
|---|
| 674 |
function contractQname($qname){ |
|---|
| 675 |
|
|---|
| 676 |
|
|---|
| 677 |
if (strrpos($qname, ':')) { |
|---|
| 678 |
|
|---|
| 679 |
$name = substr($qname, strrpos($qname, ':') + 1); |
|---|
| 680 |
|
|---|
| 681 |
$ns = substr($qname, 0, strrpos($qname, ':')); |
|---|
| 682 |
$p = $this->getPrefixFromNamespace($ns); |
|---|
| 683 |
if ($p) { |
|---|
| 684 |
return $p . ':' . $name; |
|---|
| 685 |
} |
|---|
| 686 |
return $qname; |
|---|
| 687 |
} else { |
|---|
| 688 |
return $qname; |
|---|
| 689 |
} |
|---|
| 690 |
} |
|---|
| 691 |
|
|---|
| 692 |
|
|---|
| 693 |
|
|---|
| 694 |
|
|---|
| 695 |
|
|---|
| 696 |
|
|---|
| 697 |
|
|---|
| 698 |
|
|---|
| 699 |
function expandQname($qname){ |
|---|
| 700 |
|
|---|
| 701 |
if(strpos($qname,':') && !ereg('^http://',$qname)){ |
|---|
| 702 |
|
|---|
| 703 |
$name = substr(strstr($qname,':'),1); |
|---|
| 704 |
|
|---|
| 705 |
$prefix = substr($qname,0,strpos($qname,':')); |
|---|
| 706 |
if(isset($this->namespaces[$prefix])){ |
|---|
| 707 |
return $this->namespaces[$prefix].':'.$name; |
|---|
| 708 |
} else { |
|---|
| 709 |
return $qname; |
|---|
| 710 |
} |
|---|
| 711 |
} else { |
|---|
| 712 |
return $qname; |
|---|
| 713 |
} |
|---|
| 714 |
} |
|---|
| 715 |
|
|---|
| 716 |
|
|---|
| 717 |
|
|---|
| 718 |
|
|---|
| 719 |
|
|---|
| 720 |
|
|---|
| 721 |
|
|---|
| 722 |
|
|---|
| 723 |
|
|---|
| 724 |
function getLocalPart($str){ |
|---|
| 725 |
if($sstr = strrchr($str,':')){ |
|---|
| 726 |
|
|---|
| 727 |
return substr( $sstr, 1 ); |
|---|
| 728 |
} else { |
|---|
| 729 |
return $str; |
|---|
| 730 |
} |
|---|
| 731 |
} |
|---|
| 732 |
|
|---|
| 733 |
|
|---|
| 734 |
|
|---|
| 735 |
|
|---|
| 736 |
|
|---|
| 737 |
|
|---|
| 738 |
|
|---|
| 739 |
|
|---|
| 740 |
|
|---|
| 741 |
function getPrefix($str){ |
|---|
| 742 |
if($pos = strrpos($str,':')){ |
|---|
| 743 |
|
|---|
| 744 |
return substr($str,0,$pos); |
|---|
| 745 |
} |
|---|
| 746 |
return false; |
|---|
| 747 |
} |
|---|
| 748 |
|
|---|
| 749 |
|
|---|
| 750 |
|
|---|
| 751 |
|
|---|
| 752 |
|
|---|
| 753 |
|
|---|
| 754 |
|
|---|
| 755 |
|
|---|
| 756 |
function getNamespaceFromPrefix($prefix){ |
|---|
| 757 |
if (isset($this->namespaces[$prefix])) { |
|---|
| 758 |
return $this->namespaces[$prefix]; |
|---|
| 759 |
} |
|---|
| 760 |
|
|---|
| 761 |
return false; |
|---|
| 762 |
} |
|---|
| 763 |
|
|---|
| 764 |
|
|---|
| 765 |
|
|---|
| 766 |
|
|---|
| 767 |
|
|---|
| 768 |
|
|---|
| 769 |
|
|---|
| 770 |
|
|---|
| 771 |
|
|---|
| 772 |
function getPrefixFromNamespace($ns) { |
|---|
| 773 |
foreach ($this->namespaces as $p => $n) { |
|---|
| 774 |
if ($ns == $n || $ns == $p) { |
|---|
| 775 |
$this->usedNamespaces[$p] = $n; |
|---|
| 776 |
return $p; |
|---|
| 777 |
} |
|---|
| 778 |
} |
|---|
| 779 |
return false; |
|---|
| 780 |
} |
|---|
| 781 |
|
|---|
| 782 |
|
|---|
| 783 |
|
|---|
| 784 |
|
|---|
| 785 |
|
|---|
| 786 |
|
|---|
| 787 |
|
|---|
| 788 |
function getmicrotime() { |
|---|
| 789 |
if (function_exists('gettimeofday')) { |
|---|
| 790 |
$tod = gettimeofday(); |
|---|
| 791 |
$sec = $tod['sec']; |
|---|
| 792 |
$usec = $tod['usec']; |
|---|
| 793 |
} else { |
|---|
| 794 |
$sec = time(); |
|---|
| 795 |
$usec = 0; |
|---|
| 796 |
} |
|---|
| 797 |
return strftime('%Y-%m-%d %H:%M:%S', $sec) . '.' . sprintf('%06d', $usec); |
|---|
| 798 |
} |
|---|
| 799 |
|
|---|
| 800 |
|
|---|
| 801 |
|
|---|
| 802 |
|
|---|
| 803 |
|
|---|
| 804 |
|
|---|
| 805 |
|
|---|
| 806 |
|
|---|
| 807 |
function varDump($data) { |
|---|
| 808 |
ob_start(); |
|---|
| 809 |
var_dump($data); |
|---|
| 810 |
$ret_val = ob_get_contents(); |
|---|
| 811 |
ob_end_clean(); |
|---|
| 812 |
return $ret_val; |
|---|
| 813 |
} |
|---|
| 814 |
} |
|---|
| 815 |
|
|---|
| 816 |
|
|---|
| 817 |
|
|---|
| 818 |
|
|---|
| 819 |
|
|---|
| 820 |
|
|---|
| 821 |
|
|---|
| 822 |
|
|---|
| 823 |
|
|---|
| 824 |
|
|---|
| 825 |
|
|---|
| 826 |
function timestamp_to_iso8601($timestamp,$utc=true){ |
|---|
| 827 |
$datestr = date('Y-m-d\TH:i:sO',$timestamp); |
|---|
| 828 |
if($utc){ |
|---|
| 829 |
$eregStr = |
|---|
| 830 |
'([0-9]{4})-'. |
|---|
| 831 |
'([0-9]{2})-'. |
|---|
| 832 |
'([0-9]{2})'. |
|---|
| 833 |
'T'. |
|---|
| 834 |
'([0-9]{2}):'. |
|---|
| 835 |
'([0-9]{2}):'. |
|---|
| 836 |
'([0-9]{2})(\.[0-9]*)?'. |
|---|
| 837 |
'(Z|[+\-][0-9]{2}:?[0-9]{2})?'; |
|---|
| 838 |
|
|---|
| 839 |
if(ereg($eregStr,$datestr,$regs)){ |
|---|
| 840 |
return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$regs[1],$regs[2],$regs[3],$regs[4],$regs[5],$regs[6]); |
|---|
| 841 |
} |
|---|
| 842 |
return false; |
|---|
| 843 |
} else { |
|---|
| 844 |
return $datestr; |
|---|
| 845 |
} |
|---|
| 846 |
} |
|---|
| 847 |
|
|---|
| 848 |
|
|---|
| 849 |
|
|---|
| 850 |
|
|---|
| 851 |
|
|---|
| 852 |
|
|---|
| 853 |
|
|---|
| 854 |
function iso8601_to_timestamp($datestr){ |
|---|
| 855 |
$eregStr = |
|---|
| 856 |
'([0-9]{4})-'. |
|---|
| 857 |
'([0-9]{2})-'. |
|---|
| 858 |
'([0-9]{2})'. |
|---|
| 859 |
'T'. |
|---|
| 860 |
'([0-9]{2}):'. |
|---|
| 861 |
'([0-9]{2}):'. |
|---|
| 862 |
'([0-9]{2})(\.[0-9]+)?'. |
|---|
| 863 |
'(Z|[+\-][0-9]{2}:?[0-9]{2})?'; |
|---|
| 864 |
if(ereg($eregStr,$datestr,$regs)){ |
|---|
| 865 |
|
|---|
| 866 |
if($regs[8] != 'Z'){ |
|---|
| 867 |
$op = substr($regs[8],0,1); |
|---|
| 868 |
$h = substr($regs[8],1,2); |
|---|
| 869 |
$m = substr($regs[8],strlen($regs[8])-2,2); |
|---|
| 870 |
if($op == '-'){ |
|---|
| 871 |
$regs[4] = $regs[4] + $h; |
|---|
| 872 |
$regs[5] = $regs[5] + $m; |
|---|
| 873 |
} elseif($op == '+'){ |
|---|
| 874 |
$regs[4] = $regs[4] - $h; |
|---|
| 875 |
$regs[5] = $regs[5] - $m; |
|---|
| 876 |
} |
|---|
| 877 |
} |
|---|
| 878 |
return strtotime("$regs[1]-$regs[2]-$regs[3] $regs[4]:$regs[5]:$regs[6]Z"); |
|---|
| 879 |
} else { |
|---|
| 880 |
return false; |
|---|
| 881 |
} |
|---|
| 882 |
} |
|---|
| 883 |
|
|---|
| 884 |
|
|---|
| 885 |
|
|---|
| 886 |
|
|---|
| 887 |
|
|---|
| 888 |
|
|---|
| 889 |
|
|---|
| 890 |
|
|---|
| 891 |
function usleepWindows($usec) |
|---|
| 892 |
{ |
|---|
| 893 |
$start = gettimeofday(); |
|---|
| 894 |
|
|---|
| 895 |
do |
|---|
| 896 |
{ |
|---|
| 897 |
$stop = gettimeofday(); |
|---|
| 898 |
$timePassed = 1000000 * ($stop['sec'] - $start['sec']) |
|---|
| 899 |
+ $stop['usec'] - $start['usec']; |
|---|
| 900 |
} |
|---|
| 901 |
while ($timePassed < $usec); |
|---|
| 902 |
} |
|---|
| 903 |
|
|---|
| 904 |
?><?php |
|---|
| 905 |
|
|---|
| 906 |
|
|---|
| 907 |
|
|---|
| 908 |
|
|---|
| 909 |
|
|---|
| 910 |
|
|---|
| 911 |
|
|---|
| 912 |
|
|---|
| 913 |
|
|---|
| 914 |
|
|---|
| 915 |
|
|---|
| 916 |
class soap_fault extends nusoap_base { |
|---|
| 917 |
|
|---|
| 918 |
|
|---|
| 919 |
|
|---|
| 920 |
|
|---|
| 921 |
|
|---|
| 922 |
var $faultcode; |
|---|
| 923 |
|
|---|
| 924 |
|
|---|
| 925 |
|
|---|
| 926 |
|
|---|
| 927 |
|
|---|
| 928 |
var $faultactor; |
|---|
| 929 |
|
|---|
| 930 |
|
|---|
| 931 |
|
|---|
| 932 |
|
|---|
| 933 |
|
|---|
| 934 |
var $faultstring; |
|---|
| 935 |
|
|---|
| 936 |
|
|---|
| 937 |
|
|---|
| 938 |
|
|---|
| 939 |
|
|---|
| 940 |
var $faultdetail; |
|---|
| 941 |
|
|---|
| 942 |
|
|---|
| 943 |
|
|---|
| 944 |
|
|---|
| 945 |
|
|---|
| 946 |
|
|---|
| 947 |
|
|---|
| 948 |
|
|---|
| 949 |
|
|---|
| 950 |
function soap_fault($faultcode,$faultactor='',$faultstring='',$faultdetail=''){ |
|---|
| 951 |
parent::nusoap_base(); |
|---|
| 952 |
$this->faultcode = $faultcode; |
|---|
| 953 |
$this->faultactor = $faultactor; |
|---|
| 954 |
$this->faultstring = $faultstring; |
|---|
| 955 |
$this->faultdetail = $faultdetail; |
|---|
| 956 |
} |
|---|
| 957 |
|
|---|
| 958 |
|
|---|
| 959 |
|
|---|
| 960 |
|
|---|
| 961 |
|
|---|
| 962 |
|
|---|
| 963 |
|
|---|
| 964 |
function serialize(){ |
|---|
| 965 |
$ns_string = ''; |
|---|
| 966 |
foreach($this->namespaces as $k => $v){ |
|---|
| 967 |
$ns_string .= "\n xmlns:$k=\"$v\""; |
|---|
| 968 |
} |
|---|
| 969 |
$return_msg = |
|---|
| 970 |
'<?xml version="1.0" encoding="'.$this->soap_defencoding.'"?>'. |
|---|
| 971 |
'<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"'.$ns_string.">\n". |
|---|
| 972 |
'<SOAP-ENV:Body>'. |
|---|
| 973 |
'<SOAP-ENV:Fault>'. |
|---|
| 974 |
$this->serialize_val($this->faultcode, 'faultcode'). |
|---|
| 975 |
$this->serialize_val($this->faultactor, 'faultactor'). |
|---|
| 976 |
$this->serialize_val($this->faultstring, 'faultstring'). |
|---|
| 977 |
$this->serialize_val($this->faultdetail, 'detail'). |
|---|
| 978 |
'</SOAP-ENV:Fault>'. |
|---|
| 979 |
'</SOAP-ENV:Body>'. |
|---|
| 980 |
'</SOAP-ENV:Envelope>'; |
|---|
| 981 |
return $return_msg; |
|---|
| 982 |
} |
|---|
| 983 |
} |
|---|
| 984 |
|
|---|
| 985 |
|
|---|
| 986 |
|
|---|
| 987 |
?><?php |
|---|
| 988 |
|
|---|
| 989 |
|
|---|
| 990 |
|
|---|
| 991 |
|
|---|
| 992 |
|
|---|
| 993 |
|
|---|
| 994 |
|
|---|
| 995 |
|
|---|
| 996 |
|
|---|
| 997 |
|
|---|
| 998 |
|
|---|
| 999 |
|
|---|
| 1000 |
|
|---|
| 1001 |
|
|---|
| 1002 |
class XMLSchema extends nusoap_base { |
|---|
| 1003 |
|
|---|
| 1004 |
|
|---|
| 1005 |
var $schema = ''; |
|---|
| 1006 |
var $xml = ''; |
|---|
| 1007 |
|
|---|
| 1008 |
var $enclosingNamespaces; |
|---|
| 1009 |
|
|---|
| 1010 |
var $schemaInfo = array(); |
|---|
| 1011 |
var $schemaTargetNamespace = ''; |
|---|
| 1012 |
|
|---|
| 1013 |
var $attributes = array(); |
|---|
| 1014 |
var $complexTypes = array(); |
|---|
| 1015 |
var $complexTypeStack = array(); |
|---|
| 1016 |
var $currentComplexType = null; |
|---|
| 1017 |
var $elements = array(); |
|---|
| 1018 |
var $elementStack = array(); |
|---|
| 1019 |
var $currentElement = null; |
|---|
| 1020 |
var $simpleTypes = array(); |
|---|
| 1021 |
var $simpleTypeStack = array(); |
|---|
| 1022 |
var $currentSimpleType = null; |
|---|
| 1023 |
|
|---|
| 1024 |
var $imports = array(); |
|---|
| 1025 |
|
|---|
| 1026 |
var $parser; |
|---|
| 1027 |
var $position = 0; |
|---|
| 1028 |
var $depth = 0; |
|---|
| 1029 |
var $depth_array = array(); |
|---|
| 1030 |
var $message = array(); |
|---|
| 1031 |
var $defaultNamespace = array(); |
|---|
| 1032 |
|
|---|
| 1033 |
|
|---|
| 1034 |
|
|---|
| 1035 |
|
|---|
| 1036 |
|
|---|
| 1037 |
|
|---|
| 1038 |
|
|---|
| 1039 |
|
|---|
| 1040 |
|
|---|
| 1041 |
function XMLSchema($schema='',$xml='',$namespaces=array()){ |
|---|
| 1042 |
parent::nusoap_base(); |
|---|
| 1043 |
$this->debug('xmlschema class instantiated, inside constructor'); |
|---|
| 1044 |
|
|---|
| 1045 |
$this->schema = $schema; |
|---|
| 1046 |
$this->xml = $xml; |
|---|
| 1047 |
|
|---|
| 1048 |
|
|---|
| 1049 |
$this->enclosingNamespaces = $namespaces; |
|---|
| 1050 |
$this->namespaces = array_merge($this->namespaces, $namespaces); |
|---|
| 1051 |
|
|---|
| 1052 |
|
|---|
| 1053 |
if($schema != ''){ |
|---|
| 1054 |
$this->debug('initial schema file: '.$schema); |
|---|
| 1055 |
$this->parseFile($schema, 'schema'); |
|---|
| 1056 |
} |
|---|
| 1057 |
|
|---|
| 1058 |
|
|---|
| 1059 |
if($xml != ''){ |
|---|
| 1060 |
$this->debug('initial xml file: '.$xml); |
|---|
| 1061 |
$this->parseFile($xml, 'xml'); |
|---|
| 1062 |
} |
|---|
| 1063 |
|
|---|
| 1064 |
} |
|---|
| 1065 |
|
|---|
| 1066 |
|
|---|
| 1067 |
|
|---|
| 1068 |
|
|---|
| 1069 |
|
|---|
| 1070 |
|
|---|
| 1071 |
|
|---|
| 1072 |
|
|---|
| 1073 |
|
|---|
| 1074 |
function parseFile($xml,$type){ |
|---|
| 1075 |
|
|---|
| 1076 |
if($xml != ""){ |
|---|
| 1077 |
$xmlStr = @join("",@file($xml)); |
|---|
| 1078 |
if($xmlStr == ""){ |
|---|
| 1079 |
$msg = 'Error reading XML from '.$xml; |
|---|
| 1080 |
$this->setError($msg); |
|---|
| 1081 |
$this->debug($msg); |
|---|
| 1082 |
return false; |
|---|
| 1083 |
} else { |
|---|
| 1084 |
$this->debug("parsing $xml"); |
|---|
| 1085 |
$this->parseString($xmlStr,$type); |
|---|
| 1086 |
$this->debug("done parsing $xml"); |
|---|
| 1087 |
return true; |
|---|
| 1088 |
} |
|---|
| 1089 |
} |
|---|
| 1090 |
return false; |
|---|
| 1091 |
} |
|---|
| 1092 |
|
|---|
| 1093 |
|
|---|
| 1094 |
|
|---|
| 1095 |
|
|---|
| 1096 |
|
|---|
| 1097 |
|
|---|
| 1098 |
|
|---|
| 1099 |
|
|---|
| 1100 |
function parseString($xml,$type){ |
|---|
| 1101 |
|
|---|
| 1102 |
if($xml != ""){ |
|---|
| 1103 |
|
|---|
| 1104 |
|
|---|
| 1105 |
$this->parser = xml_parser_create(); |
|---|
| 1106 |
|
|---|
| 1107 |
xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); |
|---|
| 1108 |
|
|---|
| 1109 |
|
|---|
| 1110 |
xml_set_object($this->parser, $this); |
|---|
| 1111 |
|
|---|
| 1112 |
|
|---|
| 1113 |
if($type == "schema"){ |
|---|
| 1114 |
xml_set_element_handler($this->parser, 'schemaStartElement','schemaEndElement'); |
|---|
| 1115 |
xml_set_character_data_handler($this->parser,'schemaCharacterData'); |
|---|
| 1116 |
} elseif($type == "xml"){ |
|---|
| 1117 |
xml_set_element_handler($this->parser, 'xmlStartElement','xmlEndElement'); |
|---|
| 1118 |
xml_set_character_data_handler($this->parser,'xmlCharacterData'); |
|---|
| 1119 |
} |
|---|
| 1120 |
|
|---|
| 1121 |
|
|---|
| 1122 |
if(!xml_parse($this->parser,$xml,true)){ |
|---|
| 1123 |
|
|---|
| 1124 |
$errstr = sprintf('XML error parsing XML schema on line %d: %s', |
|---|
| 1125 |
xml_get_current_line_number($this->parser), |
|---|
| 1126 |
xml_error_string(xml_get_error_code($this->parser)) |
|---|
| 1127 |
); |
|---|
| 1128 |
$this->debug($errstr); |
|---|
| 1129 |
$this->debug("XML payload:\n" . $xml); |
|---|
| 1130 |
$this->setError($errstr); |
|---|
| 1131 |
} |
|---|
| 1132 |
|
|---|
| 1133 |
xml_parser_free($this->parser); |
|---|
| 1134 |
} else{ |
|---|
| 1135 |
$this->debug('no xml passed to parseString()!!'); |
|---|
| 1136 |
$this->setError('no xml passed to parseString()!!'); |
|---|
| 1137 |
} |
|---|
| 1138 |
} |
|---|
| 1139 |
|
|---|
| 1140 |
|
|---|
| 1141 |
|
|---|
| 1142 |
|
|---|
| 1143 |
|
|---|
| 1144 |
|
|---|
| 1145 |
|
|---|
| 1146 |
|
|---|
| 1147 |
|
|---|
| 1148 |
function schemaStartElement($parser, $name, $attrs) { |
|---|
| 1149 |
|
|---|
| 1150 |
|
|---|
| 1151 |
$pos = $this->position++; |
|---|
| 1152 |
$depth = $this->depth++; |
|---|
| 1153 |
|
|---|
| 1154 |
$this->depth_array[$depth] = $pos; |
|---|
| 1155 |
$this->message[$pos] = array('cdata' => ''); |
|---|
| 1156 |
if ($depth > 0) { |
|---|
| 1157 |
$this->defaultNamespace[$pos] = $this->defaultNamespace[$this->depth_array[$depth - 1]]; |
|---|
| 1158 |
} else { |
|---|
| 1159 |
$this->defaultNamespace[$pos] = false; |
|---|
| 1160 |
} |
|---|
| 1161 |
|
|---|
| 1162 |
|
|---|
| 1163 |
if($prefix = $this->getPrefix($name)){ |
|---|
| 1164 |
|
|---|
| 1165 |
$name = $this->getLocalPart($name); |
|---|
| 1166 |
} else { |
|---|
| 1167 |
$prefix = ''; |
|---|
| 1168 |
} |
|---|
| 1169 |
|
|---|
| 1170 |
|
|---|
| 1171 |
if(count($attrs) > 0){ |
|---|
| 1172 |
foreach($attrs as $k => $v){ |
|---|
| 1173 |
|
|---|
| 1174 |
if(ereg("^xmlns",$k)){ |
|---|
| 1175 |
|
|---|
| 1176 |
|
|---|
| 1177 |
if($ns_prefix = substr(strrchr($k,':'),1)){ |
|---|
| 1178 |
|
|---|
| 1179 |
$this->namespaces[$ns_prefix] = $v; |
|---|
| 1180 |
} else { |
|---|
| 1181 |
$this->defaultNamespace[$pos] = $v; |
|---|
| 1182 |
if (! $this->getPrefixFromNamespace($v)) { |
|---|
| 1183 |
$this->namespaces['ns'.(count($this->namespaces)+1)] = $v; |
|---|
| 1184 |
} |
|---|
| 1185 |
} |
|---|
| 1186 |
if($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema'){ |
|---|
| 1187 |
$this->XMLSchemaVersion = $v; |
|---|
| 1188 |
$this->namespaces['xsi'] = $v.'-instance'; |
|---|
| 1189 |
} |
|---|
| 1190 |
} |
|---|
| 1191 |
} |
|---|
| 1192 |
foreach($attrs as $k => $v){ |
|---|
| 1193 |
|
|---|
| 1194 |
$k = strpos($k,':') ? $this->expandQname($k) : $k; |
|---|
| 1195 |
$v = strpos($v,':') ? $this->expandQname($v) : $v; |
|---|
| 1196 |
$eAttrs[$k] = $v; |
|---|
| 1197 |
} |
|---|
| 1198 |
$attrs = $eAttrs; |
|---|
| 1199 |
} else { |
|---|
| 1200 |
$attrs = array(); |
|---|
| 1201 |
} |
|---|
| 1202 |
|
|---|
| 1203 |
switch($name){ |
|---|
| 1204 |
case 'all': |
|---|
| 1205 |
case 'choice': |
|---|
| 1206 |
case 'group': |
|---|
| 1207 |
case 'sequence': |
|---|
| 1208 |
|
|---|
| 1209 |
$this->complexTypes[$this->currentComplexType]['compositor'] = $name; |
|---|
| 1210 |
|
|---|
| 1211 |
|
|---|
| 1212 |
|
|---|
| 1213 |
break; |
|---|
| 1214 |
case 'attribute': |
|---|
| 1215 |
|
|---|
| 1216 |
$this->xdebug("parsing attribute:"); |
|---|
| 1217 |
$this->appendDebug($this->varDump($attrs)); |
|---|
| 1218 |
if (!isset($attrs['form'])) { |
|---|
| 1219 |
$attrs['form'] = $this->schemaInfo['attributeFormDefault']; |
|---|
| 1220 |
} |
|---|
| 1221 |
if (isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])) { |
|---|
| 1222 |
$v = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; |
|---|
| 1223 |
if (!strpos($v, ':')) { |
|---|
| 1224 |
|
|---|
| 1225 |
if ($this->defaultNamespace[$pos]) { |
|---|
| 1226 |
|
|---|
| 1227 |
$attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'] = $this->defaultNamespace[$pos] . ':' . $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; |
|---|
| 1228 |
} |
|---|
| 1229 |
} |
|---|
| 1230 |
} |
|---|
| 1231 |
if(isset($attrs['name'])){ |
|---|
| 1232 |
$this->attributes[$attrs['name']] = $attrs; |
|---|
| 1233 |
$aname = $attrs['name']; |
|---|
| 1234 |
} elseif(isset($attrs['ref']) && $attrs['ref'] == 'http://schemas.xmlsoap.org/soap/encoding/:arrayType'){ |
|---|
| 1235 |
if (isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])) { |
|---|
| 1236 |
$aname = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; |
|---|
| 1237 |
} else { |
|---|
| 1238 |
$aname = ''; |
|---|
| 1239 |
} |
|---|
| 1240 |
} elseif(isset($attrs['ref'])){ |
|---|
| 1241 |
$aname = $attrs['ref']; |
|---|
| 1242 |
$this->attributes[$attrs['ref']] = $attrs; |
|---|
| 1243 |
} |
|---|
| 1244 |
|
|---|
| 1245 |
if($this->currentComplexType){ |
|---|
| 1246 |
$this->complexTypes[$this->currentComplexType]['attrs'][$aname] = $attrs; |
|---|
| 1247 |
} |
|---|
| 1248 |
|
|---|
| 1249 |
if(isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']) || $this->getLocalPart($aname) == 'arrayType'){ |
|---|
| 1250 |
$this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; |
|---|
| 1251 |
$prefix = $this->getPrefix($aname); |
|---|
| 1252 |
if(isset($attrs['http://schemas.xmlsoap.org/wsdl/:arrayType'])){ |
|---|
| 1253 |
$v = $attrs['http://schemas.xmlsoap.org/wsdl/:arrayType']; |
|---|
| 1254 |
} else { |
|---|
| 1255 |
$v = ''; |
|---|
| 1256 |
} |
|---|
| 1257 |
if(strpos($v,'[,]')){ |
|---|
| 1258 |
$this->complexTypes[$this->currentComplexType]['multidimensional'] = true; |
|---|
| 1259 |
} |
|---|
| 1260 |
$v = substr($v,0,strpos($v,'[')); |
|---|
| 1261 |
if(!strpos($v,':') && isset($this->typemap[$this->XMLSchemaVersion][$v])){ |
|---|
| 1262 |
$v = $this->XMLSchemaVersion.':'.$v; |
|---|
| 1263 |
} |
|---|
| 1264 |
$this->complexTypes[$this->currentComplexType]['arrayType'] = $v; |
|---|
| 1265 |
} |
|---|
| 1266 |
break; |
|---|
| 1267 |
case 'complexContent': |
|---|
| 1268 |
break; |
|---|
| 1269 |
case 'complexType': |
|---|
| 1270 |
array_push($this->complexTypeStack, $this->currentComplexType); |
|---|
| 1271 |
if(isset($attrs['name'])){ |
|---|
| 1272 |
$this->xdebug('processing named complexType '.$attrs['name']); |
|---|
| 1273 |
|
|---|
| 1274 |
$this->currentComplexType = $attrs['name']; |
|---|
| 1275 |
$this->complexTypes[$this->currentComplexType] = $attrs; |
|---|
| 1276 |
$this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType'; |
|---|
| 1277 |
|
|---|
| 1278 |
|
|---|
| 1279 |
|
|---|
| 1280 |
|
|---|
| 1281 |
|
|---|
| 1282 |
|
|---|
| 1283 |
|
|---|
| 1284 |
if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){ |
|---|
| 1285 |
$this->xdebug('complexType is unusual array'); |
|---|
| 1286 |
$this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; |
|---|
| 1287 |
} else { |
|---|
| 1288 |
$this->complexTypes[$this->currentComplexType]['phpType'] = 'struct'; |
|---|
| 1289 |
} |
|---|
| 1290 |
}else{ |
|---|
| 1291 |
$this->xdebug('processing unnamed complexType for element '.$this->currentElement); |
|---|
| 1292 |
$this->currentComplexType = $this->currentElement . '_ContainedType'; |
|---|
| 1293 |
|
|---|
| 1294 |
$this->complexTypes[$this->currentComplexType] = $attrs; |
|---|
| 1295 |
$this->complexTypes[$this->currentComplexType]['typeClass'] = 'complexType'; |
|---|
| 1296 |
|
|---|
| 1297 |
|
|---|
| 1298 |
|
|---|
| 1299 |
|
|---|
| 1300 |
|
|---|
| 1301 |
|
|---|
| 1302 |
|
|---|
| 1303 |
if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){ |
|---|
| 1304 |
$this->xdebug('complexType is unusual array'); |
|---|
| 1305 |
$this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; |
|---|
| 1306 |
} else { |
|---|
| 1307 |
$this->complexTypes[$this->currentComplexType]['phpType'] = 'struct'; |
|---|
| 1308 |
} |
|---|
| 1309 |
} |
|---|
| 1310 |
break; |
|---|
| 1311 |
case 'element': |
|---|
| 1312 |
array_push($this->elementStack, $this->currentElement); |
|---|
| 1313 |
|
|---|
| 1314 |
|
|---|
| 1315 |
|
|---|
| 1316 |
if (!isset($attrs['form'])) { |
|---|
| 1317 |
$attrs['form'] = $this->schemaInfo['elementFormDefault']; |
|---|
| 1318 |
} |
|---|
| 1319 |
if(isset($attrs['type'])){ |
|---|
| 1320 |
$this->xdebug("processing typed element ".$attrs['name']." of type ".$attrs['type']); |
|---|
| 1321 |
if (! $this->getPrefix($attrs['type'])) { |
|---|
| 1322 |
if ($this->defaultNamespace[$pos]) { |
|---|
| 1323 |
$attrs['type'] = $this->defaultNamespace[$pos] . ':' . $attrs['type']; |
|---|
| 1324 |
$this->xdebug('used default namespace to make type ' . $attrs['type']); |
|---|
| 1325 |
} |
|---|
| 1326 |
} |
|---|
| 1327 |
|
|---|
| 1328 |
|
|---|
| 1329 |
|
|---|
| 1330 |
|
|---|
| 1331 |
|
|---|
| 1332 |
|
|---|
| 1333 |
|
|---|
| 1334 |
if ($this->currentComplexType && $this->complexTypes[$this->currentComplexType]['phpType'] == 'array') { |
|---|
| 1335 |
$this->xdebug('arrayType for unusual array is ' . $attrs['type']); |
|---|
| 1336 |
$this->complexTypes[$this->currentComplexType]['arrayType'] = $attrs['type']; |
|---|
| 1337 |
} |
|---|
| 1338 |
$this->currentElement = $attrs['name']; |
|---|
| 1339 |
$this->elements[ $attrs['name'] ] = $attrs; |
|---|
| 1340 |
$this->elements[ $attrs['name'] ]['typeClass'] = 'element'; |
|---|
| 1341 |
$ename = $attrs['name']; |
|---|
| 1342 |
} elseif(isset($attrs['ref'])){ |
|---|
| 1343 |
$this->xdebug("processing element as ref to ".$attrs['ref']); |
|---|
| 1344 |
$this->currentElement = "ref to ".$attrs['ref']; |
|---|
| 1345 |
$ename = $this->getLocalPart($attrs['ref']); |
|---|
| 1346 |
} else { |
|---|
| 1347 |
$this->xdebug("processing untyped element ".$attrs['name']); |
|---|
| 1348 |
$this->currentElement = $attrs['name']; |
|---|
| 1349 |
$this->elements[ $attrs['name'] ] = $attrs; |
|---|
| 1350 |
$this->elements[ $attrs['name'] ]['typeClass'] = 'element'; |
|---|
| 1351 |
$attrs['type'] = $this->schemaTargetNamespace . ':' . $attrs['name'] . '_ContainedType'; |
|---|
| 1352 |
$this->elements[ $attrs['name'] ]['type'] = $attrs['type']; |
|---|
| 1353 |
$ename = $attrs['name']; |
|---|
| 1354 |
} |
|---|
| 1355 |
if(isset($ename) && $this->currentComplexType){ |
|---|
| 1356 |
$this->complexTypes[$this->currentComplexType]['elements'][$ename] = $attrs; |
|---|
| 1357 |
} |
|---|
| 1358 |
break; |
|---|
| 1359 |
case 'enumeration': |
|---|
| 1360 |
$this->xdebug('enumeration ' . $attrs['value']); |
|---|
| 1361 |
if ($this->currentSimpleType) { |
|---|
| 1362 |
$this->simpleTypes[$this->currentSimpleType]['enumeration'][] = $attrs['value']; |
|---|
| 1363 |
} elseif ($this->currentComplexType) { |
|---|
| 1364 |
$this->complexTypes[$this->currentComplexType]['enumeration'][] = $attrs['value']; |
|---|
| 1365 |
} |
|---|
| 1366 |
break; |
|---|
| 1367 |
case 'extension': |
|---|
| 1368 |
$this->xdebug('extension ' . $attrs['base']); |
|---|
| 1369 |
if ($this->currentComplexType) { |
|---|
| 1370 |
$this->complexTypes[$this->currentComplexType]['extensionBase'] = $attrs['base']; |
|---|
| 1371 |
} |
|---|
| 1372 |
break; |
|---|
| 1373 |
case 'import': |
|---|
| 1374 |
if (isset($attrs['schemaLocation'])) { |
|---|
| 1375 |
|
|---|
| 1376 |
$this->imports[$attrs['namespace']][] = array('location' => $attrs['schemaLocation'], 'loaded' => false); |
|---|
| 1377 |
} else { |
|---|
| 1378 |
|
|---|
| 1379 |
$this->imports[$attrs['namespace']][] = array('location' => '', 'loaded' => true); |
|---|
| 1380 |
if (! $this->getPrefixFromNamespace($attrs['namespace'])) { |
|---|
| 1381 |
$this->namespaces['ns'.(count($this->namespaces)+1)] = $attrs['namespace']; |
|---|
| 1382 |
} |
|---|
| 1383 |
} |
|---|
| 1384 |
break; |
|---|
| 1385 |
case 'list': |
|---|
| 1386 |
break; |
|---|
| 1387 |
case 'restriction': |
|---|
| 1388 |
$this->xdebug('restriction ' . $attrs['base']); |
|---|
| 1389 |
if($this->currentSimpleType){ |
|---|
| 1390 |
$this->simpleTypes[$this->currentSimpleType]['type'] = $attrs['base']; |
|---|
| 1391 |
} elseif($this->currentComplexType){ |
|---|
| 1392 |
$this->complexTypes[$this->currentComplexType]['restrictionBase'] = $attrs['base']; |
|---|
| 1393 |
if(strstr($attrs['base'],':') == ':Array'){ |
|---|
| 1394 |
$this->complexTypes[$this->currentComplexType]['phpType'] = 'array'; |
|---|
| 1395 |
} |
|---|
| 1396 |
} |
|---|
| 1397 |
break; |
|---|
| 1398 |
case 'schema': |
|---|
| 1399 |
$this->schemaInfo = $attrs; |
|---|
| 1400 |
$this->schemaInfo['schemaVersion'] = $this->getNamespaceFromPrefix($prefix); |
|---|
| 1401 |
if (isset($attrs['targetNamespace'])) { |
|---|
| 1402 |
$this->schemaTargetNamespace = $attrs['targetNamespace']; |
|---|
| 1403 |
} |
|---|
| 1404 |
if (!isset($attrs['elementFormDefault'])) { |
|---|
| 1405 |
$this->schemaInfo['elementFormDefault'] = 'unqualified'; |
|---|
| 1406 |
} |
|---|
| 1407 |
if (!isset($attrs['attributeFormDefault'])) { |
|---|
| 1408 |
$this->schemaInfo['attributeFormDefault'] = 'unqualified'; |
|---|
| 1409 |
} |
|---|
| 1410 |
break; |
|---|
| 1411 |
case 'simpleContent': |
|---|
| 1412 |
break; |
|---|
| 1413 |
case 'simpleType': |
|---|
| 1414 |
array_push($this->simpleTypeStack, $this->currentSimpleType); |
|---|
| 1415 |
if(isset($attrs['name'])){ |
|---|
| 1416 |
$this->xdebug("processing simpleType for name " . $attrs['name']); |
|---|
| 1417 |
$this->currentSimpleType = $attrs['name']; |
|---|
| 1418 |
$this->simpleTypes[ $attrs['name'] ] = $attrs; |
|---|
| 1419 |
$this->simpleTypes[ $attrs['name'] ]['typeClass'] = 'simpleType'; |
|---|
| 1420 |
$this->simpleTypes[ $attrs['name'] ]['phpType'] = 'scalar'; |
|---|
| 1421 |
} else { |
|---|
| 1422 |
$this->xdebug('processing unnamed simpleType for element '.$this->currentElement); |
|---|
| 1423 |
$this->currentSimpleType = $this->currentElement . '_ContainedType'; |
|---|
| 1424 |
|
|---|
| 1425 |
$this->simpleTypes[$this->currentSimpleType] = $attrs; |
|---|
| 1426 |
$this->simpleTypes[$this->currentSimpleType]['phpType'] = 'scalar'; |
|---|
| 1427 |
} |
|---|
| 1428 |
break; |
|---|
| 1429 |
case 'union': |
|---|
| 1430 |
break; |
|---|
| 1431 |
default: |
|---|
| 1432 |
|
|---|
| 1433 |
} |
|---|
| 1434 |
} |
|---|
| 1435 |
|
|---|
| 1436 |
|
|---|
| 1437 |
|
|---|
| 1438 |
|
|---|
| 1439 |
|
|---|
| 1440 |
|
|---|
| 1441 |
|
|---|
| 1442 |
|
|---|
| 1443 |
function schemaEndElement($parser, $name) { |
|---|
| 1444 |
|
|---|
| 1445 |
$this->depth--; |
|---|
| 1446 |
|
|---|
| 1447 |
if(isset($this->depth_array[$this->depth])){ |
|---|
| 1448 |
$pos = $this->depth_array[$this->depth]; |
|---|
| 1449 |
} |
|---|
| 1450 |
|
|---|
| 1451 |
if ($prefix = $this->getPrefix($name)){ |
|---|
| 1452 |
|
|---|
| 1453 |
$name = $this->getLocalPart($name); |
|---|
| 1454 |
} else { |
|---|
| 1455 |
$prefix = ''; |
|---|
| 1456 |
} |
|---|
| 1457 |
|
|---|
| 1458 |
if($name == 'complexType'){ |
|---|
| 1459 |
$this->xdebug('done processing complexType ' . ($this->currentComplexType ? $this->currentComplexType : '(unknown)')); |
|---|
| 1460 |
$this->currentComplexType = array_pop($this->complexTypeStack); |
|---|
| 1461 |
|
|---|
| 1462 |
} |
|---|
| 1463 |
if($name == 'element'){ |
|---|
| 1464 |
$this->xdebug('done processing element ' . ($this->currentElement ? $this->currentElement : '(unknown)')); |
|---|
| 1465 |
$this->currentElement = array_pop($this->elementStack); |
|---|
| 1466 |
} |
|---|
| 1467 |
if($name == 'simpleType'){ |
|---|
| 1468 |
$this->xdebug('done processing simpleType ' . ($this->currentSimpleType ? $this->currentSimpleType : '(unknown)')); |
|---|
| 1469 |
$this->currentSimpleType = array_pop($this->simpleTypeStack); |
|---|
| 1470 |
} |
|---|
| 1471 |
} |
|---|
| 1472 |
|
|---|
| 1473 |
|
|---|
| 1474 |
|
|---|
| 1475 |
|
|---|
| 1476 |
|
|---|
| 1477 |
|
|---|
| 1478 |
|
|---|
| 1479 |
|
|---|
| 1480 |
function schemaCharacterData($parser, $data){ |
|---|
| 1481 |
$pos = $this->depth_array[$this->depth - 1]; |
|---|
| 1482 |
$this->message[$pos]['cdata'] .= $data; |
|---|
| 1483 |
} |
|---|
| 1484 |
|
|---|
| 1485 |
|
|---|
| 1486 |
|
|---|
| 1487 |
|
|---|
| 1488 |
|
|---|
| 1489 |
|
|---|
| 1490 |
function serializeSchema(){ |
|---|
| 1491 |
|
|---|
| 1492 |
$schemaPrefix = $this->getPrefixFromNamespace($this->XMLSchemaVersion); |
|---|
| 1493 |
$xml = ''; |
|---|
| 1494 |
|
|---|
| 1495 |
if (sizeof($this->imports) > 0) { |
|---|
| 1496 |
foreach($this->imports as $ns => $list) { |
|---|
| 1497 |
foreach ($list as $ii) { |
|---|
| 1498 |
if ($ii['location'] != '') { |
|---|
| 1499 |
$xml .= " <$schemaPrefix:import location=\"" . $ii['location'] . '" namespace="' . $ns . "\" />\n"; |
|---|
| 1500 |
} else { |
|---|
| 1501 |
$xml .= " <$schemaPrefix:import namespace=\"" . $ns . "\" />\n"; |
|---|
| 1502 |
} |
|---|
| 1503 |
} |
|---|
| 1504 |
} |
|---|
| 1505 |
} |
|---|
| 1506 |
|
|---|
| 1507 |
foreach($this->complexTypes as $typeName => $attrs){ |
|---|
| 1508 |
$contentStr = ''; |
|---|
| 1509 |
|
|---|
| 1510 |
if(isset($attrs['elements']) && (count($attrs['elements']) > 0)){ |
|---|
| 1511 |
foreach($attrs['elements'] as $element => $eParts){ |
|---|
| 1512 |
if(isset($eParts['ref'])){ |
|---|
| 1513 |
$contentStr .= " <$schemaPrefix:element ref=\"$element\"/>\n"; |
|---|
| 1514 |
} else { |
|---|
| 1515 |
$contentStr .= " <$schemaPrefix:element name=\"$element\" type=\"" . $this->contractQName($eParts['type']) . "\""; |
|---|
| 1516 |
foreach ($eParts as $aName => $aValue) { |
|---|
| 1517 |
|
|---|
| 1518 |
if ($aName != 'name' && $aName != 'type') { |
|---|
| 1519 |
$contentStr .= " $aName=\"$aValue\""; |
|---|
| 1520 |
} |
|---|
| 1521 |
} |
|---|
| 1522 |
$contentStr .= "/>\n"; |
|---|
| 1523 |
} |
|---|
| 1524 |
} |
|---|
| 1525 |
|
|---|
| 1526 |
if (isset($attrs['compositor']) && ($attrs['compositor'] != '')) { |
|---|
| 1527 |
$contentStr = " <$schemaPrefix:$attrs[compositor]>\n".$contentStr." </$schemaPrefix:$attrs[compositor]>\n"; |
|---|
| 1528 |
} |
|---|
| 1529 |
} |
|---|
| 1530 |
|
|---|
| 1531 |
if(isset($attrs['attrs']) && (count($attrs['attrs']) >= 1)){ |
|---|
| 1532 |
foreach($attrs['attrs'] as $attr => $aParts){ |
|---|
| 1533 |
$contentStr .= " <$schemaPrefix:attribute"; |
|---|
| 1534 |
foreach ($aParts as $a => $v) { |
|---|
| 1535 |
if ($a == 'ref' || $a == 'type') { |
|---|
| 1536 |
$contentStr .= " $a=\"".$this->contractQName($v).'"'; |
|---|
| 1537 |
} elseif ($a == 'http://schemas.xmlsoap.org/wsdl/:arrayType') { |
|---|
| 1538 |
$this->usedNamespaces['wsdl'] = $this->namespaces['wsdl']; |
|---|
| 1539 |
$contentStr .= ' wsdl:arrayType="'.$this->contractQName($v).'"'; |
|---|
| 1540 |
} else { |
|---|
| 1541 |
$contentStr .= " $a=\"$v\""; |
|---|
| 1542 |
} |
|---|
| 1543 |
} |
|---|
| 1544 |
$contentStr .= "/>\n"; |
|---|
| 1545 |
} |
|---|
| 1546 |
} |
|---|
| 1547 |
|
|---|
| 1548 |
if (isset($attrs['restrictionBase']) && $attrs['restrictionBase'] != ''){ |
|---|
| 1549 |
$contentStr = " <$schemaPrefix:restriction base=\"".$this->contractQName($attrs['restrictionBase'])."\">\n".$contentStr." </$schemaPrefix:restriction>\n"; |
|---|
| 1550 |
|
|---|
| 1551 |
if ((isset($attrs['elements']) && count($attrs['elements']) > 0) || (isset($attrs['attrs']) && count($attrs['attrs']) > 0)){ |
|---|
| 1552 |
$contentStr = " <$schemaPrefix:complexContent>\n".$contentStr." </$schemaPrefix:complexContent>\n"; |
|---|
| 1553 |
} |
|---|
| 1554 |
} |
|---|
| 1555 |
|
|---|
| 1556 |
if($contentStr != ''){ |
|---|
| 1557 |
$contentStr = " <$schemaPrefix:complexType name=\"$typeName\">\n".$contentStr." </$schemaPrefix:complexType>\n"; |
|---|
| 1558 |
} else { |
|---|
| 1559 |
$contentStr = " <$schemaPrefix:complexType name=\"$typeName\"/>\n"; |
|---|
| 1560 |
} |
|---|
| 1561 |
$xml .= $contentStr; |
|---|
| 1562 |
} |
|---|
| 1563 |
|
|---|
| 1564 |
if(isset($this->simpleTypes) && count($this->simpleTypes) > 0){ |
|---|
| 1565 |
foreach($this->simpleTypes as $typeName => $eParts){ |
|---|
| 1566 |
$xml .= " <$schemaPrefix:simpleType name=\"$typeName\">\n <$schemaPrefix:restriction base=\"".$this->contractQName($eParts['type'])."\"/>\n"; |
|---|
| 1567 |
if (isset($eParts['enumeration'])) { |
|---|
| 1568 |
foreach ($eParts['enumeration'] as $e) { |
|---|
| 1569 |
$xml .= " <$schemaPrefix:enumeration value=\"$e\"/>\n"; |
|---|
| 1570 |
} |
|---|
| 1571 |
} |
|---|
| 1572 |
$xml .= " </$schemaPrefix:simpleType>"; |
|---|
| 1573 |
} |
|---|
| 1574 |
} |
|---|
| 1575 |
|
|---|
| 1576 |
if(isset($this->elements) && count($this->elements) > 0){ |
|---|
| 1577 |
foreach($this->elements as $element => $eParts){ |
|---|
| 1578 |
$xml .= " <$schemaPrefix:element name=\"$element\" type=\"".$this->contractQName($eParts['type'])."\"/>\n"; |
|---|
| 1579 |
} |
|---|
| 1580 |
} |
|---|
| 1581 |
|
|---|
| 1582 |
if(isset($this->attributes) && count($this->attributes) > 0){ |
|---|
| 1583 |
foreach($this->attributes as $attr => $aParts){ |
|---|
| 1584 |
$xml .= " <$schemaPrefix:attribute name=\"$attr\" type=\"".$this->contractQName($aParts['type'])."\"\n/>"; |
|---|
| 1585 |
} |
|---|
| 1586 |
} |
|---|
| 1587 |
|
|---|
| 1588 |
$el = "<$schemaPrefix:schema targetNamespace=\"$this->schemaTargetNamespace\"\n"; |
|---|
| 1589 |
foreach (array_diff($this->usedNamespaces, $this->enclosingNamespaces) as $nsp => $ns) { |
|---|
| 1590 |
$el .= " xmlns:$nsp=\"$ns\"\n"; |
|---|
| 1591 |
} |
|---|
| 1592 |
$xml = $el . ">\n".$xml."</$schemaPrefix:schema>\n"; |
|---|
| 1593 |
return $xml; |
|---|
| 1594 |
} |
|---|
| 1595 |
|
|---|
| 1596 |
|
|---|
| 1597 |
|
|---|
| 1598 |
|
|---|
| 1599 |
|
|---|
| 1600 |
|
|---|
| 1601 |
|
|---|
| 1602 |
function xdebug($string){ |
|---|
| 1603 |
$this->debug('<' . $this->schemaTargetNamespace . '> '.$string); |
|---|
| 1604 |
} |
|---|
| 1605 |
|
|---|
| 1606 |
|
|---|
| 1607 |
|
|---|
| 1608 |
|
|---|
| 1609 |
|
|---|
| 1610 |
|
|---|
| 1611 |
|
|---|
| 1612 |
|
|---|
| 1613 |
|
|---|
| 1614 |
|
|---|
| 1615 |
|
|---|
| 1616 |
|
|---|
| 1617 |
|
|---|
| 1618 |
function getPHPType($type,$ns){ |
|---|
| 1619 |
if(isset($this->typemap[$ns][$type])){ |
|---|
| 1620 |
|
|---|
| 1621 |
return $this->typemap[$ns][$type]; |
|---|
| 1622 |
} elseif(isset($this->complexTypes[$type])){ |
|---|
| 1623 |
|
|---|
| 1624 |
return $this->complexTypes[$type]['phpType']; |
|---|
| 1625 |
} |
|---|
| 1626 |
return false; |
|---|
| 1627 |
} |
|---|
| 1628 |
|
|---|
| 1629 |
|
|---|
| 1630 |
|
|---|
| 1631 |
|
|---|
| 1632 |
|
|---|
| 1633 |
|
|---|
| 1634 |
|
|---|
| 1635 |
|
|---|
| 1636 |
|
|---|
| 1637 |
|
|---|
| 1638 |
|
|---|
| 1639 |
|
|---|
| 1640 |
|
|---|
| 1641 |
|
|---|
| 1642 |
|
|---|
| 1643 |
|
|---|
| 1644 |
|
|---|
| 1645 |
|
|---|
| 1646 |
|
|---|
| 1647 |
|
|---|
| 1648 |
|
|---|
| 1649 |
|
|---|
| 1650 |
|
|---|
| 1651 |
function getTypeDef($type){ |
|---|
| 1652 |
|
|---|
| 1653 |
if(isset($this->complexTypes[$type])){ |
|---|
| 1654 |
$this->xdebug("in getTypeDef, found complexType $type"); |
|---|
| 1655 |
return $this->complexTypes[$type]; |
|---|
| 1656 |
} elseif(isset($this->simpleTypes[$type])){ |
|---|
| 1657 |
$this->xdebug("in getTypeDef, found simpleType $type"); |
|---|
| 1658 |
if (!isset($this->simpleTypes[$type]['phpType'])) { |
|---|
| 1659 |
|
|---|
| 1660 |
|
|---|
| 1661 |
$uqType = substr($this->simpleTypes[$type]['type'], strrpos($this->simpleTypes[$type]['type'], ':') + 1); |
|---|
| 1662 |
$ns = substr($this->simpleTypes[$type]['type'], 0, strrpos($this->simpleTypes[$type]['type'], ':')); |
|---|
| 1663 |
$etype = $this->getTypeDef($uqType); |
|---|
| 1664 |
if ($etype) { |
|---|
| 1665 |
$this->xdebug("in getTypeDef, found type for simpleType $type:"); |
|---|
| 1666 |
$this->xdebug($this->varDump($etype)); |
|---|
| 1667 |
if (isset($etype['phpType'])) { |
|---|
| 1668 |
$this->simpleTypes[$type]['phpType'] = $etype['phpType']; |
|---|
| 1669 |
} |
|---|
| 1670 |
if (isset($etype['elements'])) { |
|---|
| 1671 |
$this->simpleTypes[$type]['elements'] = $etype['elements']; |
|---|
| 1672 |
} |
|---|
| 1673 |
} |
|---|
| 1674 |
} |
|---|
| 1675 |
return $this->simpleTypes[$type]; |
|---|
| 1676 |
} elseif(isset($this->elements[$type])){ |
|---|
| 1677 |
$this->xdebug("in getTypeDef, found element $type"); |
|---|
| 1678 |
if (!isset($this->elements[$type]['phpType'])) { |
|---|
| 1679 |
|
|---|
| 1680 |
$uqType = substr($this->elements[$type]['type'], strrpos($this->elements[$type]['type'], ':') + 1); |
|---|
| 1681 |
$ns = substr($this->elements[$type]['type'], 0, strrpos($this->elements[$type]['type'], ':')); |
|---|
| 1682 |
$etype = $this->getTypeDef($uqType); |
|---|
| 1683 |
if ($etype) { |
|---|
| 1684 |
$this->xdebug("in getTypeDef, found type for element $type:"); |
|---|
| 1685 |
$this->xdebug($this->varDump($etype)); |
|---|
| 1686 |
if (isset($etype['phpType'])) { |
|---|
| 1687 |
$this->elements[$type]['phpType'] = $etype['phpType']; |
|---|
| 1688 |
} |
|---|
| 1689 |
if (isset($etype['elements'])) { |
|---|
| 1690 |
$this->elements[$type]['elements'] = $etype['elements']; |
|---|
| 1691 |
} |
|---|
| 1692 |
} elseif ($ns == 'http://www.w3.org/2001/XMLSchema') { |
|---|
| 1693 |
$this->xdebug("in getTypeDef, element $type is an XSD type"); |
|---|
| 1694 |
$this->elements[$type]['phpType'] = 'scalar'; |
|---|
| 1695 |
} |
|---|
| 1696 |
} |
|---|
| 1697 |
return $this->elements[$type]; |
|---|
| 1698 |
} elseif(isset($this->attributes[$type])){ |
|---|
| 1699 |
$this->xdebug("in getTypeDef, found attribute $type"); |
|---|
| 1700 |
return $this->attributes[$type]; |
|---|
| 1701 |
} elseif (ereg('_ContainedType$', $type)) { |
|---|
| 1702 |
$this->xdebug("in getTypeDef, have an untyped element $type"); |
|---|
| 1703 |
$typeDef['typeClass'] = 'simpleType'; |
|---|
| 1704 |
$typeDef['phpType'] = 'scalar'; |
|---|
| 1705 |
$typeDef['type'] = 'http://www.w3.org/2001/XMLSchema:string'; |
|---|
| 1706 |
return $typeDef; |
|---|
| 1707 |
} |
|---|
| 1708 |
$this->xdebug("in getTypeDef, did not find $type"); |
|---|
| 1709 |
return false; |
|---|
| 1710 |
} |
|---|
| 1711 |
|
|---|
| 1712 |
|
|---|
| 1713 |
|
|---|
| 1714 |
|
|---|
| 1715 |
|
|---|
| 1716 |
|
|---|
| 1717 |
|
|---|
| 1718 |
|
|---|
| 1719 |
|
|---|
| 1720 |
function serializeTypeDef($type){ |
|---|
| 1721 |
|
|---|
| 1722 |
if($typeDef = $this->getTypeDef($type)){ |
|---|
| 1723 |
$str .= '<'.$type; |
|---|
| 1724 |
if(is_array($typeDef['attrs'])){ |
|---|
| 1725 |
foreach($attrs as $attName => $data){ |
|---|
| 1726 |
$str .= " $attName=\"{type = ".$data['type']."}\""; |
|---|
| 1727 |
} |
|---|
| 1728 |
} |
|---|
| 1729 |
$str .= " xmlns=\"".$this->schema['targetNamespace']."\""; |
|---|
| 1730 |
if(count($typeDef['elements']) > 0){ |
|---|
| 1731 |
$str .= ">"; |
|---|
| 1732 |
foreach($typeDef['elements'] as $element => $eData){ |
|---|
| 1733 |
$str .= $this->serializeTypeDef($element); |
|---|
| 1734 |
} |
|---|
| 1735 |
$str .= "</$type>"; |
|---|
| 1736 |
} elseif($typeDef['typeClass'] == 'element') { |
|---|
| 1737 |
$str .= "></$type>"; |
|---|
| 1738 |
} else { |
|---|
| 1739 |
$str .= "/>"; |
|---|
| 1740 |
} |
|---|
| 1741 |
return $str; |
|---|
| 1742 |
} |
|---|
| 1743 |
return false; |
|---|
| 1744 |
} |
|---|
| 1745 |
|
|---|
| 1746 |
|
|---|
| 1747 |
|
|---|
| 1748 |
|
|---|
| 1749 |
|
|---|
| 1750 |
|
|---|
| 1751 |
|
|---|
| 1752 |
|
|---|
| 1753 |
|
|---|
| 1754 |
|
|---|
| 1755 |
|
|---|
| 1756 |
function typeToForm($name,$type){ |
|---|
| 1757 |
|
|---|
| 1758 |
if($typeDef = $this->getTypeDef($type)){ |
|---|
| 1759 |
|
|---|
| 1760 |
if($typeDef['phpType'] == 'struct'){ |
|---|
| 1761 |
$buffer .= '<table>'; |
|---|
| 1762 |
foreach($typeDef['elements'] as $child => $childDef){ |
|---|
| 1763 |
$buffer .= " |
|---|
| 1764 |
<tr><td align='right'>$childDef[name] (type: ".$this->getLocalPart($childDef['type'])."):</td> |
|---|
| 1765 |
<td><input type='text' name='parameters[".$name."][$childDef[name]]'></td></tr>"; |
|---|
| 1766 |
} |
|---|
| 1767 |
$buffer .= '</table>'; |
|---|
| 1768 |
|
|---|
| 1769 |
} elseif($typeDef['phpType'] == 'array'){ |
|---|
| 1770 |
$buffer .= '<table>'; |
|---|
| 1771 |
for($i=0;$i < 3; $i++){ |
|---|
| 1772 |
$buffer .= " |
|---|
| 1773 |
<tr><td align='right'>array item (type: $typeDef[arrayType]):</td> |
|---|
| 1774 |
<td><input type='text' name='parameters[".$name."][]'></td></tr>"; |
|---|
| 1775 |
} |
|---|
| 1776 |
$buffer .= '</table>'; |
|---|
| 1777 |
|
|---|
| 1778 |
} else { |
|---|
| 1779 |
$buffer .= "<input type='text' name='parameters[$name]'>"; |
|---|
| 1780 |
} |
|---|
| 1781 |
} else { |
|---|
| 1782 |
$buffer .= "<input type='text' name='parameters[$name]'>"; |
|---|
| 1783 |
} |
|---|
| 1784 |
return $buffer; |
|---|
| 1785 |
} |
|---|
| 1786 |
|
|---|
| 1787 |
|
|---|
| 1788 |
|
|---|
| 1789 |
|
|---|
| 1790 |
|
|---|
| 1791 |
|
|---|
| 1792 |
|
|---|
| 1793 |
|
|---|
| 1794 |
|
|---|
| 1795 |
|
|---|
| 1796 |
|
|---|
| 1797 |
|
|---|
| 1798 |
|
|---|
| 1799 |
|
|---|
| 1800 |
|
|---|
| 1801 |
|
|---|
| 1802 |
|
|---|
| 1803 |
|
|---|
| 1804 |
|
|---|
| 1805 |
|
|---|
| 1806 |
|
|---|
| 1807 |
|
|---|
| 1808 |
|
|---|
| 1809 |
|
|---|
| 1810 |
|
|---|
| 1811 |
|
|---|
| 1812 |
|
|---|
| 1813 |
|
|---|
| 1814 |
|
|---|
| 1815 |
|
|---|
| 1816 |
|
|---|
| 1817 |
|
|---|
| 1818 |
|
|---|
| 1819 |
|
|---|
| 1820 |
|
|---|
| 1821 |
|
|---|
| 1822 |
|
|---|
| 1823 |
|
|---|
| 1824 |
|
|---|
| 1825 |
|
|---|
| 1826 |
|
|---|
| 1827 |
|
|---|
| 1828 |
function addComplexType($name,$typeClass='complexType',$phpType='array',$compositor='',$restrictionBase='',$elements=array(),$attrs=array(),$arrayType=''){ |
|---|
| 1829 |
$this->complexTypes[$name] = array( |
|---|
| 1830 |
'name' => $name, |
|---|
| 1831 |
'typeClass' => $typeClass, |
|---|
| 1832 |
'phpType' => $phpType, |
|---|
| 1833 |
'compositor'=> $compositor, |
|---|
| 1834 |
'restrictionBase' => $restrictionBase, |
|---|
| 1835 |
'elements' => $elements, |
|---|
| 1836 |
'attrs' => $attrs, |
|---|
| 1837 |
'arrayType' => $arrayType |
|---|
| 1838 |
); |
|---|
| 1839 |
|
|---|
| 1840 |
$this->xdebug("addComplexType $name:"); |
|---|
| 1841 |
$this->appendDebug($this->varDump($this->complexTypes[$name])); |
|---|
| 1842 |
} |
|---|
| 1843 |
|
|---|
| 1844 |
|
|---|
| 1845 |
|
|---|
| 1846 |
|
|---|
| 1847 |
|
|---|
| 1848 |
|
|---|
| 1849 |
|
|---|
| 1850 |
|
|---|
| 1851 |
|
|---|
| 1852 |
|
|---|
| 1853 |
|
|---|
| 1854 |
|
|---|
| 1855 |
|
|---|
| 1856 |
function addSimpleType($name, $restrictionBase='', $typeClass='simpleType', $phpType='scalar', $enumeration=array()) { |
|---|
| 1857 |
$this->simpleTypes[$name] = array( |
|---|
| 1858 |
'name' => $name, |
|---|
| 1859 |
'typeClass' => $typeClass, |
|---|
| 1860 |
'phpType' => $phpType, |
|---|
| 1861 |
'type' => $restrictionBase, |
|---|
| 1862 |
'enumeration' => $enumeration |
|---|
| 1863 |
); |
|---|
| 1864 |
|
|---|
| 1865 |
$this->xdebug("addSimpleType $name:"); |
|---|
| 1866 |
$this->appendDebug($this->varDump($this->simpleTypes[$name])); |
|---|
| 1867 |
} |
|---|
| 1868 |
|
|---|
| 1869 |
|
|---|
| 1870 |
|
|---|
| 1871 |
|
|---|
| 1872 |
|
|---|
| 1873 |
|
|---|
| 1874 |
|
|---|
| 1875 |
|
|---|
| 1876 |
function addElement($attrs) { |
|---|
| 1877 |
if (! $this->getPrefix($attrs['type'])) { |
|---|
| 1878 |
$attrs['type'] = $this->schemaTargetNamespace . ':' . $attrs['type']; |
|---|
| 1879 |
} |
|---|
| 1880 |
$this->elements[ $attrs['name'] ] = $attrs; |
|---|
| 1881 |
$this->elements[ $attrs['name'] ]['typeClass'] = 'element'; |
|---|
| 1882 |
|
|---|
| 1883 |
$this->xdebug("addElement " . $attrs['name']); |
|---|
| 1884 |
$this->appendDebug($this->varDump($this->elements[ $attrs['name'] ])); |
|---|
| 1885 |
} |
|---|
| 1886 |
} |
|---|
| 1887 |
|
|---|
| 1888 |
|
|---|
| 1889 |
|
|---|
| 1890 |
?><?php |
|---|
| 1891 |
|
|---|
| 1892 |
|
|---|
| 1893 |
|
|---|
| 1894 |
|
|---|
| 1895 |
|
|---|
| 1896 |
|
|---|
| 1897 |
|
|---|
| 1898 |
|
|---|
| 1899 |
|
|---|
| 1900 |
|
|---|
| 1901 |
|
|---|
| 1902 |
|
|---|
| 1903 |
|
|---|
| 1904 |
|
|---|
| 1905 |
class soapval extends nusoap_base { |
|---|
| 1906 |
|
|---|
| 1907 |
|
|---|
| 1908 |
|
|---|
| 1909 |
|
|---|
| 1910 |
|
|---|
| 1911 |
|
|---|
| 1912 |
var $name; |
|---|
| 1913 |
|
|---|
| 1914 |
|
|---|
| 1915 |
|
|---|
| 1916 |
|
|---|
| 1917 |
|
|---|
| 1918 |
|
|---|
| 1919 |
var $type; |
|---|
| 1920 |
|
|---|
| 1921 |
|
|---|
| 1922 |
|
|---|
| 1923 |
|
|---|
| 1924 |
|
|---|
| 1925 |
|
|---|
| 1926 |
var $value; |
|---|
| 1927 |
|
|---|
| 1928 |
|
|---|
| 1929 |
|
|---|
| 1930 |
|
|---|
| 1931 |
|
|---|
| 1932 |
|
|---|
| 1933 |
var $element_ns; |
|---|
| 1934 |
|
|---|
| 1935 |
|
|---|
| 1936 |
|
|---|
| 1937 |
|
|---|
| 1938 |
|
|---|
| 1939 |
|
|---|
| 1940 |
var $type_ns; |
|---|
| 1941 |
|
|---|
| 1942 |
|
|---|
| 1943 |
|
|---|
| 1944 |
|
|---|
| 1945 |
|
|---|
| 1946 |
|
|---|
| 1947 |
var $attributes; |
|---|
| 1948 |
|
|---|
| 1949 |
|
|---|
| 1950 |
|
|---|
| 1951 |
|
|---|
| 1952 |
|
|---|
| 1953 |
|
|---|
| 1954 |
|
|---|
| 1955 |
|
|---|
| 1956 |
|
|---|
| 1957 |
|
|---|
|
|---|