Exemplo n.º 1
0
 public function getXML()
 {
     $DOMDocument = new DOMDocument();
     $DOMDocument->formatOutput = true;
     $DOMDocument->preserveWhiteSpace = false;
     $envelope = $DOMDocument->createElementNS('http://schemas.xmlsoap.org/soap/envelope/', 'Envelope');
     $envelope->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:elem', $this->_serviceUrl);
     $body = $DOMDocument->createElement('Body');
     $method = $DOMDocument->createElement('elem:' . $this->_methodName);
     foreach ($this->_types as $type) {
         if ($type instanceof Simple) {
             $element = $DOMDocument->createElement($type->getName(), '?');
             $method->appendChild($element);
         }
         if ($type instanceof Arrays) {
             $element = $DOMDocument->createElement($type->getName());
             $element->setAttribute('soapenc:arrayType', $type->getType() . '[]');
             $element->setAttribute('soapenc:offset', '?');
             $el = $DOMDocument->createElement(Strings::depluralize($type->getName()));
             $element->appendChild($el);
             $method->appendChild($element);
         }
     }
     $body->appendChild($method);
     $envelope->appendChild($body);
     $DOMDocument->appendChild($envelope);
     return $DOMDocument->saveXML();
 }
Exemplo n.º 2
0
 public function sanitizeClassName($namespace, $class)
 {
     return Strings::sanitizedNamespaceWithClass($namespace, $class);
 }
Exemplo n.º 3
0
 public function getNamespaceWithSanitizedClass()
 {
     return Strings::sanitizedNamespaceWithClass($this->_namespace, $this->_class);
 }