本文整理汇总了PHP中SOAP_Server类的典型用法代码示例。如果您正苦于以下问题:PHP SOAP_Server类的具体用法?PHP SOAP_Server怎么用?PHP SOAP_Server使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SOAP_Server类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SOAP_Server_TCP
function SOAP_Server_TCP($localaddr = '127.0.0.1', $port = 10000, $type = 'sequential')
{
parent::SOAP_Server();
$this->localaddr = $localaddr;
$this->port = $port;
$this->type = $type;
}
示例2: SOAP_Server_TCP
function SOAP_Server_TCP($localaddr = "127.0.0.1", $port = 10000, $listen = 5, $reuse = TRUE)
{
parent::SOAP_Server();
$this->localaddr = $localaddr;
$this->port = $port;
$this->listen = $listen;
$this->reuse = $reuse;
}
示例3: SOAP_Server_Email
function SOAP_Server_Email($send_response = true)
{
parent::SOAP_Server();
$this->send_response = $send_response;
}
示例4: SOAP_Server
// | This source file is subject to version 2.02 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/2_02.txt. |
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Authors: Shane Caraveo <Shane@Caraveo.com> |
// +----------------------------------------------------------------------+
//
// $Id: server.php,v 1.10 2005/03/10 23:16:40 yunosh Exp $
//
// first, include the SOAP/Server class
require_once 'SOAP/Server.php';
$server = new SOAP_Server();
/* tell server to translate to classes we provide if possible */
$server->_auto_translation = true;
require_once 'example_server.php';
$soapclass = new SOAP_Example_Server();
$server->addObjectMap($soapclass, 'urn:SOAP_Example_Server');
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
$server->service($HTTP_RAW_POST_DATA);
} else {
require_once 'SOAP/Disco.php';
$disco = new SOAP_DISCO_Server($server, 'ServerExample');
header("Content-type: text/xml");
if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'wsdl') == 0) {
echo $disco->getWSDL();
} else {
echo $disco->getDISCO();
示例5: SOAP_Value
}
}
return new SOAP_Value('echoStringArrayReturn', null, $ra);
}
function echoStruct($inputStruct)
{
if (is_object($inputStruct) && strtolower(get_class($inputStruct)) == 'soapstruct') {
return $inputStruct->__to_soap('return');
} else {
if (is_object($inputStruct)) {
$inputStruct = get_object_vars($inputStruct);
}
$struct = new SOAPStruct($inputStruct['varString'], $inputStruct['varInt'], $inputStruct['varFloat']);
return $struct->__to_soap('return');
}
}
function echoVoid()
{
return null;
}
}
// http://www.whitemesa.com/r3/interop3.html
// http://www.whitemesa.com/r3/plan.html
$groupd = new SOAP_Interop_GroupDRpcEnc();
$server = new SOAP_Server();
$server->_auto_translation = true;
$server->addObjectMap($groupd, 'http://soapinterop/');
$server->addObjectMap($groupd, 'http://soapinterop.org/xsd');
$server->addObjectMap($groupd, 'http://soapinterop.org/WSDLInteropTestRpcEnc');
$server->bind('http://localhost/soap_interop/wsdl/InteropTestRpcEnc.wsdl.php');
$server->service(isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : null);
示例6: SOAP_Value
{
# well, lets imagine here some code for adding given mp3track to db or whatever...
$MethodDebug["rc"] = new SOAP_Value("rc", "boolean", true);
$MethodDebug["ErrNo"] = new SOAP_Value("ErrNo", "int", (int) 0);
$MethodDebug["Error"] = new SOAP_Value("Error", "string", "");
return new SOAP_Value('return', '{urn:MP3DB}AddMP3TrackResult', array("MethodDebug" => new SOAP_Value('MethodDebug', '{urn:MP3DB}MethodDebug', $MethodDebug)));
}
function __dispatch($methodname)
{
if (isset($this->__dispatch_map[$methodname])) {
return $this->__dispatch_map[$methodname];
}
return NULL;
}
}
$server = new SOAP_Server();
$server->_auto_translation = true;
$MP3DB_Class = new MP3DB_Class();
$server->addObjectMap($MP3DB_Class, 'urn:MP3DB');
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
$server->service($HTTP_RAW_POST_DATA);
} else {
require_once 'SOAP/Disco.php';
$disco = new SOAP_DISCO_Server($server, "MP3DB");
header("Content-type: text/xml");
if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'wsdl') == 0) {
echo $disco->getWSDL();
} else {
echo $disco->getDISCO();
}
exit;
示例7: run
/**
* This runs the web service
*
* @static
* @access public
*/
function run()
{
if (defined('JSON_WEBSERVICE')) {
$this->runJSON();
return;
}
ob_start();
$server = new SOAP_Server();
$server->addObjectMap($this, 'http://schemas.xmlsoap.org/soap/envelope/');
$request = 'Not Set';
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
$request = file_get_contents("php://input");
$server->service($request);
} else {
// Create the DISCO server
$disco = new SOAP_DISCO_Server($server, $this->namespace);
header("Content-type: text/xml");
if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'wsdl') == 0) {
echo $disco->getWSDL();
} else {
echo $disco->getDISCO();
}
}
$capture = ob_get_flush();
$this->debug($request, 'request', 5);
$this->debug($capture, 'response', 5);
global $_KT_starttime;
$time = number_format(KTUtil::getBenchmarkTime() - $_KT_starttime, 2);
$this->debug($time, 'time from start', 4);
}
示例8: SendMessage
<?php
require_once 'SOAP/Server.php';
function SendMessage($array)
{
//$result = $str." ".date("Y-m-d");
$params = array('status' => "345", 'errormessage' => "444");
return $params;
}
$server = new SOAP_Server();
$server->addToMap('SendMessage', array(), array());
$server->service($HTTP_RAW_POST_DATA);
?>
示例9: echoStructArray
function echoStructArray($inputStructArray)
{
$ra = array();
if ($inputStructArray) {
$c = count($inputStructArray);
for ($i = 0; $i < $c; $i++) {
$ra[] = $inputStructArray[$i]->__to_soap('item');
}
}
return $ra;
}
}
// http://www.whitemesa.com/r3/interop3.html
// http://www.whitemesa.com/r3/plan.html
$groupd = new SOAP_Interop_GroupDImport3();
$server = new SOAP_Server();
$server->_auto_translation = true;
$server->addObjectMap($groupd, 'http://soapinterop/');
$server->addObjectMap($groupd, 'http://soapinterop.org/xsd');
$server->bind('http://localhost/soap_interop/wsdl/import3.wsdl.php');
if (isset($_SERVER['SERVER_NAME'])) {
$server->service(isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : null);
} else {
// allows command line testing of specific request
$test = '<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope 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:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="http://soapinterop.org/xsd"
示例10: echoEmployee
require_once 'SOAP/Server.php';
require_once 'params_classes.php';
// http://www.whitemesa.com/r3/interop3.html
// http://www.whitemesa.com/r3/plan.html
class SOAP_Interop_GroupDCompound2
{
function echoEmployee(&$employee)
{
return $employee->__to_soap('result_Employee');
}
}
// http://www.whitemesa.com/r3/interop3.html
// http://www.whitemesa.com/r3/plan.html
$options = array('use' => 'literal', 'style' => 'document');
$groupd = new SOAP_Interop_GroupDCompound2();
$server = new SOAP_Server($options);
$server->_auto_translation = true;
$server->addObjectMap($groupd, 'http://soapinterop.org/employee');
$server->bind('http://localhost/soap_interop/wsdl/compound2.wsdl.php');
if (isset($_SERVER['SERVER_NAME'])) {
$server->service(isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : NULL);
} else {
$test = '<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope 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:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns4="http://soapinterop.org/person"
xmlns:ns5="http://soapinterop.org/employee"
>
示例11: validRemoteIP
<?php
require_once '../includes.php';
require_once '../classes/classQuota.php';
$check_remoter = validRemoteIP($_SERVER['REMOTE_ADDR']);
$server = new SOAP_Server();
$server->_auto_translation = true;
$classObj = new CQuota($check_remoter);
$server->addObjectMap($classObj, 'urn:CQuota');
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
$server->service($HTTP_RAW_POST_DATA);
} else {
require_once 'SOAP/Disco.php';
$disco = new SOAP_DISCO_Server($server, "CQuota");
header("Content-type: text/xml");
if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'wsdl') == 0) {
echo $disco->getWSDL();
} else {
echo $disco->getDISCO();
}
exit;
}
示例12: validRemoteIP
<?php
require_once 'includes.php';
require_once "classVCB.php";
$check_remoter = validRemoteIP($_SERVER['REMOTE_ADDR']);
$server = new SOAP_Server();
$server->_auto_translation = true;
$vcb = new CVCB($check_remoter);
$server->addObjectMap($vcb, 'urn:CVCB');
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
$server->service($HTTP_RAW_POST_DATA);
} else {
require_once 'SOAP/Disco.php';
$disco = new SOAP_DISCO_Server($server, "CVCB");
header("Content-type: text/xml");
if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'wsdl') == 0) {
echo $disco->getWSDL();
} else {
echo $disco->getDISCO();
}
exit;
}
示例13: error_reporting
<?
// handles remote queries with soap
/*
*** REQUIREMENTS FOR USING the version of PEAR:SOAP that this code uses: ***
SOAP-0.9.3
HTTP_Request >= 1.3.0
Net_URL >= 1.0.14
*/
if (!defined('DILPS_SOAP_QUERY')) define('DILPS_SOAP_QUERY', 1);
error_reporting(0); // suppress warnings related to unfound (and unnecessary) soap include files
require_once('./config.inc.php');
require_once("{$config['includepath']}dilpsSoapServer.class.php");
require_once('SOAP/Server.php');
// Create the SOAP server
$soapServer = new SOAP_Server();
$dilpsSoap = new DilpsSoapServer(!$config['utf8']);
$soapServer->addObjectMap($dilpsSoap, 'urn:DILPSQuery');
// Service the request
$status = $soapServer->service($GLOBALS['HTTP_RAW_POST_DATA']);
if (is_a($status, 'SOAP_Fault')) {
$fault = $response->getFault();
//mail('brian@mediagonal.ch', 'soapserverFault', var_export($fault));
}
?>
示例14: SOAP_Fault
$errorMsg .= $error->toString() . "\n";
}
return new SOAP_Fault($errorMsg, 'Client');
} else {
$monthname = date('F Y', $Month->getTimeStamp());
$days = array();
$Month->build();
while ($Day =& $Month->fetch()) {
$day = array('isFirst' => (int) $Day->isFirst(), 'isLast' => (int) $Day->isLast(), 'isEmpty' => (int) $Day->isEmpty(), 'day' => (int) $Day->thisDay());
$days[] = $day;
}
return array('monthname' => $monthname, 'days' => $days);
}
}
}
$server = new SOAP_Server();
$server->_auto_translation = true;
$calendar = new Calendar_Server();
$server->addObjectMap($calendar, 'urn:PEAR_SOAP_Calendar');
if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST') {
$server->service($GLOBALS['HTTP_RAW_POST_DATA']);
} else {
require_once 'SOAP' . DIRECTORY_SEPARATOR . 'Disco.php';
$disco = new SOAP_DISCO_Server($server, "PEAR_SOAP_Calendar");
if (isset($_SERVER['QUERY_STRING']) && strcasecmp($_SERVER['QUERY_STRING'], 'wsdl') == 0) {
header("Content-type: text/xml");
echo $disco->getWSDL();
} else {
echo 'This is a PEAR::SOAP Calendar Server. For client try <a href="8.php">here</a><br />';
echo 'For WSDL try <a href="?wsdl">here</a>';
}
示例15: getSOAPServiceNamespace
class ServerHandler_Round2Base implements SOAP_Service
{
public static function getSOAPServiceNamespace()
{
return 'http://soapinterop.org/';
}
public static function getSOAPServiceName()
{
return 'ExampleService';
}
public static function getSOAPServiceDescription()
{
return 'Just a simple example.';
}
public static function getWSDLURI()
{
return 'http://localhost/soap/tests/interop.wsdl';
}
public function echoString($inputString)
{
return array('return' => (string) $inputString);
}
}
$server = new SOAP_Server();
require_once 'ServerHandler_Round2Base.php';
$soapclass = new ServerHandler_Round2Base();
$server->addService($soapclass);
if (isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] == 'POST') {
$server->service('php://input');
}