Support Incident Tracker GIT4.x
soap_transport_http Class Reference
Inheritance diagram for soap_transport_http:
Collaboration diagram for soap_transport_http:

Public Member Functions

 soap_transport_http ($url, $curl_options=NULL, $use_curl=false)
 setCurlOption ($option, $value)
 setHeader ($name, $value)
 unsetHeader ($name)
 setURL ($url)
 io_method ()
 connect ($connection_timeout=0, $response_timeout=30)
 send ($data, $timeout=0, $response_timeout=30, $cookies=NULL)
 sendHTTPS ($data, $timeout=0, $response_timeout=30, $cookies)
 setCredentials ($username, $password, $authtype= 'basic', $digestRequest=array(), $certRequest=array())
 setSOAPAction ($soapaction)
 setEncoding ($enc='gzip, deflate')
 setProxy ($proxyhost, $proxyport, $proxyusername= '', $proxypassword= '', $proxyauthtype= 'basic')
 isSkippableCurlHeader (&$data)
 decodeChunked ($buffer, $lb)
 buildPayload ($data, $cookie_str= '')
 sendRequest ($data, $cookies=NULL)
 getResponse ()
 setContentType ($type, $charset=false)
 usePersistentConnection ()
 parseCookie ($cookie_str)
 getCookiesForRequest ($cookies, $secure=false)
 soap_transport_http ($url, $curl_options=NULL, $use_curl=false)
 setCurlOption ($option, $value)
 setHeader ($name, $value)
 unsetHeader ($name)
 setURL ($url)
 io_method ()
 connect ($connection_timeout=0, $response_timeout=30)
 send ($data, $timeout=0, $response_timeout=30, $cookies=NULL)
 sendHTTPS ($data, $timeout=0, $response_timeout=30, $cookies)
 setCredentials ($username, $password, $authtype= 'basic', $digestRequest=array(), $certRequest=array())
 setSOAPAction ($soapaction)
 setEncoding ($enc='gzip, deflate')
 setProxy ($proxyhost, $proxyport, $proxyusername= '', $proxypassword= '', $proxyauthtype= 'basic')
 isSkippableCurlHeader (&$data)
 decodeChunked ($buffer, $lb)
 buildPayload ($data, $cookie_str= '')
 sendRequest ($data, $cookies=NULL)
 getResponse ()
 setContentType ($type, $charset=false)
 usePersistentConnection ()
 parseCookie ($cookie_str)
 getCookiesForRequest ($cookies, $secure=false)

Data Fields

 $url = ''
 $uri = ''
 $digest_uri = ''
 $scheme = ''
 $host = ''
 $port = ''
 $path = ''
 $request_method = 'POST'
 $protocol_version = '1.0'
 $encoding = ''
 $outgoing_headers = array()
 $incoming_headers = array()
 $incoming_cookies = array()
 $outgoing_payload = ''
 $incoming_payload = ''
 $response_status_line
 $useSOAPAction = true
 $persistentConnection = false
 $ch = false
 $ch_options = array()
 $use_curl = false
 $proxy = null
 $username = ''
 $password = ''
 $authtype = ''
 $digestRequest = array()
 $certRequest = array()

Detailed Description

transport class for sending/receiving data via HTTP and HTTPS NOTE: PHP must be compiled with the CURL extension for HTTPS support

Author:
Dietrich Ayala <dietrich@ganx4.com>
Scott Nichol <snichol@users.sourceforge.net>
Version:
Id:
class.soap_transport_http.php,v 1.66 2007/11/06 14:17:53 snichol Exp

public

transport class for sending/receiving data via HTTP and HTTPS NOTE: PHP must be compiled with the CURL extension for HTTPS support

Author:
Dietrich Ayala <dietrich@ganx4.com>
Scott Nichol <snichol@users.sourceforge.net>
Version:
Id:
nusoap.php,v 1.114 2007/11/06 15:17:46 snichol Exp

public

Definition at line 15 of file class.soap_transport_http.php.


Member Function Documentation

buildPayload ( data,
cookie_str = '' 
)

Writes the payload, including HTTP headers, to $this->outgoing_payload.

Parameters:
string$dataHTTP body
string$cookie_strdata for HTTP Cookie header
Returns:
void private

Definition at line 688 of file class.soap_transport_http.php.

References $data, $uri, nusoap_base::debug(), and setHeader().

Referenced by sendRequest().

                                                   {
        // Note: for cURL connections, $this->outgoing_payload is ignored,
        // as is the Content-Length header, but these are still created as
        // debugging guides.

        // add content-length header
        $this->setHeader('Content-Length', strlen($data));

        // start building outgoing payload:
        if ($this->proxy) {
            $uri = $this->url;
        } else {
            $uri = $this->uri;
        }
        $req = "$this->request_method $uri HTTP/$this->protocol_version";
        $this->debug("HTTP request: $req");
        $this->outgoing_payload = "$req\r\n";

        // loop thru headers, serializing
        foreach($this->outgoing_headers as $k => $v){
            $hdr = $k.': '.$v;
            $this->debug("HTTP header: $hdr");
            $this->outgoing_payload .= "$hdr\r\n";
        }

        // add any cookies
        if ($cookie_str != '') {
            $hdr = 'Cookie: '.$cookie_str;
            $this->debug("HTTP header: $hdr");
            $this->outgoing_payload .= "$hdr\r\n";
        }

        // header/body separator
        $this->outgoing_payload .= "\r\n";
        
        // add data
        $this->outgoing_payload .= $data;
    }
buildPayload ( data,
cookie_str = '' 
)

Writes the payload, including HTTP headers, to $this->outgoing_payload.

Parameters:
string$dataHTTP body
string$cookie_strdata for HTTP Cookie header
Returns:
void private

Definition at line 2795 of file nusoap.php.

References $data, $uri, nusoap_base::debug(), and setHeader().

                                                   {
        // Note: for cURL connections, $this->outgoing_payload is ignored,
        // as is the Content-Length header, but these are still created as
        // debugging guides.

        // add content-length header
        $this->setHeader('Content-Length', strlen($data));

        // start building outgoing payload:
        if ($this->proxy) {
            $uri = $this->url;
        } else {
            $uri = $this->uri;
        }
        $req = "$this->request_method $uri HTTP/$this->protocol_version";
        $this->debug("HTTP request: $req");
        $this->outgoing_payload = "$req\r\n";

        // loop thru headers, serializing
        foreach($this->outgoing_headers as $k => $v){
            $hdr = $k.': '.$v;
            $this->debug("HTTP header: $hdr");
            $this->outgoing_payload .= "$hdr\r\n";
        }

        // add any cookies
        if ($cookie_str != '') {
            $hdr = 'Cookie: '.$cookie_str;
            $this->debug("HTTP header: $hdr");
            $this->outgoing_payload .= "$hdr\r\n";
        }

        // header/body separator
        $this->outgoing_payload .= "\r\n";
        
        // add data
        $this->outgoing_payload .= $data;
    }
connect ( connection_timeout = 0,
response_timeout = 30 
)

establish an HTTP connection

Parameters:
integer$timeoutset connection timeout in seconds
integer$response_timeoutset response timeout in seconds
Returns:
boolean true if connected, false if not private

Definition at line 177 of file class.soap_transport_http.php.

References $host, $port, nusoap_base::appendDebug(), nusoap_base::debug(), io_method(), setCurlOption(), nusoap_base::setError(), setHeader(), and nusoap_base::varDump().

Referenced by send().

                                                                {
        // For PHP 4.3 with OpenSSL, change https scheme to ssl, then treat like
        // "regular" socket.
        // TODO: disabled for now because OpenSSL must be *compiled* in (not just
        //       loaded), and until PHP5 stream_get_wrappers is not available.
//      if ($this->scheme == 'https') {
//          if (version_compare(phpversion(), '4.3.0') >= 0) {
//              if (extension_loaded('openssl')) {
//                  $this->scheme = 'ssl';
//                  $this->debug('Using SSL over OpenSSL');
//              }
//          }
//      }
        $this->debug("connect connection_timeout $connection_timeout, response_timeout $response_timeout, scheme $this->scheme, host $this->host, port $this->port");
      if ($this->io_method() == 'socket') {
        if (!is_array($this->proxy)) {
            $host = $this->host;
            $port = $this->port;
        } else {
            $host = $this->proxy['host'];
            $port = $this->proxy['port'];
        }

        // use persistent connection
        if($this->persistentConnection && isset($this->fp) && is_resource($this->fp)){
            if (!feof($this->fp)) {
                $this->debug('Re-use persistent connection');
                return true;
            }
            fclose($this->fp);
            $this->debug('Closed persistent connection at EOF');
        }

        // munge host if using OpenSSL
        if ($this->scheme == 'ssl') {
            $host = 'ssl://' . $host;
        }
        $this->debug('calling fsockopen with host ' . $host . ' connection_timeout ' . $connection_timeout);

        // open socket
        if($connection_timeout > 0){
            $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str, $connection_timeout);
        } else {
            $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str);
        }
        
        // test pointer
        if(!$this->fp) {
            $msg = 'Couldn\'t open socket connection to server ' . $this->url;
            if ($this->errno) {
                $msg .= ', Error ('.$this->errno.'): '.$this->error_str;
            } else {
                $msg .= ' prior to connect().  This is often a problem looking up the host name.';
            }
            $this->debug($msg);
            $this->setError($msg);
            return false;
        }
        
        // set response timeout
        $this->debug('set response timeout to ' . $response_timeout);
        socket_set_timeout( $this->fp, $response_timeout);

        $this->debug('socket connected');
        return true;
      } else if ($this->io_method() == 'curl') {
        if (!extension_loaded('curl')) {
//          $this->setError('cURL Extension, or OpenSSL extension w/ PHP version >= 4.3 is required for HTTPS');
            $this->setError('The PHP cURL Extension is required for HTTPS or NLTM.  You will need to re-build or update your PHP to included cURL.');
            return false;
        }
        // Avoid warnings when PHP does not have these options
        if (defined('CURLOPT_CONNECTIONTIMEOUT'))
            $CURLOPT_CONNECTIONTIMEOUT = CURLOPT_CONNECTIONTIMEOUT;
        else
            $CURLOPT_CONNECTIONTIMEOUT = 78;
        if (defined('CURLOPT_HTTPAUTH'))
            $CURLOPT_HTTPAUTH = CURLOPT_HTTPAUTH;
        else
            $CURLOPT_HTTPAUTH = 107;
        if (defined('CURLOPT_PROXYAUTH'))
            $CURLOPT_PROXYAUTH = CURLOPT_PROXYAUTH;
        else
            $CURLOPT_PROXYAUTH = 111;
        if (defined('CURLAUTH_BASIC'))
            $CURLAUTH_BASIC = CURLAUTH_BASIC;
        else
            $CURLAUTH_BASIC = 1;
        if (defined('CURLAUTH_DIGEST'))
            $CURLAUTH_DIGEST = CURLAUTH_DIGEST;
        else
            $CURLAUTH_DIGEST = 2;
        if (defined('CURLAUTH_NTLM'))
            $CURLAUTH_NTLM = CURLAUTH_NTLM;
        else
            $CURLAUTH_NTLM = 8;

        $this->debug('connect using cURL');
        // init CURL
        $this->ch = curl_init();
        // set url
        $hostURL = ($this->port != '') ? "$this->scheme://$this->host:$this->port" : "$this->scheme://$this->host";
        // add path
        $hostURL .= $this->path;
        $this->setCurlOption(CURLOPT_URL, $hostURL);
        // follow location headers (re-directs)
        if (ini_get('safe_mode') || ini_get('open_basedir')) {
            $this->debug('safe_mode or open_basedir set, so do not set CURLOPT_FOLLOWLOCATION');
            $this->debug('safe_mode = ');
            $this->appendDebug($this->varDump(ini_get('safe_mode')));
            $this->debug('open_basedir = ');
            $this->appendDebug($this->varDump(ini_get('open_basedir')));
        } else {
            $this->setCurlOption(CURLOPT_FOLLOWLOCATION, 1);
        }
        // ask for headers in the response output
        $this->setCurlOption(CURLOPT_HEADER, 1);
        // ask for the response output as the return value
        $this->setCurlOption(CURLOPT_RETURNTRANSFER, 1);
        // encode
        // We manage this ourselves through headers and encoding
//      if(function_exists('gzuncompress')){
//          $this->setCurlOption(CURLOPT_ENCODING, 'deflate');
//      }
        // persistent connection
        if ($this->persistentConnection) {
            // I believe the following comment is now bogus, having applied to
            // the code when it used CURLOPT_CUSTOMREQUEST to send the request.
            // The way we send data, we cannot use persistent connections, since
            // there will be some "junk" at the end of our request.
            //$this->setCurlOption(CURL_HTTP_VERSION_1_1, true);
            $this->persistentConnection = false;
            $this->setHeader('Connection', 'close');
        }
        // set timeouts
        if ($connection_timeout != 0) {
            $this->setCurlOption($CURLOPT_CONNECTIONTIMEOUT, $connection_timeout);
        }
        if ($response_timeout != 0) {
            $this->setCurlOption(CURLOPT_TIMEOUT, $response_timeout);
        }

        if ($this->scheme == 'https') {
            $this->debug('set cURL SSL verify options');
            // recent versions of cURL turn on peer/host checking by default,
            // while PHP binaries are not compiled with a default location for the
            // CA cert bundle, so disable peer/host checking.
            //$this->setCurlOption(CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt');     
            $this->setCurlOption(CURLOPT_SSL_VERIFYPEER, 0);
            $this->setCurlOption(CURLOPT_SSL_VERIFYHOST, 0);
    
            // support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo)
            if ($this->authtype == 'certificate') {
                $this->debug('set cURL certificate options');
                if (isset($this->certRequest['cainfofile'])) {
                    $this->setCurlOption(CURLOPT_CAINFO, $this->certRequest['cainfofile']);
                }
                if (isset($this->certRequest['verifypeer'])) {
                    $this->setCurlOption(CURLOPT_SSL_VERIFYPEER, $this->certRequest['verifypeer']);
                } else {
                    $this->setCurlOption(CURLOPT_SSL_VERIFYPEER, 1);
                }
                if (isset($this->certRequest['verifyhost'])) {
                    $this->setCurlOption(CURLOPT_SSL_VERIFYHOST, $this->certRequest['verifyhost']);
                } else {
                    $this->setCurlOption(CURLOPT_SSL_VERIFYHOST, 1);
                }
                if (isset($this->certRequest['sslcertfile'])) {
                    $this->setCurlOption(CURLOPT_SSLCERT, $this->certRequest['sslcertfile']);
                }
                if (isset($this->certRequest['sslkeyfile'])) {
                    $this->setCurlOption(CURLOPT_SSLKEY, $this->certRequest['sslkeyfile']);
                }
                if (isset($this->certRequest['passphrase'])) {
                    $this->setCurlOption(CURLOPT_SSLKEYPASSWD, $this->certRequest['passphrase']);
                }
                if (isset($this->certRequest['certpassword'])) {
                    $this->setCurlOption(CURLOPT_SSLCERTPASSWD, $this->certRequest['certpassword']);
                }
            }
        }
        if ($this->authtype && ($this->authtype != 'certificate')) {
            if ($this->username) {
                $this->debug('set cURL username/password');
                $this->setCurlOption(CURLOPT_USERPWD, "$this->username:$this->password");
            }
            if ($this->authtype == 'basic') {
                $this->debug('set cURL for Basic authentication');
                $this->setCurlOption($CURLOPT_HTTPAUTH, $CURLAUTH_BASIC);
            }
            if ($this->authtype == 'digest') {
                $this->debug('set cURL for digest authentication');
                $this->setCurlOption($CURLOPT_HTTPAUTH, $CURLAUTH_DIGEST);
            }
            if ($this->authtype == 'ntlm') {
                $this->debug('set cURL for NTLM authentication');
                $this->setCurlOption($CURLOPT_HTTPAUTH, $CURLAUTH_NTLM);
            }
        }
        if (is_array($this->proxy)) {
            $this->debug('set cURL proxy options');
            if ($this->proxy['port'] != '') {
                $this->setCurlOption(CURLOPT_PROXY, $this->proxy['host'].':'.$this->proxy['port']);
            } else {
                $this->setCurlOption(CURLOPT_PROXY, $this->proxy['host']);
            }
            if ($this->proxy['username'] || $this->proxy['password']) {
                $this->debug('set cURL proxy authentication options');
                $this->setCurlOption(CURLOPT_PROXYUSERPWD, $this->proxy['username'].':'.$this->proxy['password']);
                if ($this->proxy['authtype'] == 'basic') {
                    $this->setCurlOption($CURLOPT_PROXYAUTH, $CURLAUTH_BASIC);
                }
                if ($this->proxy['authtype'] == 'ntlm') {
                    $this->setCurlOption($CURLOPT_PROXYAUTH, $CURLAUTH_NTLM);
                }
            }
        }
        $this->debug('cURL connection set up');
        return true;
      } else {
        $this->setError('Unknown scheme ' . $this->scheme);
        $this->debug('Unknown scheme ' . $this->scheme);
        return false;
      }
    }
