SoapFaultWithTracingData now provides request / response information from Server SoapFaults
This commit is contained in:
@ -316,26 +316,31 @@ class SoapClient extends \SoapClient
|
||||
{
|
||||
$soapResponse = $this->getSoapResponseFromStorage();
|
||||
if ($soapResponse instanceof SoapResponse) {
|
||||
$tracingData = new SoapResponseTracingData(
|
||||
'Content-Type: ' . $soapResponse->getRequest()->getContentType(),
|
||||
$soapResponse->getRequest()->getContent(),
|
||||
'Content-Type: ' . $soapResponse->getContentType(),
|
||||
$soapResponse->getResponseContent()
|
||||
);
|
||||
$soapFault = $this->throwSoapFaultByTracing(
|
||||
SoapFaultPrefixEnum::PREFIX_PHP . '-' . $nativePhpSoapFault->getCode(),
|
||||
$nativePhpSoapFault->getMessage(),
|
||||
$tracingData
|
||||
$this->getSoapResponseTracingDataFromNativeSoapFault(
|
||||
$nativePhpSoapFault,
|
||||
new SoapResponseTracingData(
|
||||
'Content-Type: '.$soapResponse->getRequest()->getContentType(),
|
||||
$soapResponse->getRequest()->getContent(),
|
||||
'Content-Type: '.$soapResponse->getContentType(),
|
||||
$soapResponse->getResponseContent()
|
||||
)
|
||||
)
|
||||
);
|
||||
} else {
|
||||
$soapFault = $this->throwSoapFaultByTracing(
|
||||
$nativePhpSoapFault->faultcode,
|
||||
$nativePhpSoapFault->getMessage(),
|
||||
new SoapResponseTracingData(
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
$this->getSoapResponseTracingDataFromNativeSoapFault(
|
||||
$nativePhpSoapFault,
|
||||
new SoapResponseTracingData(
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
null
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -343,6 +348,18 @@ class SoapClient extends \SoapClient
|
||||
return $soapFault;
|
||||
}
|
||||
|
||||
private function getSoapResponseTracingDataFromNativeSoapFault(
|
||||
SoapFault $nativePhpSoapFault,
|
||||
SoapResponseTracingData $defaultSoapFaultTracingData
|
||||
) {
|
||||
if ($nativePhpSoapFault instanceof SoapFaultWithTracingData) {
|
||||
|
||||
return $nativePhpSoapFault->getSoapResponseTracingData();
|
||||
}
|
||||
|
||||
return $defaultSoapFaultTracingData;
|
||||
}
|
||||
|
||||
private function getHttpHeadersBySoapVersion(SoapRequest $soapRequest)
|
||||
{
|
||||
if ($soapRequest->getVersion() === SOAP_1_1) {
|
||||
|
Reference in New Issue
Block a user