Source for file Value.php
Documentation is available at Value.php
* This file contains the code for converting values between SOAP and PHP.
* LICENSE: This source file is subject to version 2.02 of the PHP license,
* that is bundled with this package in the file LICENSE, and is available at
* through the world-wide-web at http://www.php.net/license/2_02.txt. If you
* did not receive a copy of the PHP license and are unable to obtain it
* through the world-wide-web, please send a note to license@php.net so we can
* mail you a copy immediately.
* @author Dietrich Ayala <dietrich@ganx4.com> Original Author
* @author Shane Caraveo <Shane@Caraveo.com> Port to PEAR and more
* @author Chuck Hagenbuch <chuck@horde.org> Maintenance
* @author Jan Schneider <jan@horde.org> Maintenance
* @copyright 2003-2007 The PHP Group
* @license http://www.php.net/license/2_02.txt PHP License 2.02
* @link http://pear.php.net/package/SOAP
require_once 'SOAP/Base.php';
* This class converts values between PHP and SOAP.
* Originally based on SOAPx4 by Dietrich Ayala
* http://dietrich.ganx4.com/soapx4
* @author Shane Caraveo <shane@php.net> Conversion to PEAR and updates
* @author Dietrich Ayala <dietrich@ganx4.com> Original Author
* QName instance representing the value name.
* The value name, without namespace information.
* The namespace of the value name.
* QName instance representing the value type.
* The value type, without namespace information.
* The namespace of the value type.
* The type of the array elements, if this value is an array.
* A hash of additional attributes.
* List of encoding and serialization options.
* @param string $name Name of the SOAP value {namespace}name.
* @param mixed $type SOAP value {namespace}type. Determined
* automatically if not set.
* @param mixed $value Value to set.
* @param array $attributes A has of additional XML attributes to be
* added to the serialized value.
* @param array $options A list of encoding and serialization options:
* - 'attachment': array with information about
* - 'soap_encoding': defines encoding for SOAP
* message part of a MIME encoded SOAP request
* - 'keep_arrays_flat': use the tag name
* multiple times for each element when
* passing in an array in literal mode
* - 'no_type_prefix': supress adding of the
function SOAP_Value($name = '', $type = false , $value = null ,
$attributes = array (), $options = array ())
* @param SOAP_Base $serializer A SOAP_Base instance or subclass to
* @return string XML representation of $this.
return $serializer->_serializeValue ($this->value,
* This class converts values between PHP and SOAP. It is a simple wrapper
* around SOAP_Value, adding support for SOAP actor and mustunderstand
* Originally based on SOAPx4 by Dietrich Ayala
* http://dietrich.ganx4.com/soapx4
* @author Shane Caraveo <shane@php.net> Conversion to PEAR and updates
* @author Dietrich Ayala <dietrich@ganx4.com> Original Author
* @param string $name Name of the SOAP value {namespace}name.
* @param mixed $type SOAP value {namespace}type. Determined
* automatically if not set.
* @param mixed $value Value to set
* @param integer $mustunderstand Zero or one.
* @param mixed $attributes Attributes.
function SOAP_Header($name = '', $type, $value, $mustunderstand = 0 ,
parent ::SOAP_Value($name, $type, $value, $attributes);
$this->attributes[SOAP_BASE ::SOAPENVPrefix (). ':actor'] = $actor;
} elseif (!isset ($this->attributes[SOAP_BASE ::SOAPENVPrefix (). ':actor'])) {
$this->attributes[SOAP_BASE ::SOAPENVPrefix (). ':actor'] = 'http://schemas.xmlsoap.org/soap/actor/next';
$this->attributes[SOAP_BASE ::SOAPENVPrefix (). ':mustUnderstand'] = (int) $mustunderstand;
* This class handles MIME attachements per W3C's Note on Soap Attachements at
* http://www.w3.org/TR/SOAP-attachments
* @author Shane Caraveo <shane@php.net> Conversion to PEAR and updates
* @param string $name Name of the SOAP value <value_name>
* @param string $type The attachment's MIME type.
* @param string $filename The attachment's file name. Ignored if $file
* @param string $file The attachment data.
* @param array $attributes Attributes.
$filename, $file = null , $attributes = null )
$filedata = $file === null ? $this->_file2str ($filename) : $file;
if (PEAR ::isError ($filedata)) {
$this->options['attachment'] = $filedata;
$this->options['attachment'] = array ('body' => $filedata,
'disposition' => $filename,
* Returns the contents of the given file name as string.
* @param string $file_name The file location.
* @return string The file data or a PEAR_Error.
function _file2str ($file_name)
return PEAR ::raiseError ('File is not readable: ' . $file_name);
if (!$fd = fopen($file_name, 'rb')) {
return PEAR ::raiseError ('Could not open ' . $file_name);
Documentation generated on Mon, 04 Aug 2008 20:00:34 -0400 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.
|