You are here

function soap_transport_http::send in Salesforce Suite 5.2

Same name in this branch
  1. 5.2 includes/nusoap.php \soap_transport_http::send()
  2. 5.2 includes/nusoap.orig.php \soap_transport_http::send()
Same name and namespace in other branches
  1. 5 includes/nusoap.php \soap_transport_http::send()
  2. 5 includes/nusoap.orig.php \soap_transport_http::send()

* send the SOAP message via HTTP * *

Parameters

string $data message data: * @param integer $timeout set connection timeout in seconds * @param integer $response_timeout set response timeout in seconds * @param array $cookies cookies to send * @return string data * @access public

2 calls to soap_transport_http::send()
soap_transport_http::sendHTTPS in includes/nusoap.php
* send the SOAP message via HTTPS 1.0 using CURL * *
soap_transport_http::sendHTTPS in includes/nusoap.orig.php
* send the SOAP message via HTTPS 1.0 using CURL * *

File

includes/nusoap.php, line 2242

Class

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

Code

function send($data, $timeout = 0, $response_timeout = 30, $cookies = NULL) {
  $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
    ->debug('end of send()');
  return $respdata;
}