From a1695680aeb99d8faaf683650dd57836bddfb4c8 Mon Sep 17 00:00:00 2001 From: Teddy Cornaut Date: Fri, 20 Sep 2019 12:10:09 -0400 Subject: [PATCH] Signature de Response iso PROD --- src/BeSimple/SoapServer/SoapServer.php | 38 +++----------------------- 1 file changed, 4 insertions(+), 34 deletions(-) diff --git a/src/BeSimple/SoapServer/SoapServer.php b/src/BeSimple/SoapServer/SoapServer.php index 83c7b24..f12c16d 100644 --- a/src/BeSimple/SoapServer/SoapServer.php +++ b/src/BeSimple/SoapServer/SoapServer.php @@ -100,34 +100,6 @@ class SoapServer extends \SoapServer parent::handle($soapRequest->getContent()); $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 header_remove('Content-Length'); header_remove('Content-Type'); @@ -159,9 +131,7 @@ class SoapServer extends \SoapServer /** * Configure filter and type converter for SwA/MTOM. * - * @param array &$options SOAP constructor options array. - * - * @return void + * @param array &$options SOAP constructor options array */ private function configureMime(array &$options) { @@ -185,11 +155,11 @@ class SoapServer extends \SoapServer } $options['typemap'][] = array( 'type_name' => $converter->getTypeName(), - 'type_ns' => $converter->getTypeNamespace(), - 'from_xml' => function($input) use ($converter) { + 'type_ns' => $converter->getTypeNamespace(), + 'from_xml' => function ($input) use ($converter) { return $converter->convertXmlToPhp($input); }, - 'to_xml' => function($input) use ($converter) { + 'to_xml' => function ($input) use ($converter) { return $converter->convertPhpToXml($input); }, );