You are here

function soap_server::parse_request in Salesforce Suite 5

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

* parses a request * * The following fields are set by this function (when successful) * * headers * request * xml_encoding * SOAPAction * request * requestSOAP * methodURI * methodname * methodparams * requestHeaders * document * * This sets the fault field on error * *

Parameters

string $data XML string: * @access private

2 calls to soap_server::parse_request()
soap_server::service in includes/nusoap.php
* processes request and returns response * *
soap_server::service in includes/nusoap.orig.php
* processes request and returns response * *

File

includes/nusoap.php, line 3444

Class

soap_server
soap_server allows the user to create a SOAP server that is capable of receiving messages and returning responses

Code

function parse_request($data = '') {
  $this
    ->debug('entering parse_request()');
  $this
    ->parse_http_headers();
  $this
    ->debug('got character encoding: ' . $this->xml_encoding);

  // uncompress if necessary
  if (isset($this->headers['content-encoding']) && $this->headers['content-encoding'] != '') {
    $this
      ->debug('got content encoding: ' . $this->headers['content-encoding']);
    if ($this->headers['content-encoding'] == 'deflate' || $this->headers['content-encoding'] == 'gzip') {

      // if decoding works, use it. else assume data wasn't gzencoded
      if (function_exists('gzuncompress')) {
        if ($this->headers['content-encoding'] == 'deflate' && ($degzdata = @gzuncompress($data))) {
          $data = $degzdata;
        }
        elseif ($this->headers['content-encoding'] == 'gzip' && ($degzdata = gzinflate(substr($data, 10)))) {
          $data = $degzdata;
        }
        else {
          $this
            ->fault('Client', 'Errors occurred when trying to decode the data');
          return;
        }
      }
      else {
        $this
          ->fault('Client', 'This Server does not support compressed data');
        return;
      }
    }
  }
  $this->request .= "\r\n" . $data;
  $data = $this
    ->parseRequest($this->headers, $data);
  $this->requestSOAP = $data;
  $this
    ->debug('leaving parse_request');
}