1
|
|
|
<?php |
2
|
|
|
/****************************************************************** |
3
|
|
|
mod_soap.php Muze Ariadne |
4
|
|
|
------------------------------------------------------------------ |
5
|
|
|
Author: Muze ([email protected]) |
6
|
|
|
Date: 25 november 2004 |
7
|
|
|
|
8
|
|
|
Copyright 2004 Muze |
9
|
|
|
|
10
|
|
|
This file is part of Ariadne. |
11
|
|
|
|
12
|
|
|
Ariadne is free software; you can redistribute it and/or modify |
13
|
|
|
it under the terms of the GNU General Public License as published |
14
|
|
|
by the Free Software Foundation; either version 2 of the License, |
15
|
|
|
or (at your option) any later version. |
16
|
|
|
|
17
|
|
|
Ariadne is distributed in the hope that it will be useful, |
18
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
19
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20
|
|
|
GNU General Public License for more details. |
21
|
|
|
|
22
|
|
|
You should have received a copy of the GNU General Public License |
23
|
|
|
along with Ariadne; if not, write to the Free Software |
24
|
|
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
25
|
|
|
02111-1307 USA |
26
|
|
|
|
27
|
|
|
------------------------------------------------------------------- |
28
|
|
|
|
29
|
|
|
Description: |
30
|
|
|
|
31
|
|
|
PINP wrapper to the pear SOAP library. |
32
|
|
|
|
33
|
|
|
******************************************************************/ |
34
|
|
|
|
35
|
|
|
require_once("SOAP/Client.php"); |
36
|
|
|
require_once("SOAP/Parser.php"); |
37
|
|
|
|
38
|
|
|
class pinp_SOAP { |
39
|
|
|
|
40
|
|
|
public static function _Client($endpoint, $wsdl = false , $portName = false, $proxy_params=array() ) { |
41
|
|
|
return new pinp_SOAP_Client( $endpoint, $wsdl, $portName, $proxy_params); |
42
|
|
|
} |
43
|
|
|
|
44
|
|
|
public static function _Parser($xml, $encoding = SOAP_DEFAULT_ENCODING, $attachments=null) { |
45
|
|
|
return new pinp_SOAP_Parser( $xml, $encoding, $attachments ); |
46
|
|
|
} |
47
|
|
|
|
48
|
|
|
|
49
|
|
|
public static function _Value($name, $type, $value, $namespaces=false) { |
50
|
|
|
if( $namespaces===false ) { |
51
|
|
|
return new SOAP_Value( $name, $type, $value); |
52
|
|
|
} else { |
53
|
|
|
return new SOAP_Value( $name, $type, $value, $namespaces ); |
54
|
|
|
} |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
public static function _Header($name, $type, $value=null, $mustunderstand=0, $actor = 'http://schemas.xmlsoap.org/soap/actor/next') { |
58
|
|
|
return new SOAP_Header( $name, $type, $value, $mustunderstand, $actor ); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
class pinp_SOAP_Parser extends SOAP_Parser { |
64
|
|
|
|
65
|
|
|
public function __construct( $xml, $encoding = SOAP_DEFAULT_ENCODING, $attachments=null ) { |
66
|
|
|
parent::SOAP_Parser( $xml, $encoding, $attachments ); |
|
|
|
|
67
|
|
|
} |
68
|
|
|
|
69
|
|
|
public function _getResponse() { |
70
|
|
|
return $this->getResponse(); |
|
|
|
|
71
|
|
|
} |
72
|
|
|
|
73
|
|
|
public function _parseMessage($nr=0) { |
74
|
|
|
$msg = &$this->message; |
|
|
|
|
75
|
|
|
switch(strtolower($msg[$nr]["type"])) { |
76
|
|
|
case 'struct': |
77
|
|
|
$result = array(); |
78
|
|
|
$children = explode("|", $msg[$nr]["children"]); |
79
|
|
|
$to_array = array(); |
80
|
|
|
foreach($children as $child) { |
81
|
|
|
$key = $msg[$child]["name"]; |
82
|
|
|
$value = $this->_parseMessage($child); |
83
|
|
|
if ($result[$key]) { |
84
|
|
|
if (!$to_array[$key]) { |
85
|
|
|
$temp = $result[$key]; |
86
|
|
|
$result[$key] = array(); |
87
|
|
|
$result[$key][] = $temp; |
88
|
|
|
$to_array[$key] = true; |
89
|
|
|
} |
90
|
|
|
$result[$key][] = $value; |
91
|
|
|
} else { |
92
|
|
|
$result[$key] = $value; |
93
|
|
|
} |
94
|
|
|
} |
95
|
|
|
break; |
96
|
|
|
case 'string': |
97
|
|
|
default: |
98
|
|
|
$result = $msg[$nr]["cdata"]; |
99
|
|
|
break; |
100
|
|
|
} |
101
|
|
|
return $result; |
102
|
|
|
} |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
|
106
|
|
|
class pinp_SOAP_Client extends SOAP_Client { |
107
|
|
|
|
108
|
|
|
public function __construct($endpoint, $wsdl = false, $portName = false, $proxy_params=array()) { |
109
|
|
|
parent::SOAP_Client( $endpoint, $wsdl, $portName, $proxy_params ); |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
public function _call( $function, $arguments=false, $namespace=false, $soapAction=false ) { |
113
|
|
|
return $this->call( $function, $arguments, $namespace, $soapAction ); |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
public function _addHeader($soap_value) { |
117
|
|
|
return $this->addHeader($soap_value); |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
public function _isError($value) { |
121
|
|
|
return $this->isError($value); |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
public function _isWarning($value) { |
125
|
|
|
return $this->isWarning($value); |
126
|
|
|
} |
127
|
|
|
|
128
|
|
|
public function _errorMessage($error) { |
129
|
|
|
if (is_object($error) && get_class($error) == "soap_fault") { |
130
|
|
|
$result = $error->message; |
|
|
|
|
131
|
|
|
} else { |
132
|
|
|
$result = false; |
133
|
|
|
} |
134
|
|
|
return $result; |
135
|
|
|
} |
136
|
|
|
|
137
|
|
|
} |
138
|
|
|
|
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.