Signature de Response iso PROD
This commit is contained in:
parent
95706abbd7
commit
a1695680ae
|
@ -100,34 +100,6 @@ class SoapServer extends \SoapServer
|
||||||
parent::handle($soapRequest->getContent());
|
parent::handle($soapRequest->getContent());
|
||||||
$response = ob_get_clean();
|
$response = ob_get_clean();
|
||||||
|
|
||||||
$dom = \DOMDocument::loadXML($response);
|
|
||||||
|
|
||||||
/** @var \DOMElement $envelop */
|
|
||||||
$envelop = $dom->childNodes->item(0);
|
|
||||||
$ns1 = $envelop->getAttribute('xmlns:ns1');
|
|
||||||
$envelop->removeAttributeNS($ns1, 'ns1');
|
|
||||||
$envelop->prefix = 'soap';
|
|
||||||
|
|
||||||
$envelop->setAttribute('soap:encodingStyle', 'http://schemas.xmlsoap.org/soap/encoding/');
|
|
||||||
$envelop->setAttribute('xmlns:soapenc', 'http://schemas.xmlsoap.org/soap/encoding/');
|
|
||||||
$envelop->setAttribute('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');
|
|
||||||
$envelop->setAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
|
|
||||||
|
|
||||||
/** @var \DOMElement $body */
|
|
||||||
$body = $envelop->childNodes->item(0);
|
|
||||||
$body->prefix = 'soap';
|
|
||||||
|
|
||||||
/** @var \DOMElement $responseRoot */
|
|
||||||
$responseRoot = $body->childNodes->item(0);
|
|
||||||
$responseRoot->setAttribute('xmlns', $ns1);
|
|
||||||
|
|
||||||
$envelop->removeAttributeNS('http://schemas.xmlsoap.org/soap/envelope/', 'SOAP-ENV');
|
|
||||||
$envelop->removeAttributeNS('http://schemas.xmlsoap.org/soap/encoding/', 'SOAP-ENC');
|
|
||||||
|
|
||||||
$response = $dom->saveXML();
|
|
||||||
|
|
||||||
$response = preg_replace('/xsi:type="ns1:\w*"/', '', $response);
|
|
||||||
|
|
||||||
// Remove headers added by SoapServer::handle() method
|
// Remove headers added by SoapServer::handle() method
|
||||||
header_remove('Content-Length');
|
header_remove('Content-Length');
|
||||||
header_remove('Content-Type');
|
header_remove('Content-Type');
|
||||||
|
@ -159,9 +131,7 @@ class SoapServer extends \SoapServer
|
||||||
/**
|
/**
|
||||||
* Configure filter and type converter for SwA/MTOM.
|
* Configure filter and type converter for SwA/MTOM.
|
||||||
*
|
*
|
||||||
* @param array &$options SOAP constructor options array.
|
* @param array &$options SOAP constructor options array
|
||||||
*
|
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
private function configureMime(array &$options)
|
private function configureMime(array &$options)
|
||||||
{
|
{
|
||||||
|
@ -185,11 +155,11 @@ class SoapServer extends \SoapServer
|
||||||
}
|
}
|
||||||
$options['typemap'][] = array(
|
$options['typemap'][] = array(
|
||||||
'type_name' => $converter->getTypeName(),
|
'type_name' => $converter->getTypeName(),
|
||||||
'type_ns' => $converter->getTypeNamespace(),
|
'type_ns' => $converter->getTypeNamespace(),
|
||||||
'from_xml' => function($input) use ($converter) {
|
'from_xml' => function ($input) use ($converter) {
|
||||||
return $converter->convertXmlToPhp($input);
|
return $converter->convertXmlToPhp($input);
|
||||||
},
|
},
|
||||||
'to_xml' => function($input) use ($converter) {
|
'to_xml' => function ($input) use ($converter) {
|
||||||
return $converter->convertPhpToXml($input);
|
return $converter->convertPhpToXml($input);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in New Issue