--- /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/github_class.nusoap_base.php +++ /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/client_class.nusoap_base.php @@ -219,7 +219,7 @@ * * @access public */ - function __construct() { + function nusoap_base() { $this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel']; } --- /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/github_class.soap_fault.php +++ /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/client_class.soap_fault.php @@ -44,8 +44,8 @@ * @param string $faultstring human readable error message * @param mixed $faultdetail detail, typically a string or array of string */ - function __construct($faultcode,$faultactor='',$faultstring='',$faultdetail=''){ - parent::__construct(); + function nusoap_fault($faultcode,$faultactor='',$faultstring='',$faultdetail=''){ + parent::nusoap_base(); $this->faultcode = $faultcode; $this->faultactor = $faultactor; $this->faultstring = $faultstring; --- /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/github_class.soap_parser.php +++ /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/client_class.soap_parser.php @@ -56,8 +56,8 @@ * @param string $decode_utf8 whether to decode UTF-8 to ISO-8859-1 * @access public */ - function __construct($xml,$encoding='UTF-8',$method='',$decode_utf8=true){ - parent::__construct(); + function nusoap_parser($xml,$encoding='UTF-8',$method='',$decode_utf8=true){ + parent::nusoap_base(); $this->xml = $xml; $this->xml_encoding = $encoding; $this->method = $method; @@ -316,7 +316,7 @@ // get unqualified name $name = substr(strstr($name,':'),1); } - + // build to native type if(isset($this->body_position) && $pos > $this->body_position){ // deal w/ multirefs @@ -378,7 +378,7 @@ */ } } - + // for doclit if($this->status == 'header'){ if ($this->root_header != $pos) { --- /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/github_class.soap_server.php +++ /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/client_class.soap_server.php @@ -169,8 +169,8 @@ * @param mixed $wsdl file path or URL (string), or wsdl instance (object) * @access public */ - function __construct($wsdl=false){ - parent::__construct(); + function nusoap_server($wsdl=false){ + parent::nusoap_base(); // turn on debugging? global $debug; global $HTTP_SERVER_VARS; @@ -776,7 +776,7 @@ //begin code to compress payload - by John // NOTE: there is no way to know whether the Web server will also compress // this data. - if (strlen($payload) > 1024 && isset($this->headers) && isset($this->headers['accept-encoding'])) { + if (strlen($payload) > 1024 && isset($this->headers) && isset($this->headers['accept-encoding'])) { if (strstr($this->headers['accept-encoding'], 'gzip')) { if (function_exists('gzencode')) { if (isset($this->debug_flag) && $this->debug_flag) { @@ -903,7 +903,7 @@ function getHTTPBody($soapmsg) { return $soapmsg; } - + /** * gets the HTTP content type for the current response. * @@ -915,7 +915,7 @@ function getHTTPContentType() { return 'text/xml'; } - + /** * gets the HTTP content type charset for the current response. * returns false for non-text content types. @@ -1074,7 +1074,7 @@ if(false == $namespace) { $namespace = "http://$SERVER_NAME/soap/$serviceName"; } - + if(false == $endpoint) { if ($HTTPS == '1' || $HTTPS == 'on') { $SCHEME = 'https'; @@ -1083,11 +1083,11 @@ } $endpoint = "$SCHEME://$SERVER_NAME$SERVER_PORT$SCRIPT_NAME"; } - + if(false == $schemaTargetNamespace) { $schemaTargetNamespace = $namespace; } - + $this->wsdl = new wsdl; $this->wsdl->serviceName = $serviceName; $this->wsdl->endpoint = $endpoint; --- /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/github_class.soap_transport_http.php +++ /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/client_class.soap_transport_http.php @@ -56,8 +56,8 @@ * @param boolean $use_curl Whether to try to force cURL use * @access public */ - function __construct($url, $curl_options = NULL, $use_curl = false){ - parent::__construct(); + function soap_transport_http($url, $curl_options = NULL, $use_curl = false){ + parent::nusoap_base(); $this->debug("ctor url=$url use_curl=$use_curl curl_options:"); $this->appendDebug($this->varDump($curl_options)); $this->setURL($url); @@ -121,12 +121,12 @@ $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'){ @@ -135,10 +135,10 @@ $this->port = 80; } } - + $this->uri = $this->path; $this->digest_uri = $this->uri; - + // build headers if (!isset($u['port'])) { $this->setHeader('Host', $this->host); @@ -218,7 +218,7 @@ } 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; @@ -231,7 +231,7 @@ $this->setError($msg); return false; } - + // set response timeout $this->debug('set response timeout to ' . $response_timeout); socket_set_timeout( $this->fp, $response_timeout); @@ -320,10 +320,10 @@ // 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_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'); @@ -410,7 +410,7 @@ * @access public */ function send($data, $timeout=0, $response_timeout=30, $cookies=NULL) { - + $this->debug('entered send() with data of length: '.strlen($data)); $this->tryagain = true; @@ -422,18 +422,18 @@ 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; } @@ -453,7 +453,7 @@ function sendHTTPS($data, $timeout=0, $response_timeout=30, $cookies) { return $this->send($data, $timeout, $response_timeout, $cookies); } - + /** * if authenticating, set user credentials here * @@ -475,21 +475,21 @@ } 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) @@ -500,7 +500,7 @@ // ) <"> // if qop is missing, // request-digest = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <"> - + $unhashedDigest = ''; $nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : ''; $cnonce = $nonce; @@ -509,10 +509,10 @@ } else { $unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2; } - + $hashedDigest = md5($unhashedDigest); - - $opaque = ''; + + $opaque = ''; if (isset($digestRequest['opaque'])) { $opaque = ', opaque="' . $digestRequest['opaque'] . '"'; } @@ -531,7 +531,7 @@ $this->authtype = $authtype; $this->digestRequest = $digestRequest; } - + /** * set the soapaction value * @@ -541,7 +541,7 @@ function setSOAPAction($soapaction) { $this->setHeader('SOAPAction', '"' . $soapaction . '"'); } - + /** * use http encoding * @@ -561,7 +561,7 @@ $this->encoding = $enc; } } - + /** * set proxy info here * @@ -590,7 +590,7 @@ unsetHeader('Proxy-Authorization'); } } - + /** * Test if the given string starts with a header that is to be skipped. @@ -631,7 +631,7 @@ // length := 0 $length = 0; $new = ''; - + // read chunk-size, chunk-extension (if any) and CRLF // get the position of the linebreak $chunkend = strpos($buffer, $lb); @@ -646,7 +646,7 @@ 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); @@ -655,7 +655,7 @@ $length += strlen($chunk); break; } - + // read chunk-data and CRLF $chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart); // append chunk-data to entity-body @@ -664,7 +664,7 @@ $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 @@ -675,7 +675,7 @@ } return $new; } - + /** * Writes the payload, including HTTP headers, to $this->outgoing_payload. * @@ -720,7 +720,7 @@ // header/body separator $this->outgoing_payload .= "\r\n"; - + // add data $this->outgoing_payload .= $data; } @@ -792,7 +792,7 @@ */ function getResponse(){ $this->incoming_payload = ''; - + if ($this->io_method() == 'socket') { // loop until headers have been retrieved $data = ''; @@ -863,7 +863,7 @@ $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 @@ -929,22 +929,22 @@ $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') || + (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)){ @@ -955,7 +955,7 @@ // 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'); @@ -981,7 +981,7 @@ // close curl $this->debug('No cURL error, closing cURL'); curl_close($this->ch); - + // try removing skippable headers $savedata = $data; while ($this->isSkippableCurlHeader($data)) { @@ -1004,7 +1004,7 @@ } } } - + // separate content from HTTP headers if ($pos = strpos($data,"\r\n\r\n")) { $lb = "\r\n"; @@ -1064,7 +1064,7 @@ $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) { @@ -1083,7 +1083,7 @@ $this->setError('HTTP authentication failed'); return false; } - + if ( ($http_status >= 300 && $http_status <= 307) || ($http_status >= 400 && $http_status <= 417) || @@ -1151,13 +1151,13 @@ } 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; } @@ -1229,7 +1229,7 @@ } else { $path = '/'; } - + $cookie_param = ';secure;'; if (strpos($cookie_str, $cookie_param) !== FALSE) { $secure = true; @@ -1248,12 +1248,12 @@ 'path' => $path, 'expires' => $expires, 'secure' => $secure - ); + ); return $cookie; } return false; } - + /** * sort out cookies for the current request * --- /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/github_class.soap_val.php +++ /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/client_class.soap_val.php @@ -68,8 +68,8 @@ * @param mixed $attributes associative array of attributes to add to element serialization * @access public */ - function __construct($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) { - parent::__construct(); + function soapval($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) { + parent::nusoap_base(); $this->name = $name; $this->type = $type; $this->value = $value; --- /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/github_class.soapclient.php +++ /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/client_class.soapclient.php @@ -94,8 +94,8 @@ * @param string $portName optional portName in WSDL document * @access public */ - function __construct($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30, $portName = ''){ - parent::__construct(); + function nusoap_client($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30, $portName = ''){ + parent::nusoap_base(); $this->endpoint = $endpoint; $this->proxyhost = $proxyhost; $this->proxyport = $proxyport; @@ -163,7 +163,7 @@ $this->faultstring = ''; $this->faultcode = ''; $this->opData = array(); - + $this->debug("call: operation=$operation, namespace=$namespace, soapAction=$soapAction, rpcParams=$rpcParams, style=$style, use=$use, endpointType=$this->endpointType"); $this->appendDebug('params=' . $this->varDump($params)); $this->appendDebug('headers=' . $this->varDump($headers)); @@ -234,7 +234,7 @@ // no WSDL //$this->namespaces['ns1'] = $namespace; $nsPrefix = 'ns' . rand(1000, 9999); - // serialize + // serialize $payload = ''; if (is_string($params)) { $this->debug("serializing param string for operation $operation"); @@ -294,7 +294,7 @@ $this->return = $return; $this->debug('sent message successfully and got a(n) '.gettype($return)); $this->appendDebug('return=' . $this->varDump($return)); - + // fault? if(is_array($return) && isset($return['faultcode'])){ $this->debug('got fault'); @@ -463,7 +463,7 @@ $this->persistentConnection = $http; } } - + if($err = $http->getError()){ $this->setError('HTTP Error: '.$err); return false; @@ -627,7 +627,7 @@ $this->authtype = $authtype; $this->certRequest = $certRequest; } - + /** * use HTTP encoding * @@ -638,7 +638,7 @@ $this->debug("setHTTPEncoding(\"$enc\")"); $this->http_encoding = $enc; } - + /** * Set whether to try to use cURL connections if possible * @@ -659,7 +659,7 @@ $this->debug("useHTTPPersistentConnection"); $this->persistentConnection = true; } - + /** * gets the default RPC parameter setting. * If true, default is that call params are like RPC even for document style. @@ -689,7 +689,7 @@ function setDefaultRpcParams($rpcParams) { $this->defaultRpcParams = $rpcParams; } - + /** * dynamically creates an instance of a proxy class, * allowing user to directly call methods from wsdl @@ -819,7 +819,7 @@ function getHTTPBody($soapmsg) { return $soapmsg; } - + /** * gets the HTTP content type for the current request. * @@ -831,7 +831,7 @@ function getHTTPContentType() { return 'text/xml'; } - + /** * gets the HTTP content type charset for the current request. * returns false for non-text content types. --- /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/github_class.wsdl.php +++ /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/client_class.wsdl.php @@ -6,14 +6,14 @@ /** * parses a WSDL file, allows access to it's data, other utility methods. * also builds WSDL structures programmatically. -* +* * @author Dietrich Ayala * @author Scott Nichol -* @access public +* @access public */ class wsdl extends nusoap_base { // URL or filename of the root of this WSDL - var $wsdl; + var $wsdl; // define internal arrays of bindings, ports, operations, messages, etc. var $schemas = array(); var $currentSchema; @@ -31,9 +31,9 @@ var $opData = array(); var $status = ''; var $documentation = false; - var $endpoint = ''; + var $endpoint = ''; // array of wsdl docs to import - var $import = array(); + var $import = array(); // parser vars var $parser; var $position = 0; @@ -56,7 +56,7 @@ /** * constructor - * + * * @param string $wsdl WSDL document URL * @param string $proxyhost * @param string $proxyport @@ -66,10 +66,10 @@ * @param integer $response_timeout set the response timeout * @param array $curl_options user-specified cURL options * @param boolean $use_curl try to use cURL - * @access public + * @access public */ - function __construct($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){ - parent::__construct(); + function wsdl($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){ + parent::nusoap_base(); $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout"); $this->proxyhost = $proxyhost; $this->proxyport = $proxyport; @@ -126,7 +126,7 @@ } } } - } + } } } // WSDL imports @@ -152,18 +152,18 @@ } } } - } + } } // add new data to operation data foreach($this->bindings as $binding => $bindingData) { if (isset($bindingData['operations']) && is_array($bindingData['operations'])) { foreach($bindingData['operations'] as $operation => $data) { $this->debug('post-parse data gathering for ' . $operation); - $this->bindings[$binding]['operations'][$operation]['input'] = - isset($this->bindings[$binding]['operations'][$operation]['input']) ? + $this->bindings[$binding]['operations'][$operation]['input'] = + isset($this->bindings[$binding]['operations'][$operation]['input']) ? array_merge($this->bindings[$binding]['operations'][$operation]['input'], $this->portTypes[ $bindingData['portType'] ][$operation]['input']) : $this->portTypes[ $bindingData['portType'] ][$operation]['input']; - $this->bindings[$binding]['operations'][$operation]['output'] = + $this->bindings[$binding]['operations'][$operation]['output'] = isset($this->bindings[$binding]['operations'][$operation]['output']) ? array_merge($this->bindings[$binding]['operations'][$operation]['output'], $this->portTypes[ $bindingData['portType'] ][$operation]['output']) : $this->portTypes[ $bindingData['portType'] ][$operation]['output']; @@ -180,16 +180,16 @@ $this->bindings[$binding]['operations'][$operation]['transport'] = isset($bindingData['transport']) ? $bindingData['transport'] : ''; $this->bindings[$binding]['operations'][$operation]['documentation'] = isset($this->portTypes[ $bindingData['portType'] ][$operation]['documentation']) ? $this->portTypes[ $bindingData['portType'] ][$operation]['documentation'] : ''; $this->bindings[$binding]['operations'][$operation]['endpoint'] = isset($bindingData['endpoint']) ? $bindingData['endpoint'] : ''; - } - } + } + } } } /** * parses the wsdl document - * + * * @param string $wsdl path or URL - * @access private + * @access private */ function parseWSDL($wsdl = '') { $this->debug("parse WSDL at path=$wsdl"); @@ -199,7 +199,7 @@ $this->setError('no wsdl passed to parseWSDL()!!'); return false; } - + // parse $wsdl for url format $wsdl_props = parse_url($wsdl); @@ -242,24 +242,24 @@ $wsdl_string = ''; while ($data = fread($fp, 32768)) { $wsdl_string .= $data; - } + } fclose($fp); } else { $errstr = "Bad path to WSDL file $path"; $this->debug($errstr); $this->setError($errstr); return false; - } + } } $this->debug('Parse WSDL'); // end new code added // Create an XML parser. - $this->parser = xml_parser_create(); + $this->parser = xml_parser_create(); // Set the options for parsing the XML data. // xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); - xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); // Set the object for the parser. - xml_set_object($this->parser, $this); + xml_set_object($this->parser, $this); // Set the element handlers for the parser. xml_set_element_handler($this->parser, 'start_element', 'end_element'); xml_set_character_data_handler($this->parser, 'character_data'); @@ -276,7 +276,7 @@ $this->debug("XML payload:\n" . $wsdl_string); $this->setError($errstr); return false; - } + } // free the parser xml_parser_free($this->parser); $this->debug('Parsing WSDL done'); @@ -285,15 +285,15 @@ return false; } return true; - } + } /** * start-element handler - * + * * @param string $parser XML parser object * @param string $name element name * @param string $attrs associative array of attributes - * @access private + * @access private */ function start_element($parser, $name, $attrs) { @@ -312,10 +312,10 @@ } else { // position in the total number of elements, starting from 0 $pos = $this->position++; - $depth = $this->depth++; + $depth = $this->depth++; // set self as current value for this depth $this->depth_array[$depth] = $pos; - $this->message[$pos] = array('cdata' => ''); + $this->message[$pos] = array('cdata' => ''); // process attributes if (count($attrs) > 0) { // register namespace declarations @@ -325,11 +325,11 @@ $this->namespaces[$ns_prefix] = $v; } else { $this->namespaces['ns' . (count($this->namespaces) + 1)] = $v; - } + } if ($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema') { $this->XMLSchemaVersion = $v; $this->namespaces['xsi'] = $v . '-instance'; - } + } } } // expand each attribute prefix to its namespace @@ -337,22 +337,22 @@ $k = strpos($k, ':') ? $this->expandQname($k) : $k; if ($k != 'location' && $k != 'soapAction' && $k != 'namespace') { $v = strpos($v, ':') ? $this->expandQname($v) : $v; - } + } $eAttrs[$k] = $v; - } + } $attrs = $eAttrs; } else { $attrs = array(); - } + } // get element prefix, namespace and name if (preg_match('/:/', $name)) { // get ns prefix - $prefix = substr($name, 0, strpos($name, ':')); + $prefix = substr($name, 0, strpos($name, ':')); // get ns - $namespace = isset($this->namespaces[$prefix]) ? $this->namespaces[$prefix] : ''; + $namespace = isset($this->namespaces[$prefix]) ? $this->namespaces[$prefix] : ''; // get unqualified name $name = substr(strstr($name, ':'), 1); - } + } // process attributes, expanding any prefixes to namespaces // find status, register data switch ($this->status) { @@ -361,12 +361,12 @@ if (isset($attrs['type'])) { $this->debug("msg " . $this->currentMessage . ": found part (with type) $attrs[name]: " . implode(',', $attrs)); $this->messages[$this->currentMessage][$attrs['name']] = $attrs['type']; - } + } if (isset($attrs['element'])) { $this->debug("msg " . $this->currentMessage . ": found part (with element) $attrs[name]: " . implode(',', $attrs)); $this->messages[$this->currentMessage][$attrs['name']] = $attrs['element'] . '^'; - } - } + } + } break; case 'portType': switch ($name) { @@ -375,25 +375,25 @@ $this->debug("portType $this->currentPortType operation: $this->currentPortOperation"); if (isset($attrs['parameterOrder'])) { $this->portTypes[$this->currentPortType][$attrs['name']]['parameterOrder'] = $attrs['parameterOrder']; - } + } break; case 'documentation': $this->documentation = true; - break; + break; // merge input/output data default: $m = isset($attrs['message']) ? $this->getLocalPart($attrs['message']) : ''; $this->portTypes[$this->currentPortType][$this->currentPortOperation][$name]['message'] = $m; break; - } + } break; case 'binding': switch ($name) { - case 'binding': + case 'binding': // get ns prefix if (isset($attrs['style'])) { $this->bindings[$this->currentBinding]['prefix'] = $prefix; - } + } $this->bindings[$this->currentBinding] = array_merge($this->bindings[$this->currentBinding], $attrs); break; case 'header': @@ -402,17 +402,17 @@ case 'operation': if (isset($attrs['soapAction'])) { $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['soapAction'] = $attrs['soapAction']; - } + } if (isset($attrs['style'])) { $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['style'] = $attrs['style']; - } + } if (isset($attrs['name'])) { $this->currentOperation = $attrs['name']; $this->debug("current binding operation: $this->currentOperation"); $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['name'] = $attrs['name']; $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['binding'] = $this->currentBinding; $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['endpoint'] = isset($this->bindings[$this->currentBinding]['endpoint']) ? $this->bindings[$this->currentBinding]['endpoint'] : ''; - } + } break; case 'input': $this->opStatus = 'input'; @@ -425,9 +425,9 @@ $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = array_merge($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus], $attrs); } else { $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = $attrs; - } + } break; - } + } break; case 'service': switch ($name) { @@ -435,7 +435,7 @@ $this->currentPort = $attrs['name']; $this->debug('current port: ' . $this->currentPort); $this->ports[$this->currentPort]['binding'] = $this->getLocalPart($attrs['binding']); - + break; case 'address': $this->ports[$this->currentPort]['location'] = $attrs['location']; @@ -443,9 +443,9 @@ $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['bindingType'] = $namespace; $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['endpoint'] = $attrs['location']; break; - } + } break; - } + } // set status switch ($name) { case 'import': @@ -481,11 +481,11 @@ $this->currentBinding = $this->getLocalPart($attrs['name']); } else { $this->currentBinding = $attrs['name']; - } + } $this->status = 'binding'; $this->bindings[$this->currentBinding]['portType'] = $this->getLocalPart($attrs['type']); $this->debug("current binding: $this->currentBinding of portType: " . $attrs['type']); - } + } break; case 'service': $this->serviceName = $attrs['name']; @@ -495,20 +495,20 @@ case 'definitions': foreach ($attrs as $name => $value) { $this->wsdl_info[$name] = $value; - } + } break; - } - } - } + } + } + } /** * end-element handler - * + * * @param string $parser XML parser object * @param string $name element name - * @access private + * @access private */ - function end_element($parser, $name){ + function end_element($parser, $name){ // unset schema status if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) { $this->status = ""; @@ -516,38 +516,38 @@ $this->currentSchema->clearDebug(); $this->schemas[$this->currentSchema->schemaTargetNamespace][] = $this->currentSchema; $this->debug('Parsing WSDL schema done'); - } + } if ($this->status == 'schema') { $this->currentSchema->schemaEndElement($parser, $name); } else { // bring depth down a notch $this->depth--; - } + } // end documentation if ($this->documentation) { //TODO: track the node to which documentation should be assigned; it can be a part, message, etc. //$this->portTypes[$this->currentPortType][$this->currentPortOperation]['documentation'] = $this->documentation; $this->documentation = false; - } - } + } + } /** * element content handler - * + * * @param string $parser XML parser object * @param string $data element content - * @access private + * @access private */ function character_data($parser, $data) { $pos = isset($this->depth_array[$this->depth]) ? $this->depth_array[$this->depth] : 0; if (isset($this->message[$pos]['cdata'])) { $this->message[$pos]['cdata'] .= $data; - } + } if ($this->documentation) { $this->documentation .= $data; - } - } + } + } /** * if authenticating, set user credentials here @@ -566,21 +566,21 @@ $this->authtype = $authtype; $this->certRequest = $certRequest; } - + function getBindingData($binding) { if (is_array($this->bindings[$binding])) { return $this->bindings[$binding]; - } + } } - + /** * returns an assoc array of operation names => operation data - * + * * @param string $portName WSDL port name * @param string $bindingType eg: soap, smtp, dime (only soap and soap12 are currently supported) - * @return array - * @access public + * @return array + * @access public */ function getOperations($portName = '', $bindingType = 'soap') { $ops = array(); @@ -612,15 +612,15 @@ $this->debug("getOperations found no operations for port '$portName' bindingType $bindingType"); } return $ops; - } - + } + /** * returns an associative array of data necessary for calling an operation - * + * * @param string $operation name of operation * @param string $bindingType type of binding eg: soap, soap12 - * @return array - * @access public + * @return array + * @access public */ function getOperationData($operation, $bindingType = 'soap') { @@ -640,19 +640,19 @@ if ($operation == $bOperation) { $opData = $this->bindings[ $portData['binding'] ]['operations'][$operation]; return $opData; - } - } - } - } + } + } + } + } } - + /** * returns an associative array of data necessary for calling an operation - * + * * @param string $soapAction soapAction for operation * @param string $bindingType type of binding eg: soap, soap12 - * @return array - * @access public + * @return array + * @access public */ function getOperationDataForSoapAction($soapAction, $bindingType = 'soap') { if ($bindingType == 'soap') { @@ -668,12 +668,12 @@ foreach ($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) { if ($opData['soapAction'] == $soapAction) { return $opData; - } - } - } - } + } + } + } + } } - + /** * returns an array of information about a given type * returns false if no type exists by the given name @@ -884,7 +884,7 @@ * * @param mixed $debug whether to put debug=1 in endpoint URL * @return string serialization of WSDL - * @access public + * @access public */ function serialize($debug = 0) { @@ -892,15 +892,15 @@ $xml .= "\nnamespaces as $k => $v) { $xml .= " xmlns:$k=\"$v\""; - } + } // 10.9.02 - add poulter fix for wsdl and tns declarations if (isset($this->namespaces['wsdl'])) { $xml .= " xmlns=\"" . $this->namespaces['wsdl'] . "\""; - } + } if (isset($this->namespaces['tns'])) { $xml .= " targetNamespace=\"" . $this->namespaces['tns'] . "\""; - } - $xml .= '>'; + } + $xml .= '>'; // imports if (sizeof($this->import) > 0) { foreach($this->import as $ns => $list) { @@ -911,8 +911,8 @@ $xml .= ''; } } - } - } + } + } // types if (count($this->schemas)>=1) { $xml .= "\n\n"; @@ -922,7 +922,7 @@ } } $xml .= ''; - } + } // messages if (count($this->messages) >= 1) { foreach($this->messages as $msgName => $msgParts) { @@ -939,11 +939,11 @@ foreach($this->typemap as $ns => $types) { if (isset($types[$partType])) { $typePrefix = $this->getPrefixFromNamespace($ns); - } - } + } + } if (!isset($typePrefix)) { die("$partType has no namespace!"); - } + } } $ns = $this->getNamespaceFromPrefix($typePrefix); $localPart = $this->getLocalPart($partType); @@ -960,8 +960,8 @@ } } $xml .= ''; - } - } + } + } // bindings & porttypes if (count($this->bindings) >= 1) { $binding_xml = ''; @@ -989,7 +989,7 @@ $portType_xml .= "\n" . ' ' . htmlspecialchars($opParts['documentation']) . ''; @@ -997,12 +997,12 @@ $portType_xml .= "\n" . ' '; $portType_xml .= "\n" . ' '; $portType_xml .= "\n" . ' '; - } + } $portType_xml .= "\n" . ''; $binding_xml .= "\n" . ''; - } + } $xml .= $portType_xml . $binding_xml; - } + } // services $xml .= "\nserviceName . '">'; if (count($this->ports) >= 1) { @@ -1010,11 +1010,11 @@ $xml .= "\n" . ' '; $xml .= "\n" . ' '; $xml .= "\n" . ' '; - } - } + } + } $xml .= "\n" . ''; return $xml . "\n"; - } + } /** * determine whether a set of parameters are unwrapped @@ -1059,7 +1059,7 @@ $phpType = $typeDef['phpType']; $arrayType = (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : ''); $this->debug("in parametersMatchWrapped: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: $arrayType"); - + // we expect a complexType or element of complexType if ($phpType != 'struct') { $this->debug("in parametersMatchWrapped: not a struct"); @@ -1100,7 +1100,7 @@ * TODO * - multi-ref serialization * - validate PHP values against type definitions, return errors if invalid - * + * * @param string $operation operation name * @param string $direction (input|output) * @param mixed $parameters parameter value(s) @@ -1111,12 +1111,12 @@ function serializeRPCParameters($operation, $direction, $parameters, $bindingType = 'soap') { $this->debug("in serializeRPCParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion, bindingType=$bindingType"); $this->appendDebug('parameters=' . $this->varDump($parameters)); - + if ($direction != 'input' && $direction != 'output') { $this->debug('The value of the \$direction argument needs to be either "input" or "output"'); $this->setError('The value of the \$direction argument needs to be either "input" or "output"'); return false; - } + } if (!$opData = $this->getOperationData($operation, $bindingType)) { $this->debug('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType); $this->setError('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType); @@ -1167,7 +1167,7 @@ $this->debug("serializing part $name of type $type"); // Track encoding style if (isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) { - $encodingStyle = $opData[$direction]['encodingStyle']; + $encodingStyle = $opData[$direction]['encodingStyle']; $enc_style = $encodingStyle; } else { $enc_style = false; @@ -1193,15 +1193,15 @@ } $this->debug("serializeRPCParameters returning: $xml"); return $xml; - } - + } + /** * serialize a PHP value according to a WSDL message definition - * + * * TODO * - multi-ref serialization * - validate PHP values against type definitions, return errors if invalid - * + * * @param string $operation operation name * @param string $direction (input|output) * @param mixed $parameters parameter value(s) @@ -1211,14 +1211,14 @@ */ function serializeParameters($operation, $direction, $parameters) { - $this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion"); + $this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion"); $this->appendDebug('parameters=' . $this->varDump($parameters)); - + if ($direction != 'input' && $direction != 'output') { $this->debug('The value of the \$direction argument needs to be either "input" or "output"'); $this->setError('The value of the \$direction argument needs to be either "input" or "output"'); return false; - } + } if (!$opData = $this->getOperationData($operation)) { $this->debug('Unable to retrieve WSDL data for operation: ' . $operation); $this->setError('Unable to retrieve WSDL data for operation: ' . $operation); @@ -1226,18 +1226,18 @@ } $this->debug('opData:'); $this->appendDebug($this->varDump($opData)); - + // Get encoding style for output and set to current $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/'; if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) { $encodingStyle = $opData['output']['encodingStyle']; $enc_style = $encodingStyle; } - + // set input params $xml = ''; if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) { - + $use = $opData[$direction]['use']; $this->debug("use=$use"); $this->debug('got ' . count($opData[$direction]['parts']) . ' part(s)'); @@ -1248,7 +1248,7 @@ $this->debug('serializing part "'.$name.'" of type "'.$type.'"'); // Track encoding style if(isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) { - $encodingStyle = $opData[$direction]['encodingStyle']; + $encodingStyle = $opData[$direction]['encodingStyle']; $enc_style = $encodingStyle; } else { $enc_style = false; @@ -1274,11 +1274,11 @@ } $this->debug("serializeParameters returning: $xml"); return $xml; - } - + } + /** * serializes a PHP value according a given type definition - * + * * @param string $name name of value (part or element) * @param string $type XML schema type of value (type or element) * @param mixed $value a native PHP value (parameter value) @@ -1364,7 +1364,7 @@ } else { $value = 'true'; } - } + } if ($uqType == 'string' && gettype($value) == 'string') { $value = $this->expandEntities($value); } @@ -1445,7 +1445,7 @@ return false; } $phpType = $typeDef['phpType']; - $this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '') ); + $this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '') ); // if php type == struct, map value to the element names if ($phpType == 'struct') { if (isset($typeDef['typeClass']) && $typeDef['typeClass'] == 'element') { @@ -1537,11 +1537,11 @@ foreach($value as $v) { $cols = ',' . sizeof($v); $nv = array_merge($nv, $v); - } + } $value = $nv; } else { $cols = ''; - } + } if (is_array($value) && sizeof($value) >= 1) { $rows = sizeof($value); $contents = ''; @@ -1552,7 +1552,7 @@ $contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use); } else { $contents .= $this->serialize_val($v, 'item', $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use); - } + } } } else { $rows = 0; @@ -1596,7 +1596,7 @@ $this->debug("in serializeType: returning: $xml"); return $xml; } - + /** * serializes the attributes for a complexType * @@ -1651,7 +1651,7 @@ if ($xname) { $xml .= " $aName=\"" . $this->expandEntities($xvalue[$xname]) . "\""; } - } + } } else { $this->debug("no attributes to serialize for XML Schema type $ns:$uqType"); } @@ -1709,7 +1709,7 @@ } // if user took advantage of a minOccurs=0, then only serialize named parameters if (isset($optionals) - && (!isset($xvalue[$eName])) + && (!isset($xvalue[$eName])) && ( (!isset($attrs['nillable'])) || $attrs['nillable'] != 'true') ){ if (isset($attrs['minOccurs']) && $attrs['minOccurs'] <> '0') { @@ -1757,7 +1757,7 @@ } } } - } + } } else { $this->debug("no elements to serialize for XML Schema type $ns:$uqType"); } @@ -1793,7 +1793,7 @@ } $elements = $eElements; } - + if (count($attrs) > 0) { foreach($attrs as $n => $a){ // expand each attribute @@ -1846,7 +1846,7 @@ /** * register an operation with the server - * + * * @param string $name operation (method) name * @param array $in assoc array of input values: key = param name, value = param type * @param array $out assoc array of output values: key = param name, value = param type @@ -1856,7 +1856,7 @@ * @param string $use (encoded|literal) optional The use for the parameters (cannot mix right now) * @param string $documentation optional The description to include in the WSDL * @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded) - * @access public + * @access public */ function addOperation($name, $in = false, $out = false, $namespace = false, $soapaction = false, $style = 'rpc', $use = 'encoded', $documentation = '', $encodingStyle = ''){ if ($use == 'encoded' && $encodingStyle == '') { @@ -1903,7 +1903,7 @@ 'parts' => $out), 'namespace' => $namespace, 'transport' => 'http://schemas.xmlsoap.org/soap/http', - 'documentation' => $documentation); + 'documentation' => $documentation); // add portTypes // add messages if($in) @@ -1931,7 +1931,7 @@ $this->messages[$name.'Response']= '0'; } return true; - } + } } ?> --- /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/github_class.wsdlcache.php +++ /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/client_class.wsdlcache.php @@ -9,10 +9,10 @@ /** * caches instances of the wsdl class -* +* * @author Scott Nichol * @author Ingo Fischer -* @access public +* @access public */ class nusoap_wsdlcache { /** @@ -43,7 +43,7 @@ * @param integer $cache_lifetime lifetime for caching-files in seconds or 0 for unlimited * @access public */ - function __construct($cache_dir='.', $cache_lifetime=0) { + function nusoap_wsdlcache($cache_dir='.', $cache_lifetime=0) { $this->fplock = array(); $this->cache_dir = $cache_dir != '' ? $cache_dir : '.'; $this->cache_lifetime = $cache_lifetime; --- /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/github_class.xmlschema.php +++ /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/client_class.xmlschema.php @@ -12,7 +12,7 @@ * @access public */ class nusoap_xmlschema extends nusoap_base { - + // files var $schema = ''; var $xml = ''; @@ -41,7 +41,7 @@ var $depth_array = array(); var $message = array(); var $defaultNamespace = array(); - + /** * constructor * @@ -50,8 +50,8 @@ * @param string $namespaces namespaces defined in enclosing XML * @access public */ - function __construct($schema='',$xml='',$namespaces=array()){ - parent::__construct(); + function nusoap_xmlschema($schema='',$xml='',$namespaces=array()){ + parent::nusoap_base(); $this->debug('nusoap_xmlschema class instantiated, inside constructor'); // files $this->schema = $schema; @@ -141,7 +141,7 @@ $this->debug("XML payload:\n" . $xml); $this->setError($errstr); } - + xml_parser_free($this->parser); } else{ $this->debug('no xml passed to parseString()!!'); @@ -163,7 +163,7 @@ } return $scope . $ename . '_ContainedType'; } - + /** * start-element handler * @@ -173,13 +173,13 @@ * @access private */ function schemaStartElement($parser, $name, $attrs) { - + // position in the total number of elements, starting from 0 $pos = $this->position++; $depth = $this->depth++; // set self as current value for this depth $this->depth_array[$depth] = $pos; - $this->message[$pos] = array('cdata' => ''); + $this->message[$pos] = array('cdata' => ''); if ($depth > 0) { $this->defaultNamespace[$pos] = $this->defaultNamespace[$this->depth_array[$depth - 1]]; } else { @@ -193,7 +193,7 @@ } else { $prefix = ''; } - + // loop thru attributes, expanding, and registering namespace declarations if(count($attrs) > 0){ foreach($attrs as $k => $v){ @@ -269,7 +269,7 @@ $aname = $attrs['ref']; $this->attributes[$attrs['ref']] = $attrs; } - + if($this->currentComplexType){ // This should *always* be $this->complexTypes[$this->currentComplexType]['attrs'][$aname] = $attrs; } @@ -562,8 +562,8 @@ $xml .= " <$schemaPrefix:import namespace=\"" . $ns . "\" />\n"; } } - } - } + } + } // complex types foreach($this->complexTypes as $typeName => $attrs){ $contentStr = ''; @@ -860,12 +860,12 @@ } return $buffer; } - + /** * adds a complex type to the schema - * + * * example: array - * + * * addType( * 'ArrayOfstring', * 'complexType', @@ -875,9 +875,9 @@ * array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'string[]'), * 'xsd:string' * ); - * + * * example: PHP associative array ( SOAP Struct ) - * + * * addType( * 'SOAPStruct', * 'complexType', @@ -885,7 +885,7 @@ * 'all', * array('myVar'=> array('name'=>'myVar','type'=>'string') * ); - * + * * @param name * @param typeClass (complexType|simpleType|attribute) * @param phpType: currently supported are array and struct (php assoc array) @@ -913,11 +913,11 @@ 'attrs' => $attrs, 'arrayType' => $arrayType ); - + $this->xdebug("addComplexType $name:"); $this->appendDebug($this->varDump($this->complexTypes[$name])); } - + /** * adds a simple type to the schema * @@ -938,7 +938,7 @@ 'type' => $restrictionBase, 'enumeration' => $enumeration ); - + $this->xdebug("addSimpleType $name:"); $this->appendDebug($this->varDump($this->simpleTypes[$name])); } @@ -956,7 +956,7 @@ } $this->elements[ $attrs['name'] ] = $attrs; $this->elements[ $attrs['name'] ]['typeClass'] = 'element'; - + $this->xdebug("addElement " . $attrs['name']); $this->appendDebug($this->varDump($this->elements[ $attrs['name'] ])); } --- /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/github_nusoap.php +++ /tmp/dsg/dolibarr/htdocs/includes/nusoap/lib/client_nusoap.php @@ -219,7 +219,7 @@ * * @access public */ - function __construct() { + function nusoap_base() { $this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel']; } @@ -1037,8 +1037,8 @@ * @param string $faultstring human readable error message * @param mixed $faultdetail detail, typically a string or array of string */ - function __construct($faultcode,$faultactor='',$faultstring='',$faultdetail=''){ - parent::__construct(); + function nusoap_fault($faultcode,$faultactor='',$faultstring='',$faultdetail=''){ + parent::nusoap_base(); $this->faultcode = $faultcode; $this->faultactor = $faultactor; $this->faultstring = $faultstring; @@ -1129,8 +1129,8 @@ * @param string $namespaces namespaces defined in enclosing XML * @access public */ - function __construct($schema='',$xml='',$namespaces=array()){ - parent::__construct(); + function nusoap_xmlschema($schema='',$xml='',$namespaces=array()){ + parent::nusoap_base(); $this->debug('nusoap_xmlschema class instantiated, inside constructor'); // files $this->schema = $schema; @@ -2116,8 +2116,8 @@ * @param mixed $attributes associative array of attributes to add to element serialization * @access public */ - function __construct($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) { - parent::__construct(); + function soapval($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) { + parent::nusoap_base(); $this->name = $name; $this->type = $type; $this->value = $value; @@ -2207,8 +2207,8 @@ * @param boolean $use_curl Whether to try to force cURL use * @access public */ - function __construct($url, $curl_options = NULL, $use_curl = false){ - parent::__construct(); + function soap_transport_http($url, $curl_options = NULL, $use_curl = false){ + parent::nusoap_base(); $this->debug("ctor url=$url use_curl=$use_curl curl_options:"); $this->appendDebug($this->varDump($curl_options)); $this->setURL($url); @@ -3623,8 +3623,8 @@ * @param mixed $wsdl file path or URL (string), or wsdl instance (object) * @access public */ - function __construct($wsdl=false) { - parent::__construct(); + function nusoap_server($wsdl=false){ + parent::nusoap_base(); // turn on debugging? global $debug; global $HTTP_SERVER_VARS; @@ -4219,10 +4219,8 @@ $payload .= $this->getDebugAsXMLComment(); } $this->outgoing_headers[] = "Server: $this->title Server v$this->version"; - // @CHANGE Fix for php8 - $rev = array(); - preg_match('/\$Revision: ([^ ]+)/', $this->revision, $rev); - $this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".(isset($rev[1]) ? $rev[1] : '').")"; + preg_match('/\$Revisio' . 'n: ([^ ]+)/', $this->revision, $rev); + $this->outgoing_headers[] = "X-SOAP-Server: $this->title/$this->version (".$rev[1].")"; // Let the Web server decide about this //$this->outgoing_headers[] = "Connection: Close\r\n"; $payload = $this->getHTTPBody($payload); @@ -4647,8 +4645,8 @@ * @param boolean $use_curl try to use cURL * @access public */ - function __construct($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){ - parent::__construct(); + function wsdl($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){ + parent::nusoap_base(); $this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout"); $this->proxyhost = $proxyhost; $this->proxyport = $proxyport; @@ -6125,7 +6123,7 @@ $rows = sizeof($value); $contents = ''; foreach($value as $k => $v) { - $this->debug("serializing array element: $k of type: ".$typeDef['arrayType']); + $this->debug("serializing array element: $k, $v of type: $typeDef[arrayType]"); //if (strpos($typeDef['arrayType'], ':') ) { if (!in_array($typeDef['arrayType'],$this->typemap['http://www.w3.org/2001/XMLSchema'])) { $contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use); @@ -6574,8 +6572,8 @@ * @param string $decode_utf8 whether to decode UTF-8 to ISO-8859-1 * @access public */ - function __construct($xml,$encoding='UTF-8',$method='',$decode_utf8=true){ - parent::__construct(); + function nusoap_parser($xml,$encoding='UTF-8',$method='',$decode_utf8=true){ + parent::nusoap_base(); $this->xml = $xml; $this->xml_encoding = $encoding; $this->method = $method; @@ -7251,8 +7249,8 @@ * @param string $portName optional portName in WSDL document * @access public */ - function __construct($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30, $portName = ''){ - parent::__construct(); + function nusoap_client($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30, $portName = ''){ + parent::nusoap_base(); $this->endpoint = $endpoint; $this->proxyhost = $proxyhost; $this->proxyport = $proxyport;