connect ( connection_timeout = 0,
response_timeout = 30 
)

establish an HTTP connection

Parameters:
integer$timeoutset connection timeout in seconds
integer$response_timeoutset response timeout in seconds
Returns:
boolean true if connected, false if not private

Definition at line 2284 of file nusoap.php.

References $host, $port, nusoap_base::appendDebug(), nusoap_base::debug(), io_method(), setCurlOption(), nusoap_base::setError(), setHeader(), and nusoap_base::varDump().

                                                                {
        // For PHP 4.3 with OpenSSL, change https scheme to ssl, then treat like
        // "regular" socket.
        // TODO: disabled for now because OpenSSL must be *compiled* in (not just
        //       loaded), and until PHP5 stream_get_wrappers is not available.
//      if ($this->scheme == 'https') {
//          if (version_compare(phpversion(), '4.3.0') >= 0) {
//              if (extension_loaded('openssl')) {
//                  $this->scheme = 'ssl';
//                  $this->debug('Using SSL over OpenSSL');
//              }
//          }
//      }
        $this->debug("connect connection_timeout $connection_timeout, response_timeout $response_timeout, scheme $this->scheme, host $this->host, port $this->port");
      if ($this->io_method() == 'socket') {
        if (!is_array($this->proxy)) {
            $host = $this->host;
            $port = $this->port;
        } else {
            $host = $this->proxy['host'];
            $port = $this->proxy['port'];
        }

        // use persistent connection
        if($this->persistentConnection && isset($this->fp) && is_resource($this->fp)){
            if (!feof($this->fp)) {
                $this->debug('Re-use persistent connection');
                return true;
            }
            fclose($this->fp);
            $this->debug('Closed persistent connection at EOF');
        }

        // munge host if using OpenSSL
        if ($this->scheme == 'ssl') {
            $host = 'ssl://' . $host;
        }
        $this->debug('calling fsockopen with host ' . $host . ' connection_timeout ' . $connection_timeout);

        // open socket
        if($connection_timeout > 0){
            $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str, $connection_timeout);
        } else {
            $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str);
        }
        
        // test pointer
        if(!$this->fp) {
            $msg = 'Couldn\'t open socket connection to server ' . $this->url;
            if ($this->errno) {
                $msg .= ', Error ('.$this->errno.'): '.$this->error_str;
            } else {
                $msg .= ' prior to connect().  This is often a problem looking up the host name.';
            }
            $this->debug($msg);
            $this->setError($msg);
            return false;
        }
        
        // set response timeout
        $this->debug('set response timeout to ' . $response_timeout);
        socket_set_timeout( $this->fp, $response_timeout);

        $this->debug('socket connected');
        return true;
      } else if ($this->io_method() == 'curl') {
        if (!extension_loaded('curl')) {
//          $this->setError('cURL Extension, or OpenSSL extension w/ PHP version >= 4.3 is required for HTTPS');
            $this->setError('The PHP cURL Extension is required for HTTPS or NLTM.  You will need to re-build or update your PHP to included cURL.');
            return false;
        }
        // Avoid warnings when PHP does not have these options
        if (defined('CURLOPT_CONNECTIONTIMEOUT'))
            $CURLOPT_CONNECTIONTIMEOUT = CURLOPT_CONNECTIONTIMEOUT;
        else
            $CURLOPT_CONNECTIONTIMEOUT = 78;
        if (defined('CURLOPT_HTTPAUTH'))
            $CURLOPT_HTTPAUTH = CURLOPT_HTTPAUTH;
        else
            $CURLOPT_HTTPAUTH = 107;
        if (defined('CURLOPT_PROXYAUTH'))
            $CURLOPT_PROXYAUTH = CURLOPT_PROXYAUTH;
        else
            $CURLOPT_PROXYAUTH = 111;
        if (defined('CURLAUTH_BASIC'))
            $CURLAUTH_BASIC = CURLAUTH_BASIC;
        else
            $CURLAUTH_BASIC = 1;
        if (defined('CURLAUTH_DIGEST'))
            $CURLAUTH_DIGEST = CURLAUTH_DIGEST;
        else
            $CURLAUTH_DIGEST = 2;
        if (defined('CURLAUTH_NTLM'))
            $CURLAUTH_NTLM = CURLAUTH_NTLM;
        else
            $CURLAUTH_NTLM = 8;

        $this->debug('connect using cURL');
        // init CURL
        $this->ch = curl_init();
        // set url
        $hostURL = ($this->port != '') ? "$this->scheme://$this->host:$this->port" : "$this->scheme://$this->host";
        // add path
        $hostURL .= $this->path;
        $this->setCurlOption(CURLOPT_URL, $hostURL);
        // follow location headers (re-directs)
        if (ini_get('safe_mode') || ini_get('open_basedir')) {
            $this->debug('safe_mode or open_basedir set, so do not set CURLOPT_FOLLOWLOCATION');
            $this->debug('safe_mode = ');
            $this->appendDebug($this->varDump(ini_get('safe_mode')));
            $this->debug('open_basedir = ');
            $this->appendDebug($this->varDump(ini_get('open_basedir')));
        } else {
            $this->setCurlOption(CURLOPT_FOLLOWLOCATION, 1);
        }
        // ask for headers in the response output
        $this->setCurlOption(CURLOPT_HEADER, 1);
        // ask for the response output as the return value
        $this->setCurlOption(CURLOPT_RETURNTRANSFER, 1);
        // encode
        // We manage this ourselves through headers and encoding
//      if(function_exists('gzuncompress')){
//          $this->setCurlOption(CURLOPT_ENCODING, 'deflate');
//      }
        // persistent connection
        if ($this->persistentConnection) {
            // I believe the following comment is now bogus, having applied to
            // the code when it used CURLOPT_CUSTOMREQUEST to send the request.
            // The way we send data, we cannot use persistent connections, since
            // there will be some "junk" at the end of our request.
            //$this->setCurlOption(CURL_HTTP_VERSION_1_1, true);
            $this->persistentConnection = false;
            $this->setHeader('Connection', 'close');
        }
        // set timeouts
        if ($connection_timeout != 0) {
            $this->setCurlOption($CURLOPT_CONNECTIONTIMEOUT, $connection_timeout);
        }
        if ($response_timeout != 0) {
            $this->setCurlOption(CURLOPT_TIMEOUT, $response_timeout);
        }

        if ($this->scheme == 'https') {
            $this->debug('set cURL SSL verify options');
            // recent versions of cURL turn on peer/host checking by default,
            // while PHP binaries are not compiled with a default location for the
            // CA cert bundle, so disable peer/host checking.
            //$this->setCurlOption(CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt');     
            $this->setCurlOption(CURLOPT_SSL_VERIFYPEER, 0);
            $this->setCurlOption(CURLOPT_SSL_VERIFYHOST, 0);
    
            // support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo)
            if ($this->authtype == 'certificate') {
                $this->debug('set cURL certificate options');
                if (isset($this->certRequest['cainfofile'])) {
                    $this->setCurlOption(CURLOPT_CAINFO, $this->certRequest['cainfofile']);
                }
                if (isset($this->certRequest['verifypeer'])) {
                    $this->setCurlOption(CURLOPT_SSL_VERIFYPEER, $this->certRequest['verifypeer']);
                } else {
                    $this->setCurlOption(CURLOPT_SSL_VERIFYPEER, 1);
                }
                if (isset($this->certRequest['verifyhost'])) {
                    $this->setCurlOption(CURLOPT_SSL_VERIFYHOST, $this->certRequest['verifyhost']);
                } else {
                    $this->setCurlOption(CURLOPT_SSL_VERIFYHOST, 1);
                }
                if (isset($this->certRequest['sslcertfile'])) {
                    $this->setCurlOption(CURLOPT_SSLCERT, $this->certRequest['sslcertfile']);
                }
                if (isset($this->certRequest['sslkeyfile'])) {
                    $this->setCurlOption(CURLOPT_SSLKEY, $this->certRequest['sslkeyfile']);
                }
                if (isset($this->certRequest['passphrase'])) {
                    $this->setCurlOption(CURLOPT_SSLKEYPASSWD, $this->certRequest['passphrase']);
                }
                if (isset($this->certRequest['certpassword'])) {
                    $this->setCurlOption(CURLOPT_SSLCERTPASSWD, $this->certRequest['certpassword']);
                }
            }
        }
        if ($this->authtype && ($this->authtype != 'certificate')) {
            if ($this->username) {
                $this->debug('set cURL username/password');
                $this->setCurlOption(CURLOPT_USERPWD, "$this->username:$this->password");
            }
            if ($this->authtype == 'basic') {
                $this->debug('set cURL for Basic authentication');
                $this->setCurlOption($CURLOPT_HTTPAUTH, $CURLAUTH_BASIC);
            }
            if ($this->authtype == 'digest') {
                $this->debug('set cURL for digest authentication');
                $this->setCurlOption($CURLOPT_HTTPAUTH, $CURLAUTH_DIGEST);
            }
            if ($this->authtype == 'ntlm') {
                $this->debug('set cURL for NTLM authentication');
                $this->setCurlOption($CURLOPT_HTTPAUTH, $CURLAUTH_NTLM);
            }
        }
        if (is_array($this->proxy)) {
            $this->debug('set cURL proxy options');
            if ($this->proxy['port'] != '') {
                $this->setCurlOption(CURLOPT_PROXY, $this->proxy['host'].':'.$this->proxy['port']);
            } else {
                $this->setCurlOption(CURLOPT_PROXY, $this->proxy['host']);
            }
            if ($this->proxy['username'] || $this->proxy['password']) {
                $this->debug('set cURL proxy authentication options');
                $this->setCurlOption(CURLOPT_PROXYUSERPWD, $this->proxy['username'].':'.$this->proxy['password']);
                if ($this->proxy['authtype'] == 'basic') {
                    $this->setCurlOption($CURLOPT_PROXYAUTH, $CURLAUTH_BASIC);
                }
                if ($this->proxy['authtype'] == 'ntlm') {
                    $this->setCurlOption($CURLOPT_PROXYAUTH, $CURLAUTH_NTLM);
                }
            }
        }
        $this->debug('cURL connection set up');
        return true;
      } else {
        $this->setError('Unknown scheme ' . $this->scheme);
        $this->debug('Unknown scheme ' . $this->scheme);
        return false;
      }
    }
