ZF-4835: Zend_Soap_Autodiscover should use REQUEST_URI instead of SCRIPT_NAME


Zend_Soap_Autodiscover tries to automatically discover the correct script URI. While when configuring rewrite-rules in your Apache config there is no difference between REQUEST_URI and SCRIPT_NAME in PHP, this changes when you are going to use .htaccess files. Here a short overview of related $_SERVER variables in different environments when rewrite is in use (in this example /index/test -> /index.php):

Rewrite rules in Apache conf:

[REQUEST_URI] => /index/test
[SCRIPT_NAME] => /index/test
[PHP_SELF] => /index/test

Rewrite rules in .htaccess file:

[REQUEST_URI] => /index/test
[SCRIPT_NAME] => /index.php
[PHP_SELF] => /index.php/test

In my opinion the only correct URI for Autodiscover is REQUEST_URI.

Best regards, Thomas Gelf


Attaching patch changing SCRIPT_NAME to REQUEST_URI

AutoDiscover now uses REQUEST_URI without the parameters after the ?. This way you can still provide the WSDL via Autodiscovering on script.php?wsdl and the uri is autodiscovered to be script.php (where the SOAP Server resides).

Additionally to this behaviour AutoDiscover did not detect automatically the path for non apache webservers. This was fixed too.

Changing issues in preparation for the 1.7.0 release.