Beispiel #1
0
 public function send(BindingOperation $bOperation, array $params, array $headers = array())
 {
     $xml = $this->buildMessage($params, $bOperation, $bOperation->getInput(), $headers);
     $response = $this->getTransport()->send($xml, $this->port, $bOperation);
     if ($outMessage = $bOperation->getOutput()) {
         try {
             $retDoc = new XMLDom();
             $retDoc->loadXMLStrict($response);
         } catch (\DOMException $e) {
             throw new \Exception("Wrong response, expected valid XML. Found '" . substr($response, 0, 2000) . "...'", 100, $e);
         }
         list($head, $body, $env) = $this->getEnvelopeParts($retDoc);
         $partsReturned = $this->decodeMessage($body, $bOperation, $outMessage);
         foreach ($partsReturned as $param) {
             if ($param instanceof SoapFault) {
                 throw $param;
             }
         }
         // @todo configurazione per i metodi che ritornano piu parti
         if (count($partsReturned) == 1) {
             return reset($partsReturned);
         } elseif (count($partsReturned) == 0) {
             return null;
         }
         return $partsReturned;
     }
 }
Beispiel #2
0
 public function getParameters(BindingOperation $bOperation, Request $request)
 {
     $message = $bOperation->getInput();
     $dom = new XMLDom();
     $dom->loadXMLStrict($request->getContent());
     list($heads, $body) = $this->getEnvelopeParts($dom);
     $params = $this->decodeMessage($body, $bOperation, $bOperation->getInput());
     return $params;
 }
Beispiel #3
0
 /**
  * @return \goetas\xml\XMLDom
  */
 public function getXmlNode()
 {
     $dom = new XMLDom();
     $dom->loadXMLStrict($this->xml);
     return $dom;
 }