1
|
|
|
<?php |
2
|
|
|
ar_pinp::allow( 'ar_connect_soap' ); |
3
|
|
|
ar_pinp::allow( 'ar_connect_soapClient' ); |
4
|
|
|
ar_pinp::allow( 'ar_connect_soapServer' ); |
5
|
|
|
ar_pinp::allow( 'ar_connect_soapHeader' ); |
6
|
|
|
ar_pinp::allow( 'ar_connect_soapParam' ); |
7
|
|
|
ar_pinp::allow( 'ar_connect_soapVar' ); |
8
|
|
|
|
9
|
|
|
class ar_connect_soap extends arBase { |
10
|
|
|
|
11
|
|
|
public static function client( $wsdl, $options = array() ) { |
12
|
|
|
return new ar_connect_soapClient( $wsdl, $options ); |
13
|
|
|
} |
14
|
|
|
|
15
|
|
|
public static function server( $wsdl, $options = array() ) { |
16
|
|
|
return new ar_connect_soapServer( $wsdl, $options ); |
17
|
|
|
} |
18
|
|
|
|
19
|
|
View Code Duplication |
public static function header( $namespace, $name, $data = null, $mustUnderstand = false, $actor = null ) { |
20
|
|
|
if (isset($actor)) { |
21
|
|
|
$soapHeader = new SoapHeader( $namespace, $name, $data, $mustUnderstand, $actor); |
22
|
|
|
} else { |
23
|
|
|
$soapHeader = new SoapHeader( $namespace, $name, $data, $mustUnderstand); |
24
|
|
|
} |
25
|
|
|
return $soapHeader; |
26
|
|
|
} |
27
|
|
|
|
28
|
|
|
public static function param( $data, $name ) { |
29
|
|
|
return new SoapParam( $data, $name ); |
30
|
|
|
} |
31
|
|
|
|
32
|
|
|
public static function variable( $data, $encoding, $type_name = '', $type_namespace = '', $node_name = '', $node_namespace = '') { |
33
|
|
|
return new SoapVar( $data, $encoding, $type_name, $type_namespace, $node_name, $node_namespace ); |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
} |
37
|
|
|
|
38
|
|
|
|
39
|
|
|
class ar_connect_soapClient extends arWrapper { |
40
|
|
|
|
41
|
|
|
public function __construct( $wsdl, $options = array() ) { |
42
|
|
|
$soapClient = new SoapClient( $wsdl, $options ); |
43
|
|
|
parent::__construct( $soapClient ); |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
public function _soapCall( $name, $arguments, $options = array(), $inputHeaders = array(), &$outputHeaders = array() ) { |
47
|
|
|
try { |
48
|
|
|
$result = $this->wrapped->__soapCall( $name, $arguments, $options, $inputHeaders, $outputHeaders ); |
49
|
|
|
} catch( Exception $e ) { |
50
|
|
|
$result = ar::error( $e->getMessage(), $e->getCode() ); |
51
|
|
|
} |
52
|
|
|
return $result; |
53
|
|
|
} |
54
|
|
|
|
55
|
|
|
public function _setSoapHeaders($soapHeaders = null) { |
56
|
|
|
$this->wrapped->__setSoapHeaders($soapHeaders); |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
public function _setLocation($location) { |
60
|
|
|
$this->wrapped->__setLocation($location); |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
public function _getFunctions() { |
64
|
|
|
return $this->wrapped->__getFunctions(); |
65
|
|
|
} |
66
|
|
|
|
67
|
|
|
public function _getTypes() { |
68
|
|
|
return $this->wrapped->__getTypes(); |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
public function _getLastResponse() { |
72
|
|
|
return $this->wrapped->__getLastResponse(); |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
public function _getLastResponseHeaders() { |
76
|
|
|
return $this->wrapped->__getLastResponseHeaders(); |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
public function _getLastRequest() { |
80
|
|
|
return $this->wrapped->__getLastRequest(); |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
public function _getLastRequestHeaders() { |
84
|
|
|
return $this->wrapped->__getLastRequestHeaders(); |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
public function _setCookie( $name, $value = null ) { |
88
|
|
|
return $this->wrapped->__setCookie( $name, $value ); |
89
|
|
|
} |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
class ar_connect_soapServer extends arWrapper { |
93
|
|
|
|
94
|
|
|
public function __construct( $wsdl, $options = array() ) { |
95
|
|
|
$soapServer = new SoapServer( $wsdl, $options ); |
96
|
|
|
parent::__construct( $soapServer ); |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
} |
100
|
|
|
|
101
|
|
|
class ar_connect_soapHeader extends arWrapper { |
102
|
|
|
|
103
|
|
View Code Duplication |
public function __construct( $namespace, $name, $data = null, $mustUnderstand = false, $actor = null ) { |
104
|
|
|
if (isset($actor)) { |
105
|
|
|
$soapHeader = new SoapHeader( $namespace, $name, $data, $mustUnderstand, $actor); |
106
|
|
|
} else { |
107
|
|
|
$soapHeader = new SoapHeader( $namespace, $name, $data, $mustUnderstand); |
108
|
|
|
} |
109
|
|
|
parent::__construct( $soapHeader ); |
110
|
|
|
} |
111
|
|
|
|
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
class ar_connect_soapParam extends arWrapper { |
115
|
|
|
|
116
|
|
|
public function __construct( $data, $name ) { |
117
|
|
|
return new SoapParam( $data, $name ); |
|
|
|
|
118
|
|
|
|
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
class ar_connect_soapVar extends arWrapper { |
124
|
|
|
|
125
|
|
|
public function __construct( $data, $encoding, $type_name = '', $type_namespace = '', $node_name = '', $node_namespace = '' ) { |
126
|
|
|
$soapVar = new SoapVar( $data, $encoding, $type_name, $type_namespace, $node_name, $node_namespace ); |
127
|
|
|
parent::__construct( $soapVar ); |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
} |
131
|
|
|
|