decodeChunked ( buffer,
lb 
)

decode a string that is encoded w/ "chunked' transfer encoding as defined in RFC2068 19.4.6

Parameters:
string$buffer
string$lb
Returns:
string public
Deprecated:

Definition at line 2738 of file nusoap.php.

References $length, and nusoap_base::debug().

                                        {
        // length := 0
        $length = 0;
        $new = '';
        
        // read chunk-size, chunk-extension (if any) and CRLF
        // get the position of the linebreak
        $chunkend = strpos($buffer, $lb);
        if ($chunkend == FALSE) {
            $this->debug('no linebreak found in decodeChunked');
            return $new;
        }
        $temp = substr($buffer,0,$chunkend);
        $chunk_size = hexdec( trim($temp) );
        $chunkstart = $chunkend + strlen($lb);
        // while (chunk-size > 0) {
        while ($chunk_size > 0) {
            $this->debug("chunkstart: $chunkstart chunk_size: $chunk_size");
            $chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size);
            
            // Just in case we got a broken connection
            if ($chunkend == FALSE) {
                $chunk = substr($buffer,$chunkstart);
                // append chunk-data to entity-body
                $new .= $chunk;
                $length += strlen($chunk);
                break;
            }
            
            // read chunk-data and CRLF
            $chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart);
            // append chunk-data to entity-body
            $new .= $chunk;
            // length := length + chunk-size
            $length += strlen($chunk);
            // read chunk-size and CRLF
            $chunkstart = $chunkend + strlen($lb);
            
            $chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb);
            if ($chunkend == FALSE) {
                break; //Just in case we got a broken connection
            }
            $temp = substr($buffer,$chunkstart,$chunkend-$chunkstart);
            $chunk_size = hexdec( trim($temp) );
            $chunkstart = $chunkend;
        }
        return $new;
    }
decodeChunked ( buffer,
lb 
)

decode a string that is encoded w/ "chunked' transfer encoding as defined in RFC2068 19.4.6

Parameters:
string$buffer
string$lb
Returns:
string public
Deprecated:

Definition at line 631 of file class.soap_transport_http.php.

References $length, and nusoap_base::debug().

                                        {
        // length := 0
        $length = 0;
        $new = '';
        
        // read chunk-size, chunk-extension (if any) and CRLF
        // get the position of the linebreak
        $chunkend = strpos($buffer, $lb);
        if ($chunkend == FALSE) {
            $this->debug('no linebreak found in decodeChunked');
            return $new;
        }
        $temp = substr($buffer,0,$chunkend);
        $chunk_size = hexdec( trim($temp) );
        $chunkstart = $chunkend + strlen($lb);
        // while (chunk-size > 0) {
        while ($chunk_size > 0) {
            $this->debug("chunkstart: $chunkstart chunk_size: $chunk_size");
            $chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size);
            
            // Just in case we got a broken connection
            if ($chunkend == FALSE) {
                $chunk = substr($buffer,$chunkstart);
                // append chunk-data to entity-body
                $new .= $chunk;
                $length += strlen($chunk);
                break;
            }
            
            // read chunk-data and CRLF
            $chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart);
            // append chunk-data to entity-body
            $new .= $chunk;
            // length := length + chunk-size
            $length += strlen($chunk);
            // read chunk-size and CRLF
            $chunkstart = $chunkend + strlen($lb);
            
            $chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb);
            if ($chunkend == FALSE) {
                break; //Just in case we got a broken connection
            }
            $temp = substr($buffer,$chunkstart,$chunkend-$chunkstart);
            $chunk_size = hexdec( trim($temp) );
            $chunkstart = $chunkend;
        }
        return $new;
    }
getCookiesForRequest ( cookies,
secure = false 
)

sort out cookies for the current request

Parameters:
array$cookiesarray with all cookies
boolean$secureis the send-content secure or not?
Returns:
string for Cookie-HTTP-Header private

Definition at line 1264 of file class.soap_transport_http.php.

References $domain, $path, and nusoap_base::debug().

Referenced by sendRequest().

                                                           {
        $cookie_str = '';
        if ((! is_null($cookies)) && (is_array($cookies))) {
            foreach ($cookies as $cookie) {
                if (! is_array($cookie)) {
                    continue;
                }
                $this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']);
                if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) {
                    if (strtotime($cookie['expires']) <= time()) {
                        $this->debug('cookie has expired');
                        continue;
                    }
                }
                if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) {
                    $domain = preg_quote($cookie['domain']);
                    if (! preg_match("'.*$domain$'i", $this->host)) {
                        $this->debug('cookie has different domain');
                        continue;
                    }
                }
                if ((isset($cookie['path'])) && (! empty($cookie['path']))) {
                    $path = preg_quote($cookie['path']);
                    if (! preg_match("'^$path.*'i", $this->path)) {
                        $this->debug('cookie is for a different path');
                        continue;
                    }
                }
                if ((! $secure) && (isset($cookie['secure'])) && ($cookie['secure'])) {
                    $this->debug('cookie is secure, transport is not');
                    continue;
                }
                $cookie_str .= $cookie['name'] . '=' . $cookie['value'] . '; ';
                $this->debug('add cookie to Cookie-String: ' . $cookie['name'] . '=' . $cookie['value']);
            }
        }
        return $cookie_str;
  }
getCookiesForRequest ( cookies,
secure = false 
)

sort out cookies for the current request

Parameters:
array$cookiesarray with all cookies
boolean$secureis the send-content secure or not?
Returns:
string for Cookie-HTTP-Header private

Definition at line 3371 of file nusoap.php.

References $domain, $path, and nusoap_base::debug().

                                                           {
        $cookie_str = '';
        if ((! is_null($cookies)) && (is_array($cookies))) {
            foreach ($cookies as $cookie) {
                if (! is_array($cookie)) {
                    continue;
                }
                $this->debug("check cookie for validity: ".$cookie['name'].'='.$cookie['value']);
                if ((isset($cookie['expires'])) && (! empty($cookie['expires']))) {
                    if (strtotime($cookie['expires']) <= time()) {
                        $this->debug('cookie has expired');
                        continue;
                    }
                }
                if ((isset($cookie['domain'])) && (! empty($cookie['domain']))) {
                    $domain = preg_quote($cookie['domain']);
                    if (! preg_match("'.*$domain$'i", $this->host)) {
                        $this->debug('cookie has different domain');
                        continue;
                    }
                }
                if ((isset($cookie['path'])) && (! empty($cookie['path']))) {
                    $path = preg_quote($cookie['path']);
                    if (! preg_match("'^$path.*'i", $this->path)) {
                        $this->debug('cookie is for a different path');
                        continue;
                    }
                }
                if ((! $secure) && (isset($cookie['secure'])) && ($cookie['secure'])) {
                    $this->debug('cookie is secure, transport is not');
                    continue;
                }
                $cookie_str .= $cookie['name'] . '=' . $cookie['value'] . '; ';
                $this->debug('add cookie to Cookie-String: ' . $cookie['name'] . '=' . $cookie['value']);
            }
        }
        return $cookie_str;
  }
getResponse ( )

gets the SOAP response via HTTP[S]

Returns:
string the response (also sets member variables like incoming_payload) private

Definition at line 792 of file class.soap_transport_http.php.

References $arr, $data, $digestRequest, count, nusoap_base::debug(), elseif, io_method(), isSkippableCurlHeader(), parseCookie(), setCredentials(), nusoap_base::setError(), and setURL().

