public function ExecuteProgram($inputXml, $disconnect = false)
    {
        $this->execStartTime = '';
        $this->error = '';

        $this->VerifyPLUGName(); // calculates value of option 'plug'
        $this->VerifyInternalKey();

        // @todo create driver-specific SQL in driver classes (db2, odbc)
        $internalKey = $this->getInternalKey();
        $controlKeyString = $this->getControlKey($disconnect);

        $plugSize = $this->getOption('plugSize');

        // @todo have one transport class that includes db as well.

        // If a database transport
        if (isset($this->db) && $this->db) {
            $result = $this->makeDbCall($internalKey, $plugSize, $controlKeyString, $inputXml, $disconnect);
        } else {
            // Not a DB transport. At this time, assume HTTP transport (which doesn't use a plug, by the way. uses outbytesize)
            $transport = $this->getTransport();
            $transport->setIpc($internalKey);
            $transport->setCtl($controlKeyString);
            $url = $this->getOption('httpTransportUrl');
            $transport->setUrl($url);

            // convert plugSize to bytes
            $outByteSize = $this->plugSizeToBytes($plugSize);

            // if debug mode, log control key, and input XML.
            if ($this->isDebug()) {
                $this->debugLog("\nExec start: " . date("Y-m-d H:i:s") . "\nVersion of toolkit front end: " . self::getFrontEndVersion() ."\nToolkit class: '" . __FILE__ . "'\nIPC: '" . $this->getInternalKey() . "'. Control key: $controlKeyString\nHost URL: $url\nExpected output size (plugSize): $plugSize or $outByteSize bytes\nInput XML: $inputXml\n");
                $this->execStartTime = microtime(true);
            }

            $result = $transport->send($inputXml, $outByteSize);

            // workaround: XMLSERVICE as of 1.7.4 returns a single space instead of empty string when no content was requested.
            if ($result == ' ') {
                $result = '';
            }
        }

        if ($this->isDebug() && $result) {
            $end = microtime(true);
            $elapsed = $end - $this->execStartTime;
            $this->debugLog("Output XML: $result\nExec end: " . date("Y-m-d H:i:s") . ". Seconds to execute: $elapsed.\n\n");
        }

        return $result;
    }
public function ExecuteProgram($inputXml, $disconnect = false)
    {
        $this->execStartTime = '';
        $this->error = '';

        $this->VerifyPLUGName(); // calculates value of option 'plug'
        $this->VerifyInternalKey();

        // @todo create driver-specific SQL in driver classes (db2, odbc)
        $internalKey = $this->getInternalKey();
        $controlKeyString = $this->getControlKey($disconnect);

        $plugSize = $this->getOption('plugSize');

        // @todo have one transport class that includes db as well.

        // If a database transport
        if (isset($this->db) && $this->db) {
            $result = $this->makeDbCall($internalKey, $plugSize, $controlKeyString, $inputXml, $disconnect);
        } else {
            // Not a DB transport. At this time, assume HTTP transport (which doesn't use a plug, by the way. uses outbytesize)
            $transport = $this->getTransport();
            $transport->setIpc($internalKey);
            $transport->setCtl($controlKeyString);
            $url = $this->getOption('httpTransportUrl');
            $transport->setUrl($url);

            // convert plugSize to bytes
            $outByteSize = $this->plugSizeToBytes($plugSize);

            // if debug mode, log control key, and input XML.
            if ($this->isDebug()) {
                $this->debugLog("\nExec start: " . date("Y-m-d H:i:s") . "\nVersion of toolkit front end: " . self::getFrontEndVersion() ."\nToolkit class: '" . __FILE__ . "'\nIPC: '" . $this->getInternalKey() . "'. Control key: $controlKeyString\nHost URL: $url\nExpected output size (plugSize): $plugSize or $outByteSize bytes\nInput XML: $inputXml\n");
                $this->execStartTime = microtime(true);
            }

            $result = $transport->send($inputXml, $outByteSize);

            // workaround: XMLSERVICE as of 1.7.4 returns a single space instead of empty string when no content was requested.
            if ($result == ' ') {
                $result = '';
            }
        }

        if ($this->isDebug() && $result) {
            $end = microtime(true);
            $elapsed = $end - $this->execStartTime;
            $this->debugLog("Output XML: $result\nExec end: " . date("Y-m-d H:i:s") . ". Seconds to execute: $elapsed.\n\n");
        }

        return $result;
    }
public function ExecuteProgram ( $ inputXml , $ disconnect = false ) { $ this -> execStartTime = '' ; $ this -> error = '' ; $ this -> VerifyPLUGName ( ) ; // calculates value of option 'plug' $ this -> VerifyInternalKey ( ) ; // @todo create driver-specific SQL in driver classes (db2, odbc) $ internalKey = $ this -> getInternalKey ( ) ; $ controlKeyString = $ this -> getControlKey ( $ disconnect ) ; $ plugSize = $ this -> getOption ( 'plugSize' ) ; // @todo have one transport class that includes db as well. // If a database transport if ( isset ( $ this -> db ) && $ this -> db ) { $ result = $ this -> makeDbCall ( $ internalKey , $ plugSize , $ controlKeyString , $ inputXml , $ disconnect ) ; } else { // Not a DB transport. At this time, assume HTTP transport (which doesn't use a plug, by the way. uses outbytesize) $ transport = $ this -> getTransport ( ) ; $ transport -> setIpc ( $ internalKey ) ; $ transport -> setCtl ( $ controlKeyString ) ; $ url = $ this -> getOption ( 'httpTransportUrl' ) ; $ transport -> setUrl ( $ url ) ; // convert plugSize to bytes $ outByteSize = $ this -> plugSizeToBytes ( $ plugSize ) ; // if debug mode, log control key, and input XML. if ( $ this -> isDebug ( ) ) { $ this -> debugLog ( "\nExec start: " . date ( "Y-m-d H:i:s" ) . "\nVersion of toolkit front end: " . self :: getFrontEndVersion ( ) . "\nToolkit class: '" . __FILE__ . "'\nIPC: '" . $ this -> getInternalKey ( ) . "'. Control key: $controlKeyString\nHost URL: $url\nExpected output size (plugSize): $plugSize or $outByteSize bytes\nInput XML: $inputXml\n" ) ; $ this -> execStartTime = microtime ( true ) ; } $ result = $ transport -> send ( $ inputXml , $ outByteSize ) ; // workaround: XMLSERVICE as of 1.7.4 returns a single space instead of empty string when no content was requested. if ( $ result == ' ' ) { $ result = '' ; } } if ( $ this -> isDebug ( ) && $ result ) { $ end = microtime ( true ) ; $ elapsed = $ end - $ this -> execStartTime ; $ this -> debugLog ( "Output XML: $result\nExec end: " . date ( "Y-m-d H:i:s" ) . ". Seconds to execute: $elapsed.\n\n" ) ; } return $ result ; }
Send any XML to XMLSERVICE toolkit. The XML doesn't have to represent a program.
Was protected; made public to be usable by applications.

@param $inputXml
@param bool $disconnect
@return string
@throws \Exception
Send any XML to XMLSERVICE toolkit . The XML doesn t have to represent a program . Was protected ; made public to be usable by applications .