Index: AutoDiscover.php
===================================================================
--- AutoDiscover.php	(revision 11128)
+++ AutoDiscover.php	(working copy)
@@ -65,6 +65,42 @@
     }
     
     /**
+     * Set the Uri
+     *
+     * @param string|Zend_Uri $uri
+     * @return Zend_Soap_AutoDiscover
+     */
+    public function setUri($uri)
+    {
+        if (is_string($uri))
+            $uri = Zend_Uri::factory($uri);
+
+        $this->_uri = $uri;
+
+        return $this;
+    }
+
+    /**
+     * Get the Uri
+     *
+     * @return Zend_Uri
+     */
+    public function getUri()
+    {
+        if (!$this->_uri instanceof Zend_Uri) {
+            
+            if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
+                $schema = 'https';
+            } else {
+                $schema = 'http';
+            }
+            $this->setUri(Zend_Uri::factory($schema . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']));
+        }
+        
+        return $this->_uri;
+    }
+        
+    /**
      * Set the Class the SOAP server will use
      *
      * @param string $class Class Name
@@ -73,7 +109,7 @@
      */
     public function setClass($class, $namespace = '', $argv = null)
     {
-        $uri = Zend_Uri::factory('http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']);
+        $uri = $this->getUri();
 
         $wsdl = new Zend_Soap_Wsdl($class, $uri, $this->_extractComplexTypes);
         