Referenced by send().

                          {
        $this->incoming_payload = '';
        
      if ($this->io_method() == 'socket') {
        // loop until headers have been retrieved
        $data = '';
        while (!isset($lb)){

            // We might EOF during header read.
            if(feof($this->fp)) {
                $this->incoming_payload = $data;
                $this->debug('found no headers before EOF after length ' . strlen($data));
                $this->debug("received before EOF:\n" . $data);
                $this->setError('server failed to send headers');
                return false;
            }

            $tmp = fgets($this->fp, 256);
            $tmplen = strlen($tmp);
            $this->debug("read line of $tmplen bytes: " . trim($tmp));

            if ($tmplen == 0) {
                $this->incoming_payload = $data;
                $this->debug('socket read of headers timed out after length ' . strlen($data));
                $this->debug("read before timeout: " . $data);
                $this->setError('socket read of headers timed out');
                return false;
            }

            $data .= $tmp;
            $pos = strpos($data,"\r\n\r\n");
            if($pos > 1){
                $lb = "\r\n";
            } else {
                $pos = strpos($data,"\n\n");
                if($pos > 1){
                    $lb = "\n";
                }
            }
            // remove 100 headers
            if (isset($lb) && ereg('^HTTP/1.1 100',$data)) {
                unset($lb);
                $data = '';
            }//
        }
        // store header data
        $this->incoming_payload .= $data;
        $this->debug('found end of headers after length ' . strlen($data));
        // process headers
        $header_data = trim(substr($data,0,$pos));
        $header_array = explode($lb,$header_data);
        $this->incoming_headers = array();
        $this->incoming_cookies = array();
        foreach($header_array as $header_line){
            $arr = explode(':',$header_line, 2);
            if(count($arr) > 1){
                $header_name = strtolower(trim($arr[0]));
                $this->incoming_headers[$header_name] = trim($arr[1]);
                if ($header_name == 'set-cookie') {
                    // TODO: allow multiple cookies from parseCookie
                    $cookie = $this->parseCookie(trim($arr[1]));
                    if ($cookie) {
                        $this->incoming_cookies[] = $cookie;
                        $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']);
                    } else {
                        $this->debug('did not find cookie in ' . trim($arr[1]));
                    }
                }
            } else if (isset($header_name)) {
                // append continuation line to previous header
                $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line;
            }
        }
        
        // loop until msg has been received
        if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') {
            $content_length =  2147483647;  // ignore any content-length header
            $chunked = true;
            $this->debug("want to read chunked content");
        } elseif (isset($this->incoming_headers['content-length'])) {
            $content_length = $this->incoming_headers['content-length'];
            $chunked = false;
            $this->debug("want to read content of length $content_length");
        } else {
            $content_length =  2147483647;
            $chunked = false;
            $this->debug("want to read content to EOF");
        }
        $data = '';
        do {
            if ($chunked) {
                $tmp = fgets($this->fp, 256);
                $tmplen = strlen($tmp);
                $this->debug("read chunk line of $tmplen bytes");
                if ($tmplen == 0) {
                    $this->incoming_payload = $data;
                    $this->debug('socket read of chunk length timed out after length ' . strlen($data));
                    $this->debug("read before timeout:\n" . $data);
                    $this->setError('socket read of chunk length timed out');
                    return false;
                }
                $content_length = hexdec(trim($tmp));
                $this->debug("chunk length $content_length");
            }
            $strlen = 0;
            while (($strlen < $content_length) && (!feof($this->fp))) {
                $readlen = min(8192, $content_length - $strlen);
                $tmp = fread($this->fp, $readlen);
                $tmplen = strlen($tmp);
                $this->debug("read buffer of $tmplen bytes");
                if (($tmplen == 0) && (!feof($this->fp))) {
                    $this->incoming_payload = $data;
                    $this->debug('socket read of body timed out after length ' . strlen($data));
                    $this->debug("read before timeout:\n" . $data);
                    $this->setError('socket read of body timed out');
                    return false;
                }
                $strlen += $tmplen;
                $data .= $tmp;
            }
            if ($chunked && ($content_length > 0)) {
                $tmp = fgets($this->fp, 256);
                $tmplen = strlen($tmp);
                $this->debug("read chunk terminator of $tmplen bytes");
                if ($tmplen == 0) {
                    $this->incoming_payload = $data;
                    $this->debug('socket read of chunk terminator timed out after length ' . strlen($data));
                    $this->debug("read before timeout:\n" . $data);
                    $this->setError('socket read of chunk terminator timed out');
                    return false;
                }
            }
        } while ($chunked && ($content_length > 0) && (!feof($this->fp)));
        if (feof($this->fp)) {
            $this->debug('read to EOF');
        }
        $this->debug('read body of length ' . strlen($data));
        $this->incoming_payload .= $data;
        $this->debug('received a total of '.strlen($this->incoming_payload).' bytes of data from server');
        
        // close filepointer
        if(
            (isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') || 
            (! $this->persistentConnection) || feof($this->fp)){
            fclose($this->fp);
            $this->fp = false;
            $this->debug('closed socket');
        }
        
        // connection was closed unexpectedly
        if($this->incoming_payload == ''){
            $this->setError('no response from server');
            return false;
        }
        
        // decode transfer-encoding
//      if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){
//          if(!$data = $this->decodeChunked($data, $lb)){
//              $this->setError('Decoding of chunked data failed');
//              return false;
//          }
            //print "<pre>\nde-chunked:\n---------------\n$data\n\n---------------\n</pre>";
            // set decoded payload
//          $this->incoming_payload = $header_data.$lb.$lb.$data;
//      }
    
      } else if ($this->io_method() == 'curl') {
        // send and receive
        $this->debug('send and receive with cURL');
        $this->incoming_payload = curl_exec($this->ch);
        $data = $this->incoming_payload;

        $cErr = curl_error($this->ch);
        if ($cErr != '') {
            $err = 'cURL ERROR: '.curl_errno($this->ch).': '.$cErr.'<br>';
            // TODO: there is a PHP bug that can cause this to SEGV for CURLINFO_CONTENT_TYPE
            foreach(curl_getinfo($this->ch) as $k => $v){
                $err .= "$k: $v<br>";
            }
            $this->debug($err);
            $this->setError($err);
            curl_close($this->ch);
            return false;
        } else {
            //echo '<pre>';
            //var_dump(curl_getinfo($this->ch));
            //echo '</pre>';
        }
        // close curl
        $this->debug('No cURL error, closing cURL');
        curl_close($this->ch);
        
        // try removing skippable headers
        $savedata = $data;
        while ($this->isSkippableCurlHeader($data)) {
            $this->debug("Found HTTP header to skip");
            if ($pos = strpos($data,"\r\n\r\n")) {
                $data = ltrim(substr($data,$pos));
            } elseif($pos = strpos($data,"\n\n") ) {
                $data = ltrim(substr($data,$pos));
            }
        }

        if ($data == '') {
            // have nothing left; just remove 100 header(s)
            $data = $savedata;
            while (ereg('^HTTP/1.1 100',$data)) {
                if ($pos = strpos($data,"\r\n\r\n")) {
                    $data = ltrim(substr($data,$pos));
                } elseif($pos = strpos($data,"\n\n") ) {
                    $data = ltrim(substr($data,$pos));
                }
            }
        }
        
        // separate content from HTTP headers
        if ($pos = strpos($data,"\r\n\r\n")) {
            $lb = "\r\n";
        } elseif( $pos = strpos($data,"\n\n")) {
            $lb = "\n";
        } else {
            $this->debug('no proper separation of headers and document');
            $this->setError('no proper separation of headers and document');
            return false;
        }
        $header_data = trim(substr($data,0,$pos));
        $header_array = explode($lb,$header_data);
        $data = ltrim(substr($data,$pos));
        $this->debug('found proper separation of headers and document');
        $this->debug('cleaned data, stringlen: '.strlen($data));
        // clean headers
        foreach ($header_array as $header_line) {
            $arr = explode(':',$header_line,2);
            if(count($arr) > 1){
                $header_name = strtolower(trim($arr[0]));
                $this->incoming_headers[$header_name] = trim($arr[1]);
                if ($header_name == 'set-cookie') {
                    // TODO: allow multiple cookies from parseCookie
                    $cookie = $this->parseCookie(trim($arr[1]));
                    if ($cookie) {
                        $this->incoming_cookies[] = $cookie;
                        $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']);
                    } else {
                        $this->debug('did not find cookie in ' . trim($arr[1]));
                    }
                }
            } else if (isset($header_name)) {
                // append continuation line to previous header
                $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line;
            }
        }
      }

        $this->response_status_line = $header_array[0];
        $arr = explode(' ', $this->response_status_line, 3);
        $http_version = $arr[0];
        $http_status = intval($arr[1]);
        $http_reason = count($arr) > 2 ? $arr[2] : '';

        // see if we need to resend the request with http digest authentication
        if (isset($this->incoming_headers['location']) && ($http_status == 301 || $http_status == 302)) {
            $this->debug("Got $http_status $http_reason with Location: " . $this->incoming_headers['location']);
            $this->setURL($this->incoming_headers['location']);
            $this->tryagain = true;
            return false;
        }

        // see if we need to resend the request with http digest authentication
        if (isset($this->incoming_headers['www-authenticate']) && $http_status == 401) {
            $this->debug("Got 401 $http_reason with WWW-Authenticate: " . $this->incoming_headers['www-authenticate']);
            if (strstr($this->incoming_headers['www-authenticate'], "Digest ")) {
                $this->debug('Server wants digest authentication');
                // remove "Digest " from our elements
                $digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']);
                
                // parse elements into array
                $digestElements = explode(',', $digestString);
                foreach ($digestElements as $val) {
                    $tempElement = explode('=', trim($val), 2);
                    $digestRequest[$tempElement[0]] = str_replace("\"", '', $tempElement[1]);
                }

                // should have (at least) qop, realm, nonce
                if (isset($digestRequest['nonce'])) {
                    $this->setCredentials($this->username, $this->password, 'digest', $digestRequest);
                    $this->tryagain = true;
                    return false;
                }
            }
            $this->debug('HTTP authentication failed');
            $this->setError('HTTP authentication failed');
            return false;
        }
        
        if (
            ($http_status >= 300 && $http_status <= 307) ||
            ($http_status >= 400 && $http_status <= 417) ||
            ($http_status >= 501 && $http_status <= 505)
           ) {
            $this->setError("Unsupported HTTP response status $http_status $http_reason (soapclient->response has contents of the response)");
            return false;
        }

        // decode content-encoding
        if(isset($this->incoming_headers['content-encoding']) && $this->incoming_headers['content-encoding'] != ''){
            if(strtolower($this->incoming_headers['content-encoding']) == 'deflate' || strtolower($this->incoming_headers['content-encoding']) == 'gzip'){
                // if decoding works, use it. else assume data wasn't gzencoded
                if(function_exists('gzinflate')){
                    //$timer->setMarker('starting decoding of gzip/deflated content');
                    // IIS 5 requires gzinflate instead of gzuncompress (similar to IE 5 and gzdeflate v. gzcompress)
                    // this means there are no Zlib headers, although there should be
                    $this->debug('The gzinflate function exists');
                    $datalen = strlen($data);
                    if ($this->incoming_headers['content-encoding'] == 'deflate') {
                        if ($degzdata = @gzinflate($data)) {
                            $data = $degzdata;
                            $this->debug('The payload has been inflated to ' . strlen($data) . ' bytes');
                            if (strlen($data) < $datalen) {
                                // test for the case that the payload has been compressed twice
                                $this->debug('The inflated payload is smaller than the gzipped one; try again');
                                if ($degzdata = @gzinflate($data)) {
                                    $data = $degzdata;
                                    $this->debug('The payload has been inflated again to ' . strlen($data) . ' bytes');
                                }
                            }
                        } else {
                            $this->debug('Error using gzinflate to inflate the payload');
                            $this->setError('Error using gzinflate to inflate the payload');
                        }
                    } elseif ($this->incoming_headers['content-encoding'] == 'gzip') {
                        if ($degzdata = @gzinflate(substr($data, 10))) {    // do our best
                            $data = $degzdata;
                            $this->debug('The payload has been un-gzipped to ' . strlen($data) . ' bytes');
                            if (strlen($data) < $datalen) {
                                // test for the case that the payload has been compressed twice
                                $this->debug('The un-gzipped payload is smaller than the gzipped one; try again');
                                if ($degzdata = @gzinflate(substr($data, 10))) {
                                    $data = $degzdata;
                                    $this->debug('The payload has been un-gzipped again to ' . strlen($data) . ' bytes');
                                }
                            }
                        } else {
                            $this->debug('Error using gzinflate to un-gzip the payload');
                            $this->setError('Error using gzinflate to un-gzip the payload');
                        }
                    }
                    //$timer->setMarker('finished decoding of gzip/deflated content');
                    //print "<xmp>\nde-inflated:\n---------------\n$data\n-------------\n</xmp>";
                    // set decoded payload
                    $this->incoming_payload = $header_data.$lb.$lb.$data;
                } else {
                    $this->debug('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.');
                    $this->setError('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.');
                }
            } else {
                $this->debug('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']);
                $this->setError('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']);
            }
        } else {
            $this->debug('No Content-Encoding header');
        }
        
        if(strlen($data) == 0){
            $this->debug('no data after headers!');
            $this->setError('no data present after HTTP headers');
            return false;
        }
        
        return $data;
    }
getResponse ( )

gets the SOAP response via HTTP[S]

Returns:
string the response (also sets member variables like incoming_payload) private

Definition at line 2899 of file nusoap.php.

