1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace WebservicesNl\Protocol\Soap\Exception; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Abstract Class SoapFault. |
7
|
|
|
* |
8
|
|
|
* Extends SoapFault into a Webservices SoapFault (just for getters and setters) |
9
|
|
|
* |
10
|
|
|
* @link http://php.net/manual/en/soapfault.soapfault.php |
11
|
|
|
*/ |
12
|
|
|
class SoapFault extends \SoapFault |
13
|
|
|
{ |
14
|
|
|
protected $faultCodes = [ |
15
|
|
|
SOAP_1_1 => ['Server', 'Client', 'VersionMismatch', 'MustUnderstand'], |
16
|
|
|
SOAP_1_2 => ['Sender', 'Receiver', 'VersionMismatch', 'MustUnderstand', 'DataEncodingUnknown'], |
17
|
|
|
]; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* More details about the cause of the error. |
21
|
|
|
* |
22
|
|
|
* Required if the fault is an error related to the SOAPBody object. If, for example, the fault code is Client, |
23
|
|
|
* indicating that the message could not be processed because of a problem in the SOAPBody object, |
24
|
|
|
* the SOAPFault object must contain a Detail object that gives details about the problem. |
25
|
|
|
* If a SOAPFault object does not contain a Detail object, it can be assumed that the SOAPBody object was processed |
26
|
|
|
* successfully. |
27
|
|
|
* |
28
|
|
|
* @var string |
29
|
|
|
*/ |
30
|
|
|
public $detail; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* A string identifying the actor that caused the error. |
34
|
|
|
* |
35
|
|
|
* Required if the SOAPHeader object contains one or more actor attributes; optional if no actors are specified. |
36
|
|
|
* Meaning that the only actor is the ultimate destination. The fault actor, which is specified as a URI, identifies |
37
|
|
|
* who caused the fault. |
38
|
|
|
* |
39
|
|
|
* @var string |
40
|
|
|
*/ |
41
|
|
|
public $faultActor; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* The Soap Fault code (either Sender or Receiver). |
45
|
|
|
* |
46
|
|
|
* @link https://www.w3.org/TR/soap12-part1/#faultcodes |
47
|
|
|
* |
48
|
|
|
* @var string |
49
|
|
|
*/ |
50
|
|
|
public $faultCode; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* Can be used to select the proper fault encoding from WSDL. |
54
|
|
|
* |
55
|
|
|
* @var string |
56
|
|
|
*/ |
57
|
|
|
public $faultName; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* The error message of the SoapFault. |
61
|
|
|
* Always required. A human-readable explanation of the fault. |
62
|
|
|
* |
63
|
|
|
* @var string |
64
|
|
|
*/ |
65
|
|
|
public $faultString = 'Something went wrong'; |
66
|
|
|
|
67
|
|
|
/** |
68
|
|
|
* Can be used during SOAP header handling to report an error in the response header. |
69
|
|
|
* |
70
|
|
|
* @var string |
71
|
|
|
*/ |
72
|
|
|
public $headerFault; |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @return string |
76
|
|
|
*/ |
77
|
|
|
public function getFaultCode() |
78
|
|
|
{ |
79
|
|
|
return $this->faultCode; |
80
|
|
|
} |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @return string |
84
|
|
|
*/ |
85
|
|
|
public function getFaultActor() |
86
|
|
|
{ |
87
|
|
|
return $this->faultActor; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @return string |
92
|
|
|
*/ |
93
|
|
|
public function getDetail() |
94
|
|
|
{ |
95
|
|
|
return $this->detail; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @return string |
100
|
|
|
*/ |
101
|
|
|
public function getFaultName() |
102
|
|
|
{ |
103
|
|
|
return $this->faultName; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @return string |
108
|
|
|
*/ |
109
|
|
|
public function getHeaderFault() |
110
|
|
|
{ |
111
|
|
|
return $this->headerFault; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* @return string |
116
|
|
|
*/ |
117
|
|
|
public function getFaultString() |
118
|
|
|
{ |
119
|
|
|
return $this->faultString; |
120
|
|
|
} |
121
|
|
|
} |
122
|
|
|
|