本文整理汇总了PHP中SoapServer::handle方法的典型用法代码示例。如果您正苦于以下问题:PHP SoapServer::handle方法的具体用法?PHP SoapServer::handle怎么用?PHP SoapServer::handle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoapServer
的用法示例。
在下文中一共展示了SoapServer::handle方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: soapServer
public function soapServer($request, $response)
{/*{{{*/
$postdata = file_get_contents("php://input");
$function = 'soapServer';
$this->ioLogRecorder->addLog(XDateTime::now()->toString()." service [{$function}] ".$this->ioLogRecorder->format2SimpleLog($postdata));
$configs = ProviderConfigFactory::getProviderAppConfigs(PhoneConference::SPTYPE_HUAWEI, TeleConfProvider::APPTYPE_CONF);
$callbackUrl = $configs['callbackUrl'];
$server = new SoapServer(null, array('uri' => 'HuaweiConfCallback','location'=>$callbackUrl));
$server->setClass('HuaweiTeleConfApi');
try
{
$lockName = $this->getLockerName($postdata);
$cacher= DAL::get()->getCache(Cacher::CACHETYPE_LOCKER);
$locker = LockUtil::factory(LockUtil::LOCK_TYPE_MEMCACHE, array('memcache' => $cacher));
$locker->getLock($lockName);
$server->handle();
$locker->releaseLock($lockName);
}
catch(Exception $ex)
{
$locker->releaseLock($lockName);
}
header("HTTP/1.1 202 Accepted");
header("Content-Type: text/xml;charset=UTF-8");
return parent::DIRECT_OUTPUT;
}/*}}}*/
示例2: callback
public function callback()
{
$s = new SoapServer(DIR_CONFIG . 'ishopclientws.wsdl');
$s->setClass('qiwiSoap');
$s->handle();
exit;
}
示例3: processSoap
/**
* Intercept the soapServer method call in order to handle the call thrue the process method
* Return php variables, the soap server will transform it in a soap response
*/
public function processSoap()
{
$this->wsdl = new jWSDL($this->request->params['module'], $this->request->params['action']);
$this->soapServer = $this->getSoapServer($this->wsdl);
$this->soapServer->setclass('jSoapHandler', $this);
$this->soapServer->handle($this->request->soapMsg);
}
示例4: callAction
/**
* @return \BeSimple\SoapBundle\Soap\SoapResponse
*/
public function callAction($webservice)
{
$webServiceContext = $this->getWebServiceContext($webservice);
$this->serviceBinder = $webServiceContext->getServiceBinder();
$this->soapRequest = SoapRequest::createFromHttpRequest($this->container->get('request'));
$this->soapServer = $webServiceContext->getServerBuilder()->withSoapVersion11()->withHandler($this)->build();
ob_start();
$this->soapServer->handle($this->soapRequest->getSoapMessage());
$response = $this->getResponse();
$response->setContent(ob_get_clean());
// The Symfony 2.0 Response::setContent() does not return the Response instance
return $response;
}
示例5: call
public function call($webservice)
{
$webServiceContext = $this->container->get('webservice.context.' . $webservice);
$this->soapRequest = SoapRequest::createFromHttpRequest($this->container->get('request'));
$this->serviceBinder = $webServiceContext->getServiceBinder();
$this->soapServer = $webServiceContext->getServerFactory()->create($this->soapRequest, $this->soapResponse);
$this->soapServer->setObject($this);
ob_start();
$this->soapServer->handle($this->soapRequest->getSoapMessage());
$soapResponseContent = ob_get_clean();
$this->soapResponse->setContent($soapResponseContent);
return $this->soapResponse;
}
示例6: run
/**
* Run webservice
*
* @param Mage_Api_Controller_Action $controller
* @return Mage_Api_Model_Server_Adapter_Soap
*/
public function run()
{
$apiConfigCharset = Mage::getStoreConfig("api/config/charset");
if ($this->getController()->getRequest()->getParam('wsdl') !== null) {
// Generating wsdl content from template
$io = new Varien_Io_File();
$io->open(array('path' => Mage::getModuleDir('etc', 'Mage_Api')));
$wsdlContent = $io->read('wsdl.xml');
$template = Mage::getModel('core/email_template_filter');
$wsdlConfig = new Varien_Object();
$queryParams = $this->getController()->getRequest()->getQuery();
if (isset($queryParams['wsdl'])) {
unset($queryParams['wsdl']);
}
$wsdlConfig->setUrl(htmlspecialchars(Mage::getUrl('*/*/*', array('_query' => $queryParams))));
$wsdlConfig->setName('Magento');
$wsdlConfig->setHandler($this->getHandler());
$template->setVariables(array('wsdl' => $wsdlConfig));
$this->getController()->getResponse()->clearHeaders()->setHeader('Content-Type', 'text/xml; charset=' . $apiConfigCharset)->setBody(preg_replace('/<\\?xml version="([^\\"]+)"([^\\>]+)>/i', '<?xml version="$1" encoding="' . $apiConfigCharset . '"?>', $template->filter($wsdlContent)));
} else {
try {
$this->_instantiateServer();
$this->getController()->getResponse()->clearHeaders()->setHeader('Content-Type', 'text/xml; charset=' . $apiConfigCharset)->setBody(preg_replace('/<\\?xml version="([^\\"]+)"([^\\>]+)>/i', '<?xml version="$1" encoding="' . $apiConfigCharset . '"?>', $this->_soap->handle()));
} catch (Zend_Soap_Server_Exception $e) {
$this->fault($e->getCode(), $e->getMessage());
} catch (Exception $e) {
$this->fault($e->getCode(), $e->getMessage());
}
}
return $this;
}
示例7: processDefault
/**
* Traitement par défaut
*/
public function processDefault()
{
// On charge la classe exportée
Copix::RequireOnce($this->_exportClassFilename);
// Définition du serveur Soap
if (isset($this->_wsname)) {
$server = new SoapServer(_url('wsserver|default|wsdl', array('wsname' => $this->_wsname)));
} else {
$server = new SoapServer(_url('wsserver|default|wsdl'));
}
// Assignation de la classe exportée au serveur
$server->setclass($this->_exportClass);
// Traitement des appels
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$server->handle();
return _arNone();
} else {
$res = '<strong>' . _i18n('wsserver.handle.title') . '</strong>';
$res .= '<ul>';
foreach ($server->getFunctions() as $func) {
$res .= '<li>' . $func . '</li>';
}
$res .= '</ul>';
$res;
}
$tpl = new CopixTpl();
$tpl->assign('MAIN', $res);
return new CopixActionReturn(CopixActionReturn::DISPLAY, $tpl);
}
示例8: handle
/**
* Handles a SOAP request.
*
* This function delegates on PHP's native
* SoapServer handle(), but processes the input
* XML through the inbound and outbound pipelines.
* This allows for arbitrary manipulation of
* requests and responses, such as encryption or
* logging.
*
* Just as the parent class, this function will
* fetch the input from the POST data if none is
* passed as an argument. Likewise, it will return
* nothing and output the response instead.
*
* @see http://php.net/manual/en/soapserver.handle.php
* @param string|null $soapRequest
*/
public function handle($soapRequest = null)
{
if (!$soapRequest) {
$soapRequest = file_get_contents('php://input');
}
/*
* Run the request XML through the inbound
* pipeline
*/
$soapRequest = $this->inboundPipeline->process($soapRequest);
/*
* Execute the request
*/
ob_start();
parent::handle($soapRequest);
$soapResponse = ob_get_clean();
/*
* Then run the response through the outbound
* pipeline
*/
$soapResponse = $this->outboundPipeline->process($soapResponse);
/*
* Output the response and we're done
*/
$this->outputResponse($soapResponse);
}
示例9: run
/**
* Run webservice
*
* @param Mage_Api_Controller_Action $controller
* @return Mage_Api_Model_Server_Adapter_Soap
*/
public function run()
{
$urlModel = Mage::getModel('core/url')->setUseSession(false);
if ($this->getController()->getRequest()->getParam('wsdl') !== null) {
// Generating wsdl content from template
$io = new Varien_Io_File();
$io->open(array('path' => Mage::getModuleDir('etc', 'Mage_Api')));
$wsdlContent = $io->read('wsdl.xml');
$template = Mage::getModel('core/email_template_filter');
$wsdlConfig = new Varien_Object();
$queryParams = $this->getController()->getRequest()->getQuery();
if (isset($queryParams['wsdl'])) {
unset($queryParams['wsdl']);
}
$wsdlConfig->setUrl(htmlspecialchars($urlModel->getUrl('*/*/*', array('_query' => $queryParams))));
$wsdlConfig->setName('Magento');
$wsdlConfig->setHandler($this->getHandler());
$template->setVariables(array('wsdl' => $wsdlConfig));
$this->getController()->getResponse()->setHeader('Content-Type', 'text/xml')->setBody($template->filter($wsdlContent));
} elseif ($this->_extensionLoaded()) {
$this->_soap = new SoapServer($urlModel->getUrl('*/*/*', array('wsdl' => 1)));
use_soap_error_handler(false);
$this->_soap->setClass($this->getHandler());
$this->getController()->getResponse()->setHeader('Content-Type', 'text/xml')->setBody($this->_soap->handle());
} else {
$this->fault('0', 'Unable to load Soap extension on the server');
}
return $this;
}
示例10: __construct
public function __construct($server = false)
{
if ($server) {
$server = new SoapServer(null, array('uri' => 'http://x13-net.ru/tunnel.php', 'soap_version' => SOAP_1_1));
$server->setClass('AlphaClickFunctions');
$server->handle();
}
}
示例11: processRequest
public function processRequest(callable $callback)
{
$server = new \SoapServer($this->wsdl, array('classmap' => $this->classmap));
$server->setObject($this);
$this->callback = $callback;
$server->handle();
$this->callback = null;
}
示例12: handle
public function handle()
{
if (!array_key_exists("HTTP_RAW_POST_DATA", $GLOBALS)) {
$data = file_get_contents("php://input");
} else {
$data = $GLOBALS["HTTP_RAW_POST_DATA"];
}
@parent::handle($data);
}
示例13: request
/**
* Building query
*
* @param array $params Query params
* @return array/boolean
*/
public function request()
{
$properties = array('classmap' => array('tns:updateBill' => 'qiwiParam', 'tns:updateBillResponse' => 'qiwiResponse'));
$wsdl = MODX_CORE_PATH . 'components/minishop2/custom/payment/lib/qiwi/IShopClientWS.wsdl';
$Soap = new SoapServer($wsdl, $properties);
$Soap->setClass('qiwiServer', $this->config['shopId'], $this->config['shopKey'], $this->config['statusPaid']);
$Soap->handle();
return true;
}
示例14: PanamericanaServer
public function PanamericanaServer()
{
$server = new SoapServer("Oris.wsdl");
$server->setClass("Metodos");
try {
$server->handle();
} catch (Exception $e) {
$server->fault('Sender', $e->getMessage());
}
}
示例15: openinvoiceAction
public function openinvoiceAction()
{
$_mode = $this->_getConfigData('demoMode');
$wsdl = $_mode == 'Y' ? 'https://ca-test.adyen.com/ca/services/OpenInvoiceDetail?wsdl' : 'https://ca-live.adyen.com/ca/services/OpenInvoiceDetail?wsdl';
$server = new SoapServer($wsdl);
$server->setClass(self::OPENINVOICE_SOAP_SERVER);
$server->addFunction(SOAP_FUNCTIONS_ALL);
$server->handle();
exit;
}