コード例 #1
0
ファイル: SoapServer.php プロジェクト: goetas/webservices
 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;
 }
コード例 #2
0
ファイル: Http.php プロジェクト: goetas/webservices
 /**
  * @return string
  */
 public function send($xml, Port $port, BindingOperation $bindingOperation)
 {
     $url = $port->getDomElement()->evaluate("string(soap:address/@location)", array("soap" => SoapClient::NS));
     $soapAction = $bindingOperation->getDomElement()->evaluate("string(soap:operation/@soapAction)", array("soap" => SoapClient::NS));
     $request = new EntityEnclosingRequest("POST", $url);
     $request->setBody($xml, "text/xml; charset=utf-8");
     $request->addHeader("SOAPAction", '"' . $soapAction . '"');
     if ($this->debugUri) {
         $request->setUrl($this->debugUri);
     }
     try {
         $response = $this->client->send($request);
     } catch (BadResponseException $e) {
         $response = $e->getResponse();
     }
     if (!$response->isSuccessful() && strpos($response->getContentType(), '/xml') === false) {
         throw new TransportException($response->getReasonPhrase(), $response->getStatusCode());
     }
     return $response->getBody(true);
 }
コード例 #3
0
ファイル: Http.php プロジェクト: goetas/webservices
 /**
  * @return string
  */
 public function send($xml, Port $port, BindingOperation $bindingOperation)
 {
     $soapAction = $bindingOperation->getDomElement()->evaluate("string(soap:operation/@soapAction)", array("soap" => SoapClient::NS));
     if (!$soapAction) {
         $soapActionRequired = $bindingOperation->getDomElement()->evaluate("string(soap:operation/@soapActionRequired)", array("soap" => SoapClient::NS));
         if ($soapActionRequired == "true") {
             throw new TransportException("SoapAction required for operation '" . $bindingOperation->getName() . "'", 100);
         }
     }
     $url = $port->getDomElement()->evaluate("string(soap:address/@location)", array("soap" => SoapClient::NS));
     $request = new EntityEnclosingRequest("POST", $url);
     $request->setBody($xml, 'application/soap+xml; charset=utf-8;  action="' . $soapAction . '"');
     if ($this->debugUri) {
         $request->setUrl($this->debugUri);
     }
     $response = $this->client->send($request);
     if (!$response->isSuccessful()) {
         throw new TransportException($response->getReasonPhrase(), $response->getStatusCode());
     }
     return $response->getBody(true);
 }
コード例 #4
0
ファイル: RpcStyle.php プロジェクト: goetas/webservices
 public function wrap(XMLDomElement $body, BindingOperation $operation, Message $message, array $params)
 {
     $root = $body->addPrefixedChild($operation->getNs(), $operation->getName());
     parent::wrap($root, $operation, $message, $params);
 }