Exemple #1
0
 /**
  * This method renders the data for the writer.
  *
  * @access public
  * @return string                                           the processed data
  */
 public function render()
 {
     $xml = SOAP\Data\XML::declaration($this->metadata['encoding'][1]);
     $xml .= '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" />';
     $root = new SOAP\Data\XML($xml);
     $xmlns = is_string($this->metadata['xmlns']) ? $this->metadata['xmlns'] : '';
     $this->addHeader($root, $root, $this->metadata['credentials'], $xmlns);
     $this->addBody($root, $root, $this->data, $xmlns);
     return $root->asXML();
 }
Exemple #2
0
 /**
  * This method returns the processed resource as a collection.
  *
  * @access public
  * @param string $path                                      the path to the value to be returned
  * @return mixed                                            the resource as a collection
  */
 public function read($path = null)
 {
     $xml = SOAP\Data\XML::load($this->file);
     $directives = $xml->getProcessingInstruction('php-marshal');
     if (isset($directives['expandableProperties'])) {
         $this->directives->putEntry('expandableProperties', new Common\HashSet(preg_split('/\\s+/', $directives['expandableProperties'])));
     }
     $collection = $this->parseEnvelopeElement($xml);
     if ($path !== null) {
         $collection = Config\Helper::factory($collection)->getValue($path);
     }
     return $collection;
 }