<commit_before><?php

require_once ('ELSTR_WidgetServer_Abstract.php');
require_once ('ELSTR_SoapServer.php');

/**
 * This is an abstract SOAP WidgetServer implementation
 *
 * @author <NAME>, <NAME>
 * @version 1.0
 * @created 11-May-2012 10:41:59
 */
abstract class ELSTR_WidgetServer_SOAP_Abstract extends ELSTR_WidgetServer_Abstract {

    protected $m_server;
    protected $m_response;
    protected $m_isWsdlRequest = false;

    function __construct($application, $params = null) {
        parent::__construct($application, $params);

        //echo $params;
        
        if (isset($_GET['wsdl'])) {
            $this->m_isWsdlRequest = true;
            $this->m_server = new Zend_Soap_AutoDiscover();
            $this->m_server->setClass(get_class($this));
        } else {
            //TODO: Add possibilities of $options loaded from configurations file
            $options = null;
            $this->m_server = new ELSTR_SoapServer($_SERVER['SCRIPT_URI']."?wsdl",$options);
            $this->m_server->setClass(get_class($this));
            $this->m_server->setObject($this);
        }
    }

    /**
     * Implementation of the abstract _getMethod
     */
    protected function _getMethod() {
        //TODO: Return requested method for ACL
    }

    /**
     * Create a SOAP Server and handle itself
     *
     * @return void
     */
    protected function _handle() {        
        $this->m_response = $this->m_server->handle($this->m_params);
        return $this->m_response;
    }

    /**
     * Get response object
     */
    protected function _getResponse() {
        //The method "$this->m_server->getResponse()" does not exist
        return $this->m_response;
    }<commit_msg>Adding possibility for HTTPS requests Adding possibility for complex request and response types<commit_after><?php

require_once ('ELSTR_WidgetServer_Abstract.php');
require_once ('ELSTR_SoapServer.php');

/**
 * This is an abstract SOAP WidgetServer implementation
 *
 * @author <NAME>, <NAME>
 * @version 1.0
 * @created 11-May-2012 10:41:59
 */
abstract class ELSTR_WidgetServer_SOAP_Abstract extends ELSTR_WidgetServer_Abstract {

    protected $m_server;
    protected $m_response;
    protected $m_isWsdlRequest = false;
    protected $m_soapOptions;

    function __construct($application, $params = null) {
        parent::__construct($application, $params);
        // set options
        $soapOptions = $application->getOption('ELSTR_WidgetServer_SOAP');
        if (isset($soapOptions)) {
            $this->m_soapOptions = $soapOptions;
        }        
        
        if (isset($_GET['wsdl'])) {
            $this->m_isWsdlRequest = true;
            if(isset($this->m_soapOptions['Zend_Soap_AutoDiscover_Strategy'])){
                // Example: ELSTR_WidgetServer_SOAP.Zend_Soap_AutoDiscover_Strategy = Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex
                $this->m_server = new Zend_Soap_AutoDiscover($this->m_soapOptions['Zend_Soap_AutoDiscover_Strategy']);
            } else {
                $this->m_server = new Zend_Soap_AutoDiscover();
            }
            $this->m_server->setClass(get_class($this));
        } else {
            //TODO: Add possibilities of $options loaded from configurations file
            $options = null;

            $protocol = "http://";
            if (isset($_SERVER["HTTPS"]) == true && $_SERVER["HTTPS"] == "on") {
                $protocol = "https://";
            }
            $this->m_server = new ELSTR_SoapServer($protocol.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT']."/".$_SERVER['REQUEST_URI']."?wsdl",$options);
            $this->m_server->setClass(get_class($this));
            $this->m_server->setObject($this);
        }
    }

    /**
     * Implementation of the abstract _getMethod
     */
    protected function _getMethod() {
        //TODO: Return requested method for ACL
    }

    /**
     * Create a SOAP Server and handle itself
     *
     * @return void
     */
    protected function _handle() {        
        $this->m_response = $this->m_server->handle($this->m_params);
        return $this->m_response;
    }

    /**
     * Get response object
     */
    protected function _getResponse() {
        //The method "$this->m_server->getResponse()" does not exist
        return $this->m_response;
    }
{'fraction_non_alphanumeric': 0.12863741339491916, 'fraction_numerical': 0.006466512702078522, 'mean_word_length': 2.544189852700491, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 46, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '246768', 'n_tokens_mistral': 1302, 'n_tokens_neox': 1245, 'n_words': 255}