From d75d919229f64034487c6114fd84a0eda07963fd Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 22 Mar 2017 15:00:43 +0100 Subject: [PATCH] Fix gestion http et https pour les endpoint dans le WSDL --- application/controllers/ServiceController.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/application/controllers/ServiceController.php b/application/controllers/ServiceController.php index 356ff1dd..42d475ff 100644 --- a/application/controllers/ServiceController.php +++ b/application/controllers/ServiceController.php @@ -102,8 +102,9 @@ class ServiceController extends Zend_Controller_Action require_once $pathServiceClassPhp; // --- Get hostname - add compatibility with Reverse Proxy - $hostName = $this->getRequest()->getHttpHost(); - $fichierWsdl = $hostName . '-' . $fichierWsdl; + $hostName = $request->getHttpHost(); + $hostScheme = $request->getScheme(); + $fichierWsdl = $hostScheme . '-' . $hostName . '-' . $fichierWsdl; $c = Zend_registry::get('config'); $wsdlPath = $c->profil->path->shared . '/wsdl'; @@ -118,6 +119,7 @@ class ServiceController extends Zend_Controller_Action || isset($_GET['wsdl-auto'])) { // --- Définition du webservice $wsdl = new Zend_Soap_AutoDiscover(); + $wsdl->setUri($hostScheme . '://' . $hostName); $wsdl->setComplexTypeStrategy('Zend_Soap_Wsdl_Strategy_ArrayOfTypeSequence'); $wsdl->setOperationBodyStyle(array('use' => 'literal')); $wsdl->setBindingStyle(array('style' => 'document')); @@ -151,7 +153,7 @@ class ServiceController extends Zend_Controller_Action && file_exists($wsdlPath . '/' . $fichierWsdl)) { $server = new Zend_Soap_Server($wsdlPath . '/' . $fichierWsdl); } else { - $server = new Zend_Soap_Server('http://'.$hostName.'/'.$pathServiceUrl); + $server = new Zend_Soap_Server($hostScheme.'://'.$hostName.'/'.$pathServiceUrl); } // --- Sonde paramètres server