16 public function __construct(&$service)
18 $this->_mService =& $service;
19 $this->_mServer =
new ShadeSoap_NusoapServer();
21 $this->_mServer->configureWSDL($this->_mService->mServiceName, $this->_mService->mNameSpace);
22 $this->_mServer->wsdl->schemaTargetNamespace = $this->_mService->mNameSpace;
25 public function prepare()
28 $this->_parseFunction();
31 public function _parseType()
36 foreach ($this->_mService->_mTypes as $className) {
37 if (XC_CLASS_EXISTS($className)) {
38 if (
true == call_user_func([$className,
'isArray'])) {
39 $targetClassName = call_user_func([$className,
'getClassName']);
41 if (XCube_ServiceUtils::isXSD($targetClassName)) {
42 $targetClassName =
'xsd:' . $targetClassName;
44 $targetClassName =
'tns:' . $targetClassName;
47 $this->_mServer->wsdl->addComplexType(
55 [
'ref' =>
'SOAP-ENC:arrayType',
'wsdl:arrayType' => $targetClassName .
'[]']
60 $t_fieldArr = call_user_func([$className,
'getPropertyDefinition']);
62 foreach ($t_fieldArr as $t_field) {
63 $name = $t_field[
'name'];
64 $type = $t_field[
'type'];
66 if (XCube_ServiceUtils::isXSD($t_field[
'type'])) {
67 $type =
'xsd:' . $type;
69 $type =
'tns:' . $type;
72 $t_arr[$name] = [
'name' => $name,
'type' => $type];
75 $this->_mServer->wsdl->addComplexType(
88 public function _parseFunction()
93 foreach ($this->_mService->_mFunctions as $func) {
94 if (XCube_ServiceUtils::isXSD($func[
'out'])) {
95 $t_out =
'xsd:' . $func[
'out'];
97 $t_out =
'tns:' . $func[
'out'];
100 $out[
'return'] = $t_out;
106 foreach ($func[
'in'] as $name => $type) {
107 if (XCube_ServiceUtils::isXSD($type)) {
108 $t_type =
'xsd:' . $type;
110 $t_type =
'tns:' . $type;
112 $in[$name] = $t_type;
115 $this->_mServer->register($this->_mService->mClassName .
'.' . $func[
'name'], $in, $out, $this->_mService->mNameSpace);
119 public function executeService()
121 $postdata = file_get_contents(
'php://input');
123 $this->_mServer->service($postdata);