本文整理汇总了PHP中SoapServer::setObject方法的典型用法代码示例。如果您正苦于以下问题:PHP SoapServer::setObject方法的具体用法?PHP SoapServer::setObject怎么用?PHP SoapServer::setObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoapServer
的用法示例。
在下文中一共展示了SoapServer::setObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: 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;
}
示例3: serverAction
/**
* @Route("/server", name="server")
*/
public function serverAction()
{
$server = new \SoapServer('web/public/hello.wsdl');
$server->setObject($this->get('hello_service'));
$response = new Response();
$response->headers->set('Content-Type', 'text/xml; charset=ISO-8859-1');
ob_start();
$server->handle();
$response->setContent(ob_get_clean());
return $response;
}
示例4: serverAction
public function serverAction(Request $request)
{
$baseurl = $request->getScheme() . '://' . $request->getHttpHost() . $request->getBasePath();
$server = new \SoapServer($baseurl . '/APIxml.wsdl');
$server->setObject($this->get('moocsy.api_xml'));
$response = new Response();
$response->headers->set('Content-Type', 'text/xml; charset=ISO-8859-1');
ob_start();
$server->handle();
$response->setContent(ob_get_clean());
return $response;
}
示例5: handleRequest
/**
* Handle the service request
*/
protected function handleRequest()
{
$server = new \SoapServer(null, ['uri' => $this->getServiceUri()]);
/** @var object $object */
$object = GeneralUtility::makeInstance($this->serverClass);
$server->setObject($object);
try {
$server->handle();
} catch (\Exception $ex) {
$server->fault($ex->getCode(), $ex->getMessage());
}
}
示例6: sendKeyAction
/**
* @Route("/soap/key")
* @Template()
*/
public function sendKeyAction()
{
// $server = new \SoapServer($this->container->get('templating.helper.assets')->getUrl('cibsoap/soap/test.wsdl'));
$server = new \SoapServer('/var/www/LicenseManager/web/bundles/cibsoap/soap/licenseSoap.wsdl');
// $server = new \SoapServer('C:\wamp\www\LicenseManager\web\bundles\cibsoap\soap\licenseSoapWindows.wsdl');
$server->setObject($this->get('sendKey'));
$response = new Response();
$response->headers->set('Content-Type', 'text/xml; charset=utf-8');
ob_start();
$server->handle();
$response->setContent(ob_get_clean());
return $response;
}
示例7: build
/**
* Finally returns a SoapClient instance.
*
* @return \BeSimple\SoapServer\SoapServer
*/
public function build()
{
$this->validateOptions();
use_soap_error_handler($this->errorReporting);
$server = new SoapServer($this->wsdl, $this->getSoapOptions());
if (null !== $this->persistence) {
$server->setPersistence($this->persistence);
}
if (null !== $this->handlerClass) {
$server->setClass($this->handlerClass);
} elseif (null !== $this->handlerObject) {
$server->setObject($this->handlerObject);
}
return $server;
}
示例8: serverAction
public function serverAction()
{
ini_set("soap.wsdl_cache", "0");
ini_set("soap.wsdl_cache_enabled", "0");
ini_set('soap.wsdl_cache_ttl', 0);
$filePath = $this->getServiceProvider()->getWsdlPath();
$soap = new \SoapServer($filePath);
$soap->setObject($this->getServiceProvider()->getService());
$response = new Response();
$response->headers->set('Content-Type', 'text/xml');
ob_start();
$soap->handle();
$response->setContent(ob_get_clean());
return $response;
}
示例9: SoapFault
<?php
class Foo
{
function __call($name, $args)
{
if ($name == "test") {
return "Hello World";
} else {
return SoapFault("Server", "Function {$name} doesn't exist");
}
}
}
$foo = new Foo();
$server = new SoapServer(null, array('uri' => "http://testuri.org"));
$server->setObject($foo);
$HTTP_RAW_POST_DATA = <<<EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:si="http://soapinterop.org/xsd">
<SOAP-ENV:Body>
<ns1:test xmlns:ns1="http://testuri.org" />
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
EOF;
$server->handle($HTTP_RAW_POST_DATA);
echo "ok\n";
示例10: Encoder
<?php
/**
* LinkQuick - vložení nové adresy do databáze
* @author Vitex <vitex@hippy.cz>
* @copyright Vitex@hippy.cz (G) 2009,2011
*/
require_once 'includes/LQInit.php';
require_once 'classes/LQEncoder.php';
$encoder = new Encoder();
$server = new SoapServer(null, ['uri' => EasePage::phpSelf()]);
$server->setObject($encoder);
$server->handle();
/*
function hello($someone) {
return "Hello " . $someone . "!";
}
$server = new SoapServer(null, array('uri' => "urn://www.herong.home/res"));
$server->addFunction("hello");
$server->handle();
*/
示例11: SoapVar
$file = "LeerlinginfoNietBeschikbaar";
$foutTemp = 1;
break;
case "206314401":
$file = "LeveringGeweigerd";
$foutTemp = 1;
break;
default:
$file = "LeerlingNietBekend";
$foutTemp = 1;
}
$fout = $school->sessionResponse->fout;
if ($school->sessionResponse->fout == 'GeenRelatieMetDoel') {
$fout = 'LeveringGeweigerd';
}
// sessionControlResponse contains fault
if (isset($school->sessionResponse->fout)) {
return new SoapVar('<ns1:documentResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema"><ns1:fout>' . $fout . '</ns1:fout></ns1:documentResponse>', XSD_ANYXML);
} else {
if ($foutTemp == '1') {
return new SoapVar('<ns1:documentResponse xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema"><ns1:fout>' . $file . '</ns1:fout></ns1:documentResponse>', XSD_ANYXML);
} else {
return new SoapVar('<ns1:documentResponse xmlns="http://www.edustandaard.nl/oso_gegevensset/1.2/dossier" >' . $file . '</ns1:documentResponse>', XSD_ANYXML);
}
}
}
}
//here the documentsRequest is received. From here all the necessary information like bsn, sessionId is passed to the function Document
$server = new SoapServer($wsdl);
$server->setObject(new PSE($wsdl, $my_cert_file3, $passphrase3, "98SS", $aanleverpunt));
$server->handle();
示例12: SoapServer
<?php
ini_set('display_errors', 1);
require_once "MyServer.php";
$soapServer = new SoapServer("schema.wsdl");
$soapServer->setObject(new MyServer());
$soapServer->handle();
示例13: updateConnectionBandwidth
$path->path_order = $i;
$i++;
$path->setPortBySTP($dst->item(0)->nodeValue);
$path->setDomainBySTP($dst->item(0)->nodeValue);
if (!$path->save()) {
Yii::trace($path);
return false;
}
}
return true;
}
private function updateConnectionBandwidth($conn, $response)
{
$criteria = $response->reservation->criteria;
Yii::trace(print_r($criteria, true));
$p2pXml = $criteria->any;
$p2pXml = str_replace("<nsi_p2p:p2ps>", "<p2p>", $p2pXml);
$p2pXml = str_replace("</nsi_p2p:p2ps>", "</p2p>", $p2pXml);
$p2pXml = '<?xml version="1.0" encoding="UTF-8"?>' . $p2pXml;
$xml = new \DOMDocument();
$xml->loadXML($p2pXml);
$parser = new \DOMXpath($xml);
$cap = $parser->query("//capacity");
$conn->bandwidth = $cap->item(0)->nodeValue;
return true;
}
}
$wsdl = Url::to('@web/wsdl/ogf_nsi_connection_requester_v2_0.wsdl', true);
$requester = new \SoapServer($wsdl, array('encoding' => 'UTF-8'));
$requester->setObject(new RequesterController('req', Module::getInstance()));
$requester->handle();
示例14: SoapServer
<?php
use Lib\Config;
// Inclusao do arquivo de bootstrap
require __DIR__ . '/bootstrap.php';
if ($_GET) {
if (isset($_GET['modulo'])) {
$modulo = "Model\\{$_GET['modulo']}";
$objeto = new $modulo();
$servidor_soap = new SoapServer(Config::get('path') . "wsdl/{$_GET['modulo']}.wsdl");
$servidor_soap->setObject($objeto);
$servidor_soap->handle();
}
}
示例15: echoString
return getXml($myresponse);
}
}
//
function echoString($inputString)
{
return $inputString;
}
//create a new SOAP server in non - WSDL mode
$server = new SoapServer(NULL, $options);
// NG with functions and addFunction(SOAP_FUNCTIONS_ALL) you get all the php functions and everything else NG
// looks like you can addFunction or setClass, but you can't mix and match
//$server->addFunction("echoString");
//attach the API class to the SOAP Server
//$server->setClass('MyAPI','arg1 maybe a cert');
$server->setObject(new MyService());
//start the SOAP requests handler
$server->handle();
//$server->addFunction(SOAP_FUNCTIONS_ALL);
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$server->handle();
} else {
echo "This SOAP server can handle following functions:<br>";
$functions = $server->getFunctions();
foreach ($functions as $func) {
echo $func . "<br>";
}
}
//nada nothing zip zilch wtf
//$definedVars = get_defined_vars(); // return empty if from here
//error_log('ss defined variable'. displaydefinedVariables($definedVars),0);