You are here

function soap_transport_http::setURL in Salesforce Suite 5.2

Same name in this branch
  1. 5.2 includes/nusoap.php \soap_transport_http::setURL()
  2. 5.2 includes/nusoap.orig.php \soap_transport_http::setURL()
Same name and namespace in other branches
  1. 5 includes/nusoap.php \soap_transport_http::setURL()
  2. 5 includes/nusoap.orig.php \soap_transport_http::setURL()
4 calls to soap_transport_http::setURL()
soap_transport_http::getResponse in includes/nusoap.php
soap_transport_http::getResponse in includes/nusoap.orig.php
soap_transport_http::soap_transport_http in includes/nusoap.php
* constructor
soap_transport_http::soap_transport_http in includes/nusoap.orig.php
* constructor

File

includes/nusoap.orig.php, line 2043

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 setURL($url) {
  $this->url = $url;
  $u = parse_url($url);
  foreach ($u as $k => $v) {
    $this
      ->debug("{$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->outgoing_headers['Host'] = $this->host;
  }
  else {
    $this->outgoing_headers['Host'] = $this->host . ':' . $this->port;
  }
  $this
    ->debug('set Host: ' . $this->outgoing_headers['Host']);
  if (isset($u['user']) && $u['user'] != '') {
    $this
      ->setCredentials(urldecode($u['user']), isset($u['pass']) ? urldecode($u['pass']) : '');
  }
}