References $arr, $data, $digestRequest, count, nusoap_base::debug(), elseif, io_method(), isSkippableCurlHeader(), parseCookie(), setCredentials(), nusoap_base::setError(), and setURL().

                          {
        $this->incoming_payload = '';
        
      if ($this->io_method() == 'socket') {
        // loop until headers have been retrieved
        $data = '';
        while (!isset($lb)){

            // We might EOF during header read.
            if(feof($this->fp)) {
                $this->incoming_payload = $data;
                $this->debug('found no headers before EOF after length ' . strlen($data));
                $this->debug("received before EOF:\n" . $data);
                $this->setError('server failed to send headers');
                return false;
            }

            $tmp = fgets($this->fp, 256);
            $tmplen = strlen($tmp);
            $this->debug("read line of $tmplen bytes: " . trim($tmp));

            if ($tmplen == 0) {
                $this->incoming_payload = $data;
                $this->debug('socket read of headers timed out after length ' . strlen($data));
                $this->debug("read before timeout: " . $data);
                $this->setError('socket read of headers timed out');
                return false;
            }

            $data .= $tmp;
            $pos = strpos($data,"\r\n\r\n");
            if($pos > 1){
                $lb = "\r\n";
            } else {
                $pos = strpos($data,"\n\n");
                if($pos > 1){
                    $lb = "\n";
                }
            }
            // remove 100 headers
            if (isset($lb) && ereg('^HTTP/1.1 100',$data)) {
                unset($lb);
                $data = '';
            }//
        }
        // store header data
        $this->incoming_payload .= $data;
        $this->debug('found end of headers after length ' . strlen($data));
        // process headers
        $header_data = trim(substr($data,0,$pos));
        $header_array = explode($lb,$header_data);
        $this->incoming_headers = array();
        $this->incoming_cookies = array();
        foreach($header_array as $header_line){
            $arr = explode(':',$header_line, 2);
            if(count($arr) > 1){
                $header_name = strtolower(trim($arr[0]));
                $this->incoming_headers[$header_name] = trim($arr[1]);
                if ($header_name == 'set-cookie') {
                    // TODO: allow multiple cookies from parseCookie
                    $cookie = $this->parseCookie(trim($arr[1]));
                    if ($cookie) {
                        $this->incoming_cookies[] = $cookie;
                        $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']);
                    } else {
                        $this->debug('did not find cookie in ' . trim($arr[1]));
                    }
                }
            } else if (isset($header_name)) {
                // append continuation line to previous header
                $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line;
            }
        }
        
        // loop until msg has been received
        if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') {
            $content_length =  2147483647;  // ignore any content-length header
            $chunked = true;
            $this->debug("want to read chunked content");
        } elseif (isset($this->incoming_headers['content-length'])) {
            $content_length = $this->incoming_headers['content-length'];
            $chunked = false;
            $this->debug("want to read content of length $content_length");
        } else {
            $content_length =  2147483647;
            $chunked = false;
            $this->debug("want to read content to EOF");
        }
        $data = '';
        do {
            if ($chunked) {
                $tmp = fgets($this->fp, 256);
                $tmplen = strlen($tmp);
                $this->debug("read chunk line of $tmplen bytes");
                if ($tmplen == 0) {
                    $this->incoming_payload = $data;
                    $this->debug('socket read of chunk length timed out after length ' . strlen($data));
                    $this->debug("read before timeout:\n" . $data);
                    $this->setError('socket read of chunk length timed out');
                    return false;
                }
                $content_length = hexdec(trim($tmp));
                $this->debug("chunk length $content_length");
            }
            $strlen = 0;
            while (($strlen < $content_length) && (!feof($this->fp))) {
                $readlen = min(8192, $content_length - $strlen);
                $tmp = fread($this->fp, $readlen);
                $tmplen = strlen($tmp);
                $this->debug("read buffer of $tmplen bytes");
                if (($tmplen == 0) && (!feof($this->fp))) {
                    $this->incoming_payload = $data;
                    $this->debug('socket read of body timed out after length ' . strlen($data));
                    $this->debug("read before timeout:\n" . $data);
                    $this->setError('socket read of body timed out');
                    return false;
                }
                $strlen += $tmplen;
                $data .= $tmp;
            }
            if ($chunked && ($content_length > 0)) {
                $tmp = fgets($this->fp, 256);
                $tmplen = strlen($tmp);
                $this->debug("read chunk terminator of $tmplen bytes");
                if ($tmplen == 0) {
                    $this->incoming_payload = $data;
                    $this->debug('socket read of chunk terminator timed out after length ' . strlen($data));
                    $this->debug("read before timeout:\n" . $data);
                    $this->setError('socket read of chunk terminator timed out');
                    return false;
                }
            }
        } while ($chunked && ($content_length > 0) && (!feof($this->fp)));
        if (feof($this->fp)) {
            $this->debug('read to EOF');
        }
        $this->debug('read body of length ' . strlen($data));
        $this->incoming_payload .= $data;
        $this->debug('received a total of '.strlen($this->incoming_payload).' bytes of data from server');
        
        // close filepointer
        if(
            (isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') || 
            (! $this->persistentConnection) || feof($this->fp)){
            fclose($this->fp);
            $this->fp = false;
            $this->debug('closed socket');
        }
        
        // connection was closed unexpectedly
        if($this->incoming_payload == ''){
            $this->setError('no response from server');
            return false;
        }
        
        // decode transfer-encoding
//      if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){
//          if(!$data = $this->decodeChunked($data, $lb)){
//              $this->setError('Decoding of chunked data failed');
//              return false;
//          }
            //print "<pre>\nde-chunked:\n---------------\n$data\n\n---------------\n</pre>";
            // set decoded payload
//          $this->incoming_payload = $header_data.$lb.$lb.$data;
//      }
    
      } else if ($this->io_method() == 'curl') {
        // send and receive
        $this->debug('send and receive with cURL');
        $this->incoming_payload = curl_exec($this->ch);
        $data = $this->incoming_payload;

        $cErr = curl_error($this->ch);
        if ($cErr != '') {
            $err = 'cURL ERROR: '.curl_errno($this->ch).': '.$cErr.'<br>';
            // TODO: there is a PHP bug that can cause this to SEGV for CURLINFO_CONTENT_TYPE
            foreach(curl_getinfo($this->ch) as $k => $v){
                $err .= "$k: $v<br>";
            }
            $this->debug($err);
            $this->setError($err);
            curl_close($this->ch);
            return false;
        } else {
            //echo '<pre>';
            //var_dump(curl_getinfo($this->ch));
            //echo '</pre>';
        }
        // close curl
        $this->debug('No cURL error, closing cURL');
        curl_close($this->ch);
        
        // try removing skippable headers
        $savedata = $data;
        while ($this->isSkippableCurlHeader($data)) {
            $this->debug("Found HTTP header to skip");
            if ($pos = strpos($data,"\r\n\r\n")) {
                $data = ltrim(substr($data,$pos));
            } elseif($pos = strpos($data,"\n\n") ) {
                $data = ltrim(substr($data,$pos));
            }
        }

        if ($data == '') {
            // have nothing left; just remove 100 header(s)
            $data = $savedata;
            while (ereg('^HTTP/1.1 100',$data)) {
                if ($pos = strpos($data,"\r\n\r\n")) {
                    $data = ltrim(substr($data,$pos));
                } elseif($pos = strpos($data,"\n\n") ) {
                    $data = ltrim(substr($data,$pos));
                }
            }
        }
        
        // separate content from HTTP headers
        if ($pos = strpos($data,"\r\n\r\n")) {
            $lb = "\r\n";
        } elseif( $pos = strpos($data,"\n\n")) {
            $lb = "\n";
        } else {
            $this->debug('no proper separation of headers and document');
            $this->setError('no proper separation of headers and document');
            return false;
        }
        $header_data = trim(substr($data,0,$pos));
        $header_array = explode($lb,$header_data);
        $data = ltrim(substr($data,$pos));
        $this->debug('found proper separation of headers and document');
        $this->debug('cleaned data, stringlen: '.strlen($data));
        // clean headers
        foreach ($header_array as $header_line) {
            $arr = explode(':',$header_line,2);
            if(count($arr) > 1){
                $header_name = strtolower(trim($arr[0]));
                $this->incoming_headers[$header_name] = trim($arr[1]);
                if ($header_name == 'set-cookie') {
                    // TODO: allow multiple cookies from parseCookie
                    $cookie = $this->parseCookie(trim($arr[1]));
                    if ($cookie) {
                        $this->incoming_cookies[] = $cookie;
                        $this->debug('found cookie: ' . $cookie['name'] . ' = ' . $cookie['value']);
                    } else {
                        $this->debug('did not find cookie in ' . trim($arr[1]));
                    }
                }
            } else if (isset($header_name)) {
                // append continuation line to previous header
                $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line;
            }
        }
      }

        $this->response_status_line = $header_array[0];
        $arr = explode(' ', $this->response_status_line, 3);
        $http_version = $arr[0];
        $http_status = intval($arr[1]);
        $http_reason = count($arr) > 2 ? $arr[2] : '';

        // see if we need to resend the request with http digest authentication
        if (isset($this->incoming_headers['location']) && ($http_status == 301 || $http_status == 302)) {
            $this->debug("Got $http_status $http_reason with Location: " . $this->incoming_headers['location']);
            $this->setURL($this->incoming_headers['location']);
            $this->tryagain = true;
            return false;
        }

        // see if we need to resend the request with http digest authentication
        if (isset($this->incoming_headers['www-authenticate']) && $http_status == 401) {
            $this->debug("Got 401 $http_reason with WWW-Authenticate: " . $this->incoming_headers['www-authenticate']);
            if (strstr($this->incoming_headers['www-authenticate'], "Digest ")) {
                $this->debug('Server wants digest authentication');
                // remove "Digest " from our elements
                $digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']);
                
                // parse elements into array
                $digestElements = explode(',', $digestString);
                foreach ($digestElements as $val) {
                    $tempElement = explode('=', trim($val), 2);
                    $digestRequest[$tempElement[0]] = str_replace("\"", '', $tempElement[1]);
                }

                // should have (at least) qop, realm, nonce
                if (isset($digestRequest['nonce'])) {
                    $this->setCredentials($this->username, $this->password, 'digest', $digestRequest);
                    $this->tryagain = true;
                    return false;
                }
            }
            $this->debug('HTTP authentication failed');
            $this->setError('HTTP authentication failed');
            return false;
        }
        
        if (
            ($http_status >= 300 && $http_status <= 307) ||
            ($http_status >= 400 && $http_status <= 417) ||
            ($http_status >= 501 && $http_status <= 505)
           ) {
            $this->setError("Unsupported HTTP response status $http_status $http_reason (soapclient->response has contents of the response)");
            return false;
        }

        // decode content-encoding
        if(isset($this->incoming_headers['content-encoding']) && $this->incoming_headers['content-encoding'] != ''){
            if(strtolower($this->incoming_headers['content-encoding']) == 'deflate' || strtolower($this->incoming_headers['content-encoding']) == 'gzip'){
                // if decoding works, use it. else assume data wasn't gzencoded
                if(function_exists('gzinflate')){
                    //$timer->setMarker('starting decoding of gzip/deflated content');
                    // IIS 5 requires gzinflate instead of gzuncompress (similar to IE 5 and gzdeflate v. gzcompress)
                    // this means there are no Zlib headers, although there should be
                    $this->debug('The gzinflate function exists');
                    $datalen = strlen($data);
                    if ($this->incoming_headers['content-encoding'] == 'deflate') {
                        if ($degzdata = @gzinflate($data)) {
                            $data = $degzdata;
                            $this->debug('The payload has been inflated to ' . strlen($data) . ' bytes');
                            if (strlen($data) < $datalen) {
                                // test for the case that the payload has been compressed twice
                                $this->debug('The inflated payload is smaller than the gzipped one; try again');
                                if ($degzdata = @gzinflate($data)) {
                                    $data = $degzdata;
                                    $this->debug('The payload has been inflated again to ' . strlen($data) . ' bytes');
                                }
                            }
                        } else {
                            $this->debug('Error using gzinflate to inflate the payload');
                            $this->setError('Error using gzinflate to inflate the payload');
                        }
                    } elseif ($this->incoming_headers['content-encoding'] == 'gzip') {
                        if ($degzdata = @gzinflate(substr($data, 10))) {    // do our best
                            $data = $degzdata;
                            $this->debug('The payload has been un-gzipped to ' . strlen($data) . ' bytes');
                            if (strlen($data) < $datalen) {
                                // test for the case that the payload has been compressed twice
                                $this->debug('The un-gzipped payload is smaller than the gzipped one; try again');
                                if ($degzdata = @gzinflate(substr($data, 10))) {
                                    $data = $degzdata;
                                    $this->debug('The payload has been un-gzipped again to ' . strlen($data) . ' bytes');
                                }
                            }
                        } else {
                            $this->debug('Error using gzinflate to un-gzip the payload');
                            $this->setError('Error using gzinflate to un-gzip the payload');
                        }
                    }
                    //$timer->setMarker('finished decoding of gzip/deflated content');
                    //print "<xmp>\nde-inflated:\n---------------\n$data\n-------------\n</xmp>";
                    // set decoded payload
                    $this->incoming_payload = $header_data.$lb.$lb.$data;
                } else {
                    $this->debug('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.');
                    $this->setError('The server sent compressed data. Your php install must have the Zlib extension compiled in to support this.');
                }
            } else {
                $this->debug('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']);
                $this->setError('Unsupported Content-Encoding ' . $this->incoming_headers['content-encoding']);
            }
        } else {
            $this->debug('No Content-Encoding header');
        }
        
        if(strlen($data) == 0){
            $this->debug('no data after headers!');
            $this->setError('no data present after HTTP headers');
            return false;
        }
        
        return $data;
    }
