1. 安装相关rpm包,如果你足够懒的话,可以直接使用
install-soap.sh
install-soap.sh:
#! /bin/sh
yum install mysql* -y
yum install php-mysql -y
yum install php php-soap php-pear-SOAP -y
pear install -f -o SOAP
2. 建立soap服务端php,并且放到“/var/www/html/servercenter“
soap_all_srv.php:
// PEAR::SOAP einbinden
require_once "SOAP/Server.php";
$skiptrace =& PEAR::getStaticProperty('PEAR_Error', 'skiptrace');
$skiptrace = true;
// Service-Class
class mytimeserv {
// __dispatch_map
public $__dispatch_map = array ();
// In/Out param -> __dispatch_map
public function __construct() {
$this->__dispatch_map["now"] =
array ("in" => array("format" => "string"),
"out" => array("time" => "string"));
}
// get back __dispatch_map in __dispatch
public function __dispatch($methodname) {
if (isset($this->__dispatch_map[$methodname])) {
return $this->__dispatch_map[$methodname];
}
return NULL;
}
// servicemthod with parameters
function now ($format) {
// formaterror?
if (($format == null) || (trim($format) == "")) {
// send errormessage
return new SOAP_Fault("Kein P