Ignore:
Timestamp:
2012/01/17 16:32:25 (12 years ago)
Author:
Seasoft
Message:

2.12系へマイルストーン変更となったチケット分を差し戻し
r21326 #1536
r21325 #1528
r21324 #1547,#1546
r21323 #1546
r21322 #1543
r21321 #1536
r21320 #1536
r21319 #1544
r21318 #1521,#1522
r21317 #1431

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/module/SOAP/Value.php

    r21318 r21410  
    4141{ 
    4242    /** 
    43      * The actual value. 
    44      * 
    45      * @var mixed 
     43     * @var string 
    4644     */ 
    4745    var $value = null; 
    4846 
    4947    /** 
    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 
    5474    var $nqn; 
    55  
    56     /** 
    57      * The value name, without namespace information. 
    58      * 
    59      * @var string 
    60      */ 
    61     var $name = ''; 
    62  
    63     /** 
    64      * The namespace of the value name. 
    65      * 
    66      * @var string 
    67      */ 
    68     var $namespace = ''; 
    69  
    70     /** 
    71      * QName instance representing the value type. 
    72      * 
    73      * @var QName 
    74      */ 
    7575    var $tqn; 
    76  
    77     /** 
    78      * The value type, without namespace information. 
    79      * 
    80      * @var string 
    81      */ 
    82     var $type = ''; 
    83  
    84     /** 
    85      * The namespace of the value type. 
    86      * 
    87      * @var string 
    88      */ 
    89     var $type_namespace = ''; 
    90  
    91     /** 
    92      * The type of the array elements, if this value is an array. 
    93      * 
    94      * @var string 
    95      */ 
    96     var $arrayType = ''; 
    97  
    98     /** 
    99      * A hash of additional attributes. 
    100      * 
    101      * @see SOAP_Value() 
    102      * @var array 
    103      */ 
    104     var $attributes = array(); 
    105  
    106     /** 
    107      * List of encoding and serialization options. 
    108      * 
    109      * @see SOAP_Value() 
    110      * @var array 
    111      */ 
    112     var $options = array(); 
    11376 
    11477    /** 
     
    11982     *                           automatically if not set. 
    12083     * @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. 
    13485     */ 
    13586    function SOAP_Value($name = '', $type = false, $value = null, 
    136                         $attributes = array(), $options = array()) 
    137     { 
     87                        $attributes = array()) 
     88    { 
     89        // Detect type if not passed. 
    13890        $this->nqn = new QName($name); 
    13991        $this->name = $this->nqn->name; 
    14092        $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; 
    14697        $this->value = $value; 
    14798        $this->attributes = $attributes; 
    148         $this->options = $options; 
    14999    } 
    150100 
     
    160110    { 
    161111        return $serializer->_serializeValue($this->value, 
    162                                             $this->nqn, 
    163                                             $this->tqn, 
     112                                            $this->name, 
     113                                            $this->type, 
     114                                            $this->namespace, 
     115                                            $this->type_namespace, 
    164116                                            $this->options, 
    165117                                            $this->attributes, 
     
    205157 
    206158        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; 
    212164    } 
    213165 
     
    232184     *                          is provide. 
    233185     * @param string $file      The attachment data. 
    234      * @param array $attributes Attributes. 
    235186     */ 
    236187    function SOAP_Attachment($name = '', $type = 'application/octet-stream', 
    237                              $filename, $file = null, $attributes = null) 
     188                             $filename, $file = null) 
    238189    { 
    239190        parent::SOAP_Value($name, null, null); 
    240191 
    241         $filedata = $file === null ? $this->_file2str($filename) : $file; 
     192        $filedata = ($file === null) ? $this->_file2str($filename) : $file; 
    242193        $filename = basename($filename); 
    243194        if (PEAR::isError($filedata)) { 
     
    248199        $cid = md5(uniqid(time())); 
    249200 
    250         $this->attributes = $attributes; 
    251         $this->attributes['href'] = 'cid:' . $cid; 
     201        $this->attributes['href'] = 'cid:' . $cid;  
    252202 
    253203        $this->options['attachment'] = array('body' => $filedata, 
Note: See TracChangeset for help on using the changeset viewer.