io_method ( )

gets the I/O method to use

Returns:
string I/O method to use (socket|curl|unknown) private

Definition at line 161 of file class.soap_transport_http.php.

Referenced by connect(), getResponse(), and sendRequest().

                         {
        if ($this->use_curl || ($this->scheme == 'https') || ($this->scheme == 'http' && $this->authtype == 'ntlm') || ($this->scheme == 'http' && is_array($this->proxy) && $this->proxy['authtype'] == 'ntlm'))
            return 'curl';
        if (($this->scheme == 'http' || $this->scheme == 'ssl') && $this->authtype != 'ntlm' && (!is_array($this->proxy) || $this->proxy['authtype'] != 'ntlm'))
            return 'socket';
        return 'unknown';
    }
io_method ( )

gets the I/O method to use

Returns:
string I/O method to use (socket|curl|unknown) private

Definition at line 2268 of file nusoap.php.

                         {
        if ($this->use_curl || ($this->scheme == 'https') || ($this->scheme == 'http' && $this->authtype == 'ntlm') || ($this->scheme == 'http' && is_array($this->proxy) && $this->proxy['authtype'] == 'ntlm'))
            return 'curl';
        if (($this->scheme == 'http' || $this->scheme == 'ssl') && $this->authtype != 'ntlm' && (!is_array($this->proxy) || $this->proxy['authtype'] != 'ntlm'))
            return 'socket';
        return 'unknown';
    }
isSkippableCurlHeader ( &$  data)

Test if the given string starts with a header that is to be skipped. Skippable headers result from chunked transfer and proxy requests.

Parameters:
string$dataThe string to check.
Returns:
boolean Whether a skippable header was found. private

Definition at line 2711 of file nusoap.php.

References $data.

                                           {
        $skipHeaders = array(   'HTTP/1.1 100',
                                'HTTP/1.0 301',
                                'HTTP/1.1 301',
                                'HTTP/1.0 302',
                                'HTTP/1.1 302',
                                'HTTP/1.0 401',
                                'HTTP/1.1 401',
                                'HTTP/1.0 200 Connection established');
        foreach ($skipHeaders as $hd) {
            $prefix = substr($data, 0, strlen($hd));
            if ($prefix == $hd) return true;
        }

        return false;
    }
isSkippableCurlHeader ( &$  data)

Test if the given string starts with a header that is to be skipped. Skippable headers result from chunked transfer and proxy requests.

Parameters:
string$dataThe string to check.
Returns:
boolean Whether a skippable header was found. private

Definition at line 604 of file class.soap_transport_http.php.

References $data.

Referenced by getResponse().

                                           {
        $skipHeaders = array(   'HTTP/1.1 100',
                                'HTTP/1.0 301',
                                'HTTP/1.1 301',
                                'HTTP/1.0 302',
                                'HTTP/1.1 302',
                                'HTTP/1.0 401',
                                'HTTP/1.1 401',
                                'HTTP/1.0 200 Connection established');
        foreach ($skipHeaders as $hd) {
            $prefix = substr($data, 0, strlen($hd));
            if ($prefix == $hd) return true;
        }

        return false;
    }
parseCookie ( cookie_str)

parse an incoming Cookie into it's parts

Parameters:
string$cookie_strcontent of cookie
Returns:
array with data of that cookie private

Definition at line 3307 of file nusoap.php.

References $data, $domain, $path, and $start.

                                      {
        $cookie_str = str_replace('; ', ';', $cookie_str) . ';';
        $data = split(';', $cookie_str);
        $value_str = $data[0];

        $cookie_param = 'domain=';
        $start = strpos($cookie_str, $cookie_param);
        if ($start > 0) {
            $domain = substr($cookie_str, $start + strlen($cookie_param));
            $domain = substr($domain, 0, strpos($domain, ';'));
        } else {
            $domain = '';
        }

        $cookie_param = 'expires=';
        $start = strpos($cookie_str, $cookie_param);
        if ($start > 0) {
            $expires = substr($cookie_str, $start + strlen($cookie_param));
            $expires = substr($expires, 0, strpos($expires, ';'));
        } else {
            $expires = '';
        }

        $cookie_param = 'path=';
        $start = strpos($cookie_str, $cookie_param);
        if ( $start > 0 ) {
            $path = substr($cookie_str, $start + strlen($cookie_param));
            $path = substr($path, 0, strpos($path, ';'));
        } else {
            $path = '/';
        }
                        
        $cookie_param = ';secure;';
        if (strpos($cookie_str, $cookie_param) !== FALSE) {
            $secure = true;
        } else {
            $secure = false;
        }

        $sep_pos = strpos($value_str, '=');

        if ($sep_pos) {
            $name = substr($value_str, 0, $sep_pos);
            $value = substr($value_str, $sep_pos + 1);
            $cookie= array( 'name' => $name,
                            'value' => $value,
                            'domain' => $domain,
                            'path' => $path,
                            'expires' => $expires,
                            'secure' => $secure
                            );      
            return $cookie;
        }
        return false;
    }
parseCookie ( cookie_str)

parse an incoming Cookie into it's parts

Parameters:
string$cookie_strcontent of cookie
Returns:
array with data of that cookie private

Definition at line 1200 of file class.soap_transport_http.php.

References $data, $domain, $path, and $start.

Referenced by getResponse().

                                      {
        $cookie_str = str_replace('; ', ';', $cookie_str) . ';';
        $data = split(';', $cookie_str);
        $value_str = $data[0];

        $cookie_param = 'domain=';
        $start = strpos($cookie_str, $cookie_param);
        if ($start > 0) {
            $domain = substr($cookie_str, $start + strlen($cookie_param));
            $domain = substr($domain, 0, strpos($domain, ';'));
        } else {
            $domain = '';
        }

        $cookie_param = 'expires=';
        $start = strpos($cookie_str, $cookie_param);
        if ($start > 0) {
            $expires = substr($cookie_str, $start + strlen($cookie_param));
            $expires = substr($expires, 0, strpos($expires, ';'));
        } else {
            $expires = '';
        }

        $cookie_param = 'path=';
        $start = strpos($cookie_str, $cookie_param);
        if ( $start > 0 ) {
            $path = substr($cookie_str, $start + strlen($cookie_param));
            $path = substr($path, 0, strpos($path, ';'));
        } else {
            $path = '/';
        }
                        
        $cookie_param = ';secure;';
        if (strpos($cookie_str, $cookie_param) !== FALSE) {
            $secure = true;
        } else {
            $secure = false;
        }

        $sep_pos = strpos($value_str, '=');

        if ($sep_pos) {
            $name = substr($value_str, 0, $sep_pos);
            $value = substr($value_str, $sep_pos + 1);
            $cookie= array( 'name' => $name,
                            'value' => $value,
                            'domain' => $domain,
                            'path' => $path,
                            'expires' => $expires,
                            'secure' => $secure
                            );      
            return $cookie;
        }
        return false;
    }
send ( data,
timeout = 0,
response_timeout = 30,
cookies = NULL 
)

sends the SOAP request and gets the SOAP response via HTTP[S]

Parameters:
string$datamessage data
integer$timeoutset connection timeout in seconds
integer$response_timeoutset response timeout in seconds
array$cookiescookies to send
Returns:
string data public

Definition at line 413 of file class.soap_transport_http.php.

References $data, connect(), nusoap_base::debug(), getResponse(), sendRequest(), and nusoap_base::setError().

Referenced by sendHTTPS().

                                                                          {
        
        $this->debug('entered send() with data of length: '.strlen($data));

        $this->tryagain = true;
        $tries = 0;
        while ($this->tryagain) {
            $this->tryagain = false;
            if ($tries++ < 2) {
                // make connnection
                if (!$this->connect($timeout, $response_timeout)){
                    return false;
                }
                
                // send request
                if (!$this->sendRequest($data, $cookies)){
                    return false;
                }
                
                // get response
                $respdata = $this->getResponse();
            } else {
                $this->setError("Too many tries to get an OK response ($this->response_status_line)");
            }
        }       
        $this->debug('end of send()');
        return $respdata;
    }
send ( data,
timeout = 0,
response_timeout = 30,
cookies = NULL 
)

sends the SOAP request and gets the SOAP response via HTTP[S]

Parameters:
string$datamessage data
integer$timeoutset connection timeout in seconds
integer$response_timeoutset response timeout in seconds
array$cookiescookies to send
Returns:
string data public

Definition at line 2520 of file nusoap.php.

References $data, connect(), nusoap_base::debug(), getResponse(), sendRequest(), and nusoap_base::setError().

                                                                          {
        
        $this->debug('entered send() with data of length: '.strlen($data));

        $this->tryagain = true;
        $tries = 0;
        while ($this->tryagain) {
            $this->tryagain = false;
            if ($tries++ < 2) {
                // make connnection
                if (!$this->connect($timeout, $response_timeout)){
                    return false;
                }
                
                // send request
                if (!$this->sendRequest($data, $cookies)){
                    return false;
                }
                
                // get response
                $respdata = $this->getResponse();
            } else {
                $this->setError("Too many tries to get an OK response ($this->response_status_line)");
            }
        }       
        $this->debug('end of send()');
        return $respdata;
    }
sendHTTPS ( data,
timeout = 0,
response_timeout = 30,
cookies 
)

sends the SOAP request and gets the SOAP response via HTTPS using CURL

Parameters:
string$datamessage data
integer$timeoutset connection timeout in seconds
integer$response_timeoutset response timeout in seconds
array$cookiescookies to send
Returns:
string data public
Deprecated:

Definition at line 454 of file class.soap_transport_http.php.

References $data, and send().

                                                                          {
        return $this->send($data, $timeout, $response_timeout, $cookies);
    }
sendHTTPS ( data,
timeout = 0,
response_timeout = 30,
cookies 
)

sends the SOAP request and gets the SOAP response via HTTPS using CURL

Parameters:
string$datamessage data
integer$timeoutset connection timeout in seconds
integer$response_timeoutset response timeout in seconds
array$cookiescookies to send
Returns:
string data public
Deprecated:

Definition at line 2561 of file nusoap.php.

References $data, and send().

                                                                          {
        return $this->send($data, $timeout, $response_timeout, $cookies);
    }
sendRequest ( data,
cookies = NULL 
)

sends the SOAP request via HTTP[S]

Parameters:
string$datamessage data
array$cookiescookies to send
Returns:
boolean true if OK, false if problem private

Definition at line 735 of file class.soap_transport_http.php.

References $data, buildPayload(), nusoap_base::debug(), getCookiesForRequest(), io_method(), setCurlOption(), and nusoap_base::setError().

Referenced by send().

                                                 {
        // build cookie string
        $cookie_str = $this->getCookiesForRequest($cookies, (($this->scheme == 'ssl') || ($this->scheme == 'https')));

        // build payload
        $this->buildPayload($data, $cookie_str);

      if ($this->io_method() == 'socket') {
        // send payload
        if(!fputs($this->fp, $this->outgoing_payload, strlen($this->outgoing_payload))) {
            $this->setError('couldn\'t write message data to socket');
            $this->debug('couldn\'t write message data to socket');
            return false;
        }
        $this->debug('wrote data to socket, length = ' . strlen($this->outgoing_payload));
        return true;
      } else if ($this->io_method() == 'curl') {
        // set payload
        // cURL does say this should only be the verb, and in fact it
        // turns out that the URI and HTTP version are appended to this, which
        // some servers refuse to work with (so we no longer use this method!)
        //$this->setCurlOption(CURLOPT_CUSTOMREQUEST, $this->outgoing_payload);
        $curl_headers = array();
        foreach($this->outgoing_headers as $k => $v){
            if ($k == 'Connection' || $k == 'Content-Length' || $k == 'Host' || $k == 'Authorization' || $k == 'Proxy-Authorization') {
                $this->debug("Skip cURL header $k: $v");
            } else {
                $curl_headers[] = "$k: $v";
            }
        }
        if ($cookie_str != '') {
            $curl_headers[] = 'Cookie: ' . $cookie_str;
        }
        $this->setCurlOption(CURLOPT_HTTPHEADER, $curl_headers);
        $this->debug('set cURL HTTP headers');
        if ($this->request_method == "POST") {
            $this->setCurlOption(CURLOPT_POST, 1);
            $this->setCurlOption(CURLOPT_POSTFIELDS, $data);
            $this->debug('set cURL POST data');
        } else {
        }
        // insert custom user-set cURL options
        foreach ($this->ch_options as $key => $val) {
            $this->setCurlOption($key, $val);
        }

        $this->debug('set cURL payload');
        return true;
      }
    }
sendRequest ( data,
cookies = NULL 
)

sends the SOAP request via HTTP[S]

Parameters:
string$datamessage data
array$cookiescookies to send
Returns:
boolean true if OK, false if problem private

Definition at line 2842 of file nusoap.php.

References $data, buildPayload(), nusoap_base::debug(), getCookiesForRequest(), io_method(), setCurlOption(), and nusoap_base::setError().

                                                 {
        // build cookie string
        $cookie_str = $this->getCookiesForRequest($cookies, (($this->scheme == 'ssl') || ($this->scheme == 'https')));

        // build payload
        $this->buildPayload($data, $cookie_str);

      if ($this->io_method() == 'socket') {
        // send payload
        if(!fputs($this->fp, $this->outgoing_payload, strlen($this->outgoing_payload))) {
            $this->setError('couldn\'t write message data to socket');
            $this->debug('couldn\'t write message data to socket');
            return false;
        }
        $this->debug('wrote data to socket, length = ' . strlen($this->outgoing_payload));
        return true;
      } else if ($this->io_method() == 'curl') {
        // set payload
        // cURL does say this should only be the verb, and in fact it
        // turns out that the URI and HTTP version are appended to this, which
        // some servers refuse to work with (so we no longer use this method!)
        //$this->setCurlOption(CURLOPT_CUSTOMREQUEST, $this->outgoing_payload);
        $curl_headers = array();
        foreach($this->outgoing_headers as $k => $v){
            if ($k == 'Connection' || $k == 'Content-Length' || $k == 'Host' || $k == 'Authorization' || $k == 'Proxy-Authorization') {
                $this->debug("Skip cURL header $k: $v");
            } else {
                $curl_headers[] = "$k: $v";
            }
        }
        if ($cookie_str != '') {
            $curl_headers[] = 'Cookie: ' . $cookie_str;
        }
        $this->setCurlOption(CURLOPT_HTTPHEADER, $curl_headers);
        $this->debug('set cURL HTTP headers');
        if ($this->request_method == "POST") {
            $this->setCurlOption(CURLOPT_POST, 1);
            $this->setCurlOption(CURLOPT_POSTFIELDS, $data);
            $this->debug('set cURL POST data');
        } else {
        }
        // insert custom user-set cURL options
        foreach ($this->ch_options as $key => $val) {
            $this->setCurlOption($key, $val);
        }

        $this->debug('set cURL payload');
        return true;
      }
    }
setContentType ( type,
charset = false 
)

sets the content-type for the SOAP message to be sent

Parameters:
string$typethe content type, MIME style
mixed$charsetcharacter set used for encoding (or false) public

Definition at line 1170 of file class.soap_transport_http.php.

References $type, and setHeader().

                                                     {
        $this->setHeader('Content-Type', $type . ($charset ? '; charset=' . $charset : ''));
    }
setContentType ( type,
charset = false 
)

sets the content-type for the SOAP message to be sent

Parameters:
string$typethe content type, MIME style
mixed$charsetcharacter set used for encoding (or false) public

Definition at line 3277 of file nusoap.php.

References $type, and setHeader().

                                                     {
        $this->setHeader('Content-Type', $type . ($charset ? '; charset=' . $charset : ''));
    }
setCredentials ( username,
password,
authtype = 'basic',
digestRequest = array(),
certRequest = array() 
)

if authenticating, set user credentials here

Parameters:
string$username
string$password
string$authtype(basic|digest|certificate|ntlm)
array$digestRequest(keys must be nonce, nc, realm, qop)
array$certRequest(keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, certpassword (optional), verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs) public

Definition at line 2575 of file nusoap.php.

References $authtype, $certRequest, $digestRequest, $password, $username, nusoap_base::appendDebug(), nusoap_base::debug(), elseif, setHeader(), and nusoap_base::varDump().

                                                                                                                         {
        $this->debug("setCredentials username=$username authtype=$authtype digestRequest=");
        $this->appendDebug($this->varDump($digestRequest));
        $this->debug("certRequest=");
        $this->appendDebug($this->varDump($certRequest));
        // cf. RFC 2617
        if ($authtype == 'basic') {
            $this->setHeader('Authorization', 'Basic '.base64_encode(str_replace(':','',$username).':'.$password));
        } elseif ($authtype == 'digest') {
            if (isset($digestRequest['nonce'])) {
                $digestRequest['nc'] = isset($digestRequest['nc']) ? $digestRequest['nc']++ : 1;
                
                // calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html)
    
                // A1 = unq(username-value) ":" unq(realm-value) ":" passwd
                $A1 = $username. ':' . (isset($digestRequest['realm']) ? $digestRequest['realm'] : '') . ':' . $password;
    
                // H(A1) = MD5(A1)
                $HA1 = md5($A1);
    
                // A2 = Method ":" digest-uri-value
                $A2 = $this->request_method . ':' . $this->digest_uri;
    
                // H(A2)
                $HA2 =  md5($A2);
    
                // KD(secret, data) = H(concat(secret, ":", data))
                // if qop == auth:
                // request-digest  = <"> < KD ( H(A1),     unq(nonce-value)
                //                              ":" nc-value
                //                              ":" unq(cnonce-value)
                //                              ":" unq(qop-value)
                //                              ":" H(A2)
                //                            ) <">
                // if qop is missing,
                // request-digest  = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <">
    
                $unhashedDigest = '';
                $nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : '';
                $cnonce = $nonce;
                if ($digestRequest['qop'] != '') {
                    $unhashedDigest = $HA1 . ':' . $nonce . ':' . sprintf("%08d", $digestRequest['nc']) . ':' . $cnonce . ':' . $digestRequest['qop'] . ':' . $HA2;
                } else {
                    $unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2;
                }
    
                $hashedDigest = md5($unhashedDigest);
    
                $opaque = '';   
                if (isset($digestRequest['opaque'])) {
                    $opaque = ', opaque="' . $digestRequest['opaque'] . '"';
                }

                $this->setHeader('Authorization', 'Digest username="' . $username . '", realm="' . $digestRequest['realm'] . '", nonce="' . $nonce . '", uri="' . $this->digest_uri . $opaque . '", cnonce="' . $cnonce . '", nc=' . sprintf("%08x", $digestRequest['nc']) . ', qop="' . $digestRequest['qop'] . '", response="' . $hashedDigest . '"');
            }
        } elseif ($authtype == 'certificate') {
            $this->certRequest = $certRequest;
            $this->debug('Authorization header not set for certificate');
        } elseif ($authtype == 'ntlm') {
            // do nothing
            $this->debug('Authorization header not set for ntlm');
        }
        $this->username = $username;
        $this->password = $password;
        $this->authtype = $authtype;
        $this->digestRequest = $digestRequest;
    }
setCredentials ( username,
password,
authtype = 'basic',
digestRequest = array(),
certRequest = array() 
)

if authenticating, set user credentials here

Parameters:
string$username
string$password
string$authtype(basic|digest|certificate|ntlm)
array$digestRequest(keys must be nonce, nc, realm, qop)
array$certRequest(keys must be cainfofile (optional), sslcertfile, sslkeyfile, passphrase, certpassword (optional), verifypeer (optional), verifyhost (optional): see corresponding options in cURL docs) public

Definition at line 468 of file class.soap_transport_http.php.

References $authtype, $certRequest, $digestRequest, $password, $username, nusoap_base::appendDebug(), nusoap_base::debug(), elseif, setHeader(), and nusoap_base::varDump().

Referenced by getResponse(), and setURL().

                                                                                                                         {
        $this->debug("setCredentials username=$username authtype=$authtype digestRequest=");
        $this->appendDebug($this->varDump($digestRequest));
        $this->debug("certRequest=");
        $this->appendDebug($this->varDump($certRequest));
        // cf. RFC 2617
        if ($authtype == 'basic') {
            $this->setHeader('Authorization', 'Basic '.base64_encode(str_replace(':','',$username).':'.$password));
        } elseif ($authtype == 'digest') {
            if (isset($digestRequest['nonce'])) {
                $digestRequest['nc'] = isset($digestRequest['nc']) ? $digestRequest['nc']++ : 1;
                
                // calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html)
    
                // A1 = unq(username-value) ":" unq(realm-value) ":" passwd
                $A1 = $username. ':' . (isset($digestRequest['realm']) ? $digestRequest['realm'] : '') . ':' . $password;
    
                // H(A1) = MD5(A1)
                $HA1 = md5($A1);
    
                // A2 = Method ":" digest-uri-value
                $A2 = $this->request_method . ':' . $this->digest_uri;
    
                // H(A2)
                $HA2 =  md5($A2);
    
                // KD(secret, data) = H(concat(secret, ":", data))
                // if qop == auth:
                // request-digest  = <"> < KD ( H(A1),     unq(nonce-value)
                //                              ":" nc-value
                //                              ":" unq(cnonce-value)
                //                              ":" unq(qop-value)
                //                              ":" H(A2)
                //                            ) <">
                // if qop is missing,
                // request-digest  = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <">
    
                $unhashedDigest = '';
                $nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : '';
                $cnonce = $nonce;
                if ($digestRequest['qop'] != '') {
                    $unhashedDigest = $HA1 . ':' . $nonce . ':' . sprintf("%08d", $digestRequest['nc']) . ':' . $cnonce . ':' . $digestRequest['qop'] . ':' . $HA2;
                } else {
                    $unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2;
                }
    
                $hashedDigest = md5($unhashedDigest);
    
                $opaque = '';   
                if (isset($digestRequest['opaque'])) {
                    $opaque = ', opaque="' . $digestRequest['opaque'] . '"';
                }

                $this->setHeader('Authorization', 'Digest username="' . $username . '", realm="' . $digestRequest['realm'] . '", nonce="' . $nonce . '", uri="' . $this->digest_uri . $opaque . '", cnonce="' . $cnonce . '", nc=' . sprintf("%08x", $digestRequest['nc']) . ', qop="' . $digestRequest['qop'] . '", response="' . $hashedDigest . '"');
            }
        } elseif ($authtype == 'certificate') {
            $this->certRequest = $certRequest;
            $this->debug('Authorization header not set for certificate');
        } elseif ($authtype == 'ntlm') {
            // do nothing
            $this->debug('Authorization header not set for ntlm');
        }
        $this->username = $username;
        $this->password = $password;
        $this->authtype = $authtype;
        $this->digestRequest = $digestRequest;
    }
setCurlOption ( option,
value 
)

sets a cURL option

Parameters:
mixed$optionThe cURL option (always integer?)
mixed$valueThe cURL option value private

Definition at line 2187 of file nusoap.php.

References nusoap_base::appendDebug(), nusoap_base::debug(), and nusoap_base::varDump().

                                            {
        $this->debug("setCurlOption option=$option, value=");
        $this->appendDebug($this->varDump($value));
        curl_setopt($this->ch, $option, $value);
    }
setCurlOption ( option,
value 
)

sets a cURL option

Parameters:
mixed$optionThe cURL option (always integer?)
mixed$valueThe cURL option value private

Definition at line 80 of file class.soap_transport_http.php.

References nusoap_base::appendDebug(), nusoap_base::debug(), and nusoap_base::varDump().

Referenced by connect(), and sendRequest().

                                            {
        $this->debug("setCurlOption option=$option, value=");
        $this->appendDebug($this->varDump($value));
        curl_setopt($this->ch, $option, $value);
    }
setEncoding ( enc = 'gzip,
deflate'   
)

use http encoding

Parameters:
string$encencoding style. supported values: gzip, deflate, or both public

Definition at line 552 of file class.soap_transport_http.php.

References setHeader().

                                               {
        if (function_exists('gzdeflate')) {
            $this->protocol_version = '1.1';
            $this->setHeader('Accept-Encoding', $enc);
            if (!isset($this->outgoing_headers['Connection'])) {
                $this->setHeader('Connection', 'close');
                $this->persistentConnection = false;
            }
            set_magic_quotes_runtime(0);
            // deprecated
            $this->encoding = $enc;
        }
    }
setEncoding ( enc = 'gzip,
deflate'   
)

use http encoding

Parameters:
string$encencoding style. supported values: gzip, deflate, or both public

Definition at line 2659 of file nusoap.php.

References setHeader().

                                               {
        if (function_exists('gzdeflate')) {
            $this->protocol_version = '1.1';
            $this->setHeader('Accept-Encoding', $enc);
            if (!isset($this->outgoing_headers['Connection'])) {
                $this->setHeader('Connection', 'close');
                $this->persistentConnection = false;
            }
            set_magic_quotes_runtime(0);
            // deprecated
            $this->encoding = $enc;
        }
    }
setHeader ( name,
value 
)

sets an HTTP header

Parameters:
string$nameThe name of the header
string$valueThe value of the header private

Definition at line 2200 of file nusoap.php.

References nusoap_base::debug().

                                      {
        $this->outgoing_headers[$name] = $value;
        $this->debug("set header $name: $value");
    }
setHeader ( name,
value 
)

sets an HTTP header

Parameters:
string$nameThe name of the header
string$valueThe value of the header private

Definition at line 93 of file class.soap_transport_http.php.

References nusoap_base::debug().

Referenced by buildPayload(), connect(), setContentType(), setCredentials(), setEncoding(), setProxy(), setSOAPAction(), setURL(), soap_transport_http(), and usePersistentConnection().

                                      {
        $this->outgoing_headers[$name] = $value;
        $this->debug("set header $name: $value");
    }
setProxy ( proxyhost,
proxyport,
proxyusername = '',
proxypassword = '',
proxyauthtype = 'basic' 
)

set proxy info here

Parameters:
string$proxyhostuse an empty string to remove proxy
string$proxyport
string$proxyusername
string$proxypassword
string$proxyauthtype(basic|ntlm) public

Definition at line 2683 of file nusoap.php.

References $proxy, nusoap_base::debug(), setHeader(), and unsetHeader().

                                                                                                                  {
        if ($proxyhost) {
            $this->proxy = array(
                'host' => $proxyhost,
                'port' => $proxyport,
                'username' => $proxyusername,
                'password' => $proxypassword,
                'authtype' => $proxyauthtype
            );
            if ($proxyusername != '' && $proxypassword != '' && $proxyauthtype = 'basic') {
                $this->setHeader('Proxy-Authorization', ' Basic '.base64_encode($proxyusername.':'.$proxypassword));
            }
        } else {
            $this->debug('remove proxy');
            $proxy = null;
            unsetHeader('Proxy-Authorization');
        }
    }
setProxy ( proxyhost,
proxyport,
proxyusername = '',
proxypassword = '',
proxyauthtype = 'basic' 
)

set proxy info here

Parameters:
string$proxyhostuse an empty string to remove proxy
string$proxyport
string$proxyusername
string$proxypassword
string$proxyauthtype(basic|ntlm) public

Definition at line 576 of file class.soap_transport_http.php.

References $proxy, nusoap_base::debug(), setHeader(), and unsetHeader().

                                                                                                                  {
        if ($proxyhost) {
            $this->proxy = array(
                'host' => $proxyhost,
                'port' => $proxyport,
                'username' => $proxyusername,
                'password' => $proxypassword,
                'authtype' => $proxyauthtype
            );
            if ($proxyusername != '' && $proxypassword != '' && $proxyauthtype = 'basic') {
                $this->setHeader('Proxy-Authorization', ' Basic '.base64_encode($proxyusername.':'.$proxypassword));
            }
        } else {
            $this->debug('remove proxy');
            $proxy = null;
            unsetHeader('Proxy-Authorization');
        }
    }
setSOAPAction ( soapaction)

set the soapaction value

Parameters:
string$soapactionpublic

Definition at line 542 of file class.soap_transport_http.php.

References setHeader().

                                        {
        $this->setHeader('SOAPAction', '"' . $soapaction . '"');
    }
setSOAPAction ( soapaction)

set the soapaction value

Parameters:
string$soapactionpublic

Definition at line 2649 of file nusoap.php.

References setHeader().

                                        {
        $this->setHeader('SOAPAction', '"' . $soapaction . '"');
    }
setURL ( url)

sets the URL to which to connect

Parameters:
string$urlThe URL to which to connect private

Definition at line 2224 of file nusoap.php.

References $url, nusoap_base::debug(), setCredentials(), and setHeader().

                          {
        $this->url = $url;

        $u = parse_url($url);
        foreach($u as $k => $v){
            $this->debug("parsed URL $k = $v");
            $this->$k = $v;
        }
        
        // add any GET params to path
        if(isset($u['query']) && $u['query'] != ''){
            $this->path .= '?' . $u['query'];
        }
        
        // set default port
        if(!isset($u['port'])){
            if($u['scheme'] == 'https'){
                $this->port = 443;
            } else {
                $this->port = 80;
            }
        }
        
        $this->uri = $this->path;
        $this->digest_uri = $this->uri;
        
        // build headers
        if (!isset($u['port'])) {
            $this->setHeader('Host', $this->host);
        } else {
            $this->setHeader('Host', $this->host.':'.$this->port);
        }

        if (isset($u['user']) && $u['user'] != '') {
            $this->setCredentials(urldecode($u['user']), isset($u['pass']) ? urldecode($u['pass']) : '');
        }
    }
setURL ( url)

sets the URL to which to connect

Parameters:
string$urlThe URL to which to connect private

Definition at line 117 of file class.soap_transport_http.php.

References $url, nusoap_base::debug(), setCredentials(), and setHeader().

Referenced by getResponse(), and soap_transport_http().

                          {
        $this->url = $url;

        $u = parse_url($url);
        foreach($u as $k => $v){
            $this->debug("parsed URL $k = $v");
            $this->$k = $v;
        }
        
        // add any GET params to path
        if(isset($u['query']) && $u['query'] != ''){
            $this->path .= '?' . $u['query'];
        }
        
        // set default port
        if(!isset($u['port'])){
            if($u['scheme'] == 'https'){
                $this->port = 443;
            } else {
                $this->port = 80;
            }
        }
        
        $this->uri = $this->path;
        $this->digest_uri = $this->uri;
        
        // build headers
        if (!isset($u['port'])) {
            $this->setHeader('Host', $this->host);
        } else {
            $this->setHeader('Host', $this->host.':'.$this->port);
        }

        if (isset($u['user']) && $u['user'] != '') {
            $this->setCredentials(urldecode($u['user']), isset($u['pass']) ? urldecode($u['pass']) : '');
        }
    }
soap_transport_http ( url,
curl_options = NULL,
use_curl = false 
)

constructor

Parameters:
string$urlThe URL to which to connect
array$curl_optionsUser-specified cURL options
boolean$use_curlWhether to try to force cURL use public

Definition at line 60 of file class.soap_transport_http.php.

References $url, $use_curl, nusoap_base::appendDebug(), nusoap_base::debug(), nusoap_base::nusoap_base(), setHeader(), setURL(), title, and nusoap_base::varDump().

                                                                               {
        parent::nusoap_base();
        $this->debug("ctor url=$url use_curl=$use_curl curl_options:");
        $this->appendDebug($this->varDump($curl_options));
        $this->setURL($url);
        if (is_array($curl_options)) {
            $this->ch_options = $curl_options;
        }
        $this->use_curl = $use_curl;
        ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
        $this->setHeader('User-Agent', $this->title.'/'.$this->version.' ('.$rev[1].')');
    }
soap_transport_http ( url,
curl_options = NULL,
use_curl = false 
)

constructor

Parameters:
string$urlThe URL to which to connect
array$curl_optionsUser-specified cURL options
boolean$use_curlWhether to try to force cURL use public

Definition at line 2167 of file nusoap.php.

References $url, $use_curl, nusoap_base::appendDebug(), nusoap_base::debug(), nusoap_base::nusoap_base(), setHeader(), setURL(), title, and nusoap_base::varDump().

                                                                               {
        parent::nusoap_base();
        $this->debug("ctor url=$url use_curl=$use_curl curl_options:");
        $this->appendDebug($this->varDump($curl_options));
        $this->setURL($url);
        if (is_array($curl_options)) {
            $this->ch_options = $curl_options;
        }
        $this->use_curl = $use_curl;
        ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
        $this->setHeader('User-Agent', $this->title.'/'.$this->version.' ('.$rev[1].')');
    }
unsetHeader ( name)

unsets an HTTP header

Parameters:
string$nameThe name of the header private

Definition at line 2211 of file nusoap.php.

References nusoap_base::debug().

                                {
        if (isset($this->outgoing_headers[$name])) {
            $this->debug("unset header $name");
            unset($this->outgoing_headers[$name]);
        }
    }
unsetHeader ( name)

unsets an HTTP header

Parameters:
string$nameThe name of the header private

Definition at line 104 of file class.soap_transport_http.php.

References nusoap_base::debug().

Referenced by setProxy().

                                {
        if (isset($this->outgoing_headers[$name])) {
            $this->debug("unset header $name");
            unset($this->outgoing_headers[$name]);
        }
    }
usePersistentConnection ( )

specifies that an HTTP persistent connection should be used

Returns:
boolean whether the request was honored by this method. public

Definition at line 3287 of file nusoap.php.

References setHeader().

                                      {
        if (isset($this->outgoing_headers['Accept-Encoding'])) {
            return false;
        }
        $this->protocol_version = '1.1';
        $this->persistentConnection = true;
        $this->setHeader('Connection', 'Keep-Alive');
        return true;
    }
usePersistentConnection ( )

specifies that an HTTP persistent connection should be used

Returns:
boolean whether the request was honored by this method. public

Definition at line 1180 of file class.soap_transport_http.php.

References setHeader().

                                      {
        if (isset($this->outgoing_headers['Accept-Encoding'])) {
            return false;
        }
        $this->protocol_version = '1.1';
        $this->persistentConnection = true;
        $this->setHeader('Connection', 'Keep-Alive');
        return true;
    }

Field Documentation

$authtype = ''

Definition at line 41 of file class.soap_transport_http.php.

Referenced by setCredentials().

$certRequest = array()

Definition at line 43 of file class.soap_transport_http.php.

Referenced by setCredentials().

$ch = false

Definition at line 35 of file class.soap_transport_http.php.

$ch_options = array()

Definition at line 36 of file class.soap_transport_http.php.

$digest_uri = ''

Definition at line 19 of file class.soap_transport_http.php.

$digestRequest = array()

Definition at line 42 of file class.soap_transport_http.php.

Referenced by getResponse(), and setCredentials().

$encoding = ''

Definition at line 26 of file class.soap_transport_http.php.

$host = ''

Definition at line 21 of file class.soap_transport_http.php.

Referenced by connect().

$incoming_cookies = array()

Definition at line 29 of file class.soap_transport_http.php.

$incoming_headers = array()

Definition at line 28 of file class.soap_transport_http.php.

$incoming_payload = ''

Definition at line 31 of file class.soap_transport_http.php.

$outgoing_headers = array()

Definition at line 27 of file class.soap_transport_http.php.

$outgoing_payload = ''

Definition at line 30 of file class.soap_transport_http.php.

$password = ''

Definition at line 40 of file class.soap_transport_http.php.

Referenced by setCredentials().

$path = ''

Definition at line 23 of file class.soap_transport_http.php.

Referenced by getCookiesForRequest(), and parseCookie().

$persistentConnection = false

Definition at line 34 of file class.soap_transport_http.php.

$port = ''

Definition at line 22 of file class.soap_transport_http.php.

Referenced by connect().

$protocol_version = '1.0'

Definition at line 25 of file class.soap_transport_http.php.

$proxy = null

Definition at line 38 of file class.soap_transport_http.php.

Referenced by setProxy().

$request_method = 'POST'

Definition at line 24 of file class.soap_transport_http.php.

$response_status_line

Definition at line 32 of file class.soap_transport_http.php.

$scheme = ''

Definition at line 20 of file class.soap_transport_http.php.

$uri = ''

Definition at line 18 of file class.soap_transport_http.php.

Referenced by buildPayload().

$url = ''

Definition at line 17 of file class.soap_transport_http.php.

Referenced by setURL(), and soap_transport_http().

$use_curl = false

Definition at line 37 of file class.soap_transport_http.php.

Referenced by soap_transport_http().

$username = ''

Definition at line 39 of file class.soap_transport_http.php.

Referenced by setCredentials().

$useSOAPAction = true

Definition at line 33 of file class.soap_transport_http.php.


The documentation for this class was generated from the following files: