Fix __construct

pull/2487/head
jmontoyaa 9 years ago
parent 74dcb3bdbe
commit 9d36b8f2c9
  1. 6
      main/inc/lib/nusoap/class.nusoap_base.php
  2. 16
      main/inc/lib/nusoap/class.soap_fault.php
  3. 9
      main/inc/lib/nusoap/class.soap_parser.php
  4. 11
      main/inc/lib/nusoap/class.soap_server.php
  5. 109
      main/inc/lib/nusoap/class.soap_transport_http.php
  6. 10
      main/inc/lib/nusoap/class.soap_val.php
  7. 31
      main/inc/lib/nusoap/class.soapclient.php
  8. 10
      main/inc/lib/nusoap/class.wsdl.php
  9. 9
      main/inc/lib/nusoap/class.wsdlcache.php
  10. 49
      main/inc/lib/nusoap/class.xmlschema.php
  11. 42
      main/inc/lib/nusoap/nusoapmime.php

@ -82,7 +82,8 @@ $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel'] = 9;
* @version $Id: class.nusoap_base.php,v 1.56 2010/04/26 20:15:08 snichol Exp $
* @access public
*/
class nusoap_base {
class nusoap_base
{
/**
* Identification for HTTP headers.
*
@ -222,7 +223,8 @@ class nusoap_base {
*
* @access public
*/
function __construct() {
public function __construct()
{
$this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel'];
}

@ -1,8 +1,5 @@
<?php
/**
* Contains information for a SOAP fault.
* Mainly used for returning faults from deployed functions
@ -11,7 +8,8 @@
* @version $Id: class.soap_fault.php,v 1.14 2007/04/11 15:49:47 snichol Exp $
* @access public
*/
class nusoap_fault extends nusoap_base {
class nusoap_fault extends nusoap_base
{
/**
* The fault code (client|server)
* @var string
@ -45,8 +43,8 @@ class nusoap_fault extends nusoap_base {
* @param string $faultstring human readable error message
* @param mixed $faultdetail detail, typically a string or array of string
*/
function nusoap_fault($faultcode,$faultactor='',$faultstring='',$faultdetail=''){
parent::nusoap_base();
public function __construct($faultcode,$faultactor='',$faultstring='',$faultdetail=''){
parent::__construct();
$this->faultcode = $faultcode;
$this->faultactor = $faultactor;
$this->faultstring = $faultstring;
@ -83,8 +81,6 @@ class nusoap_fault extends nusoap_base {
/**
* Backward compatibility
*/
class soap_fault extends nusoap_fault {
class soap_fault extends nusoap_fault
{
}
?>

@ -55,8 +55,9 @@ class nusoap_parser extends nusoap_base
* @return void|bool
* @access public
*/
function nusoap_parser($xml,$encoding='UTF-8',$method='',$decode_utf8=true){
parent::nusoap_base();
function __construct($xml,$encoding='UTF-8',$method='',$decode_utf8=true)
{
parent::__construct();
$this->xml = $xml;
$this->xml_encoding = $encoding;
$this->method = $method;
@ -319,7 +320,7 @@ class nusoap_parser extends nusoap_base
// get unqualified name
$name = substr(strstr($name,':'),1);
}
// build to native type
if(isset($this->body_position) && $pos > $this->body_position){
// deal w/ multirefs
@ -381,7 +382,7 @@ class nusoap_parser extends nusoap_base
*/
}
}
// for doclit
if($this->status == 'header'){
if ($this->root_header != $pos) {

@ -1,8 +1,5 @@
<?php
/**
*
* nusoap_server allows the user to create a SOAP server
@ -13,7 +10,8 @@
* @version $Id: class.soap_server.php,v 1.63 2010/04/26 20:15:08 snichol Exp $
* @access public
*/
class nusoap_server extends nusoap_base {
class nusoap_server extends nusoap_base
{
/**
* HTTP headers of request
* @var array
@ -170,8 +168,9 @@ class nusoap_server extends nusoap_base {
* @param mixed $wsdl file path or URL (string), or wsdl instance (object)
* @access public
*/
function nusoap_server($wsdl=false){
parent::nusoap_base();
function __construct($wsdl=false)
{
parent::__construct();
// turn on debugging?
global $debug;
global $HTTP_SERVER_VARS;

@ -1,8 +1,5 @@
<?php
/**
* transport class for sending/receiving data via HTTP and HTTPS
* NOTE: PHP must be compiled with the CURL extension for HTTPS support
@ -12,8 +9,8 @@
* @version $Id: class.soap_transport_http.php,v 1.68 2010/04/26 20:15:08 snichol Exp $
* @access public
*/
class soap_transport_http extends nusoap_base {
class soap_transport_http extends nusoap_base
{
var $url = '';
var $uri = '';
var $digest_uri = '';
@ -57,8 +54,8 @@ class soap_transport_http extends nusoap_base {
* @param boolean $use_curl Whether to try to force cURL use
* @access public
*/
function soap_transport_http($url, $curl_options = NULL, $use_curl = false){
parent::nusoap_base();
function __construct($url, $curl_options = NULL, $use_curl = false){
parent::__construct();
$this->debug("ctor url=$url use_curl=$use_curl curl_options:");
$this->appendDebug($this->varDump($curl_options));
$this->setURL($url);
@ -122,12 +119,12 @@ class soap_transport_http extends nusoap_base {
$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'){
@ -136,10 +133,10 @@ class soap_transport_http extends nusoap_base {
$this->port = 80;
}
}
$this->uri = $this->path;
$this->digest_uri = $this->uri;
// build headers
if (!isset($u['port'])) {
$this->setHeader('Host', $this->host);
@ -219,7 +216,7 @@ class soap_transport_http extends nusoap_base {
} 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;
@ -232,7 +229,7 @@ class soap_transport_http extends nusoap_base {
$this->setError($msg);
return false;
}
// set response timeout
$this->debug('set response timeout to ' . $response_timeout);
socket_set_timeout( $this->fp, $response_timeout);
@ -321,10 +318,10 @@ class soap_transport_http extends nusoap_base {
// 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');
@ -411,7 +408,7 @@ class soap_transport_http extends nusoap_base {
* @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;
@ -423,18 +420,18 @@ class soap_transport_http extends nusoap_base {
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;
}
@ -454,7 +451,7 @@ class soap_transport_http extends nusoap_base {
function sendHTTPS($data, $timeout=0, $response_timeout=30, $cookies) {
return $this->send($data, $timeout, $response_timeout, $cookies);
}
/**
* if authenticating, set user credentials here
*
@ -476,21 +473,21 @@ class soap_transport_http extends nusoap_base {
} 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)
@ -501,7 +498,7 @@ class soap_transport_http extends nusoap_base {
// ) <">
// if qop is missing,
// request-digest = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <">
$unhashedDigest = '';
$nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : '';
$cnonce = $nonce;
@ -510,10 +507,10 @@ class soap_transport_http extends nusoap_base {
} else {
$unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2;
}
$hashedDigest = md5($unhashedDigest);
$opaque = '';
$opaque = '';
if (isset($digestRequest['opaque'])) {
$opaque = ', opaque="' . $digestRequest['opaque'] . '"';
}
@ -532,7 +529,7 @@ class soap_transport_http extends nusoap_base {
$this->authtype = $authtype;
$this->digestRequest = $digestRequest;
}
/**
* set the soapaction value
*
@ -542,7 +539,7 @@ class soap_transport_http extends nusoap_base {
function setSOAPAction($soapaction) {
$this->setHeader('SOAPAction', '"' . $soapaction . '"');
}
/**
* use http encoding
*
@ -562,7 +559,7 @@ class soap_transport_http extends nusoap_base {
$this->encoding = $enc;
}
}
/**
* set proxy info here
*
@ -591,7 +588,7 @@ class soap_transport_http extends nusoap_base {
unsetHeader('Proxy-Authorization');
}
}
/**
* Test if the given string starts with a header that is to be skipped.
@ -632,7 +629,7 @@ class soap_transport_http extends nusoap_base {
// length := 0
$length = 0;
$new = '';
// read chunk-size, chunk-extension (if any) and CRLF
// get the position of the linebreak
$chunkend = strpos($buffer, $lb);
@ -647,7 +644,7 @@ class soap_transport_http extends nusoap_base {
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);
@ -656,7 +653,7 @@ class soap_transport_http extends nusoap_base {
$length += strlen($chunk);
break;
}
// read chunk-data and CRLF
$chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart);
// append chunk-data to entity-body
@ -665,7 +662,7 @@ class soap_transport_http extends nusoap_base {
$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
@ -676,7 +673,7 @@ class soap_transport_http extends nusoap_base {
}
return $new;
}
/**
* Writes the payload, including HTTP headers, to $this->outgoing_payload.
*
@ -721,7 +718,7 @@ class soap_transport_http extends nusoap_base {
// header/body separator
$this->outgoing_payload .= "\r\n";
// add data
$this->outgoing_payload .= $data;
}
@ -793,7 +790,7 @@ class soap_transport_http extends nusoap_base {
*/
function getResponse(){
$this->incoming_payload = '';
if ($this->io_method() == 'socket') {
// loop until headers have been retrieved
$data = '';
@ -864,7 +861,7 @@ class soap_transport_http extends nusoap_base {
$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
@ -930,22 +927,22 @@ class soap_transport_http extends nusoap_base {
$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)){
@ -956,7 +953,7 @@ class soap_transport_http extends nusoap_base {
// 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');
@ -982,7 +979,7 @@ class soap_transport_http extends nusoap_base {
// close curl
$this->debug('No cURL error, closing cURL');
curl_close($this->ch);
// try removing skippable headers
$savedata = $data;
while ($this->isSkippableCurlHeader($data)) {
@ -1005,7 +1002,7 @@ class soap_transport_http extends nusoap_base {
}
}
}
// separate content from HTTP headers
if ($pos = strpos($data,"\r\n\r\n")) {
$lb = "\r\n";
@ -1065,7 +1062,7 @@ class soap_transport_http extends nusoap_base {
$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) {
@ -1084,7 +1081,7 @@ class soap_transport_http extends nusoap_base {
$this->setError('HTTP authentication failed');
return false;
}
if (
($http_status >= 300 && $http_status <= 307) ||
($http_status >= 400 && $http_status <= 417) ||
@ -1152,13 +1149,13 @@ class soap_transport_http extends nusoap_base {
} 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;
}
@ -1230,7 +1227,7 @@ class soap_transport_http extends nusoap_base {
} else {
$path = '/';
}
$cookie_param = ';secure;';
if (strpos($cookie_str, $cookie_param) !== FALSE) {
$secure = true;
@ -1249,12 +1246,12 @@ class soap_transport_http extends nusoap_base {
'path' => $path,
'expires' => $expires,
'secure' => $secure
);
);
return $cookie;
}
return false;
}
/**
* sort out cookies for the current request
*

@ -1,8 +1,5 @@
<?php
/**
* For creating serializable abstractions of native PHP types. This class
* allows element name/namespace, XSD type, and XML attributes to be
@ -14,7 +11,8 @@
* @version $Id: class.soap_val.php,v 1.11 2007/04/06 13:56:32 snichol Exp $
* @access public
*/
class soapval extends nusoap_base {
class soapval extends nusoap_base
{
/**
* The XML element name
*
@ -69,8 +67,8 @@ class soapval extends nusoap_base {
* @param mixed $attributes associative array of attributes to add to element serialization
* @access public
*/
function soapval($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) {
parent::nusoap_base();
function __construct($name='soapval',$type=false,$value=-1,$element_ns=false,$type_ns=false,$attributes=false) {
parent::__construct();
$this->name = $name;
$this->type = $type;
$this->value = $value;

@ -1,8 +1,5 @@
<?php
/**
*
* [nu]soapclient higher level class for easy usage.
@ -23,8 +20,8 @@
* @version $Id: class.soapclient.php,v 1.69 2010/04/26 20:15:08 snichol Exp $
* @access public
*/
class nusoap_client extends nusoap_base {
class nusoap_client extends nusoap_base
{
var $username = ''; // Username for HTTP authentication
var $password = ''; // Password for HTTP authentication
var $authtype = ''; // Type of HTTP authentication
@ -95,8 +92,8 @@ class nusoap_client extends nusoap_base {
* @param string $portName optional portName in WSDL document
* @access public
*/
function nusoap_client($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30, $portName = ''){
parent::nusoap_base();
function __construct($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30, $portName = ''){
parent::__construct();
$this->endpoint = $endpoint;
$this->proxyhost = $proxyhost;
$this->proxyport = $proxyport;
@ -164,7 +161,7 @@ class nusoap_client extends nusoap_base {
$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));
@ -235,7 +232,7 @@ class nusoap_client extends nusoap_base {
// 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");
@ -295,7 +292,7 @@ class nusoap_client extends nusoap_base {
$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');
@ -464,7 +461,7 @@ class nusoap_client extends nusoap_base {
$this->persistentConnection = $http;
}
}
if($err = $http->getError()){
$this->setError('HTTP Error: '.$err);
return false;
@ -628,7 +625,7 @@ class nusoap_client extends nusoap_base {
$this->authtype = $authtype;
$this->certRequest = $certRequest;
}
/**
* use HTTP encoding
*
@ -639,7 +636,7 @@ class nusoap_client extends nusoap_base {
$this->debug("setHTTPEncoding(\"$enc\")");
$this->http_encoding = $enc;
}
/**
* Set whether to try to use cURL connections if possible
*
@ -660,7 +657,7 @@ class nusoap_client extends nusoap_base {
$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.
@ -690,7 +687,7 @@ class nusoap_client extends nusoap_base {
function setDefaultRpcParams($rpcParams) {
$this->defaultRpcParams = $rpcParams;
}
/**
* dynamically creates an instance of a proxy class,
* allowing user to directly call methods from wsdl
@ -820,7 +817,7 @@ class nusoap_client extends nusoap_base {
function getHTTPBody($soapmsg) {
return $soapmsg;
}
/**
* gets the HTTP content type for the current request.
*
@ -832,7 +829,7 @@ class nusoap_client extends nusoap_base {
function getHTTPContentType() {
return 'text/xml';
}
/**
* gets the HTTP content type charset for the current request.
* returns false for non-text content types.

@ -1,8 +1,5 @@
<?php
/**
* parses a WSDL file, allows access to it's data, other utility methods.
* also builds WSDL structures programmatically.
@ -12,7 +9,8 @@
* @version $Id: class.wsdl.php,v 1.76 2010/04/26 20:15:08 snichol Exp $
* @access public
*/
class wsdl extends nusoap_base {
class wsdl extends nusoap_base
{
// URL or filename of the root of this WSDL
var $wsdl;
// define internal arrays of bindings, ports, operations, messages, etc.
@ -69,8 +67,8 @@ class wsdl extends nusoap_base {
* @param boolean $use_curl try to use cURL
* @access public
*/
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();
function __construct($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){
parent::__construct();
$this->debug("ctor wsdl=$wsdl timeout=$timeout response_timeout=$response_timeout");
$this->proxyhost = $proxyhost;
$this->proxyport = $proxyport;

@ -9,13 +9,14 @@ nusoap-general@lists.sourceforge.net
/**
* caches instances of the wsdl class
*
*
* @author Scott Nichol <snichol@users.sourceforge.net>
* @author Ingo Fischer <ingo@apollon.de>
* @version $Id: class.wsdlcache.php,v 1.7 2007/04/17 16:34:03 snichol Exp $
* @access public
* @access public
*/
class nusoap_wsdlcache {
class nusoap_wsdlcache
{
/**
* @var resource
* @access private
@ -44,7 +45,7 @@ class nusoap_wsdlcache {
* @param integer $cache_lifetime lifetime for caching-files in seconds or 0 for unlimited
* @access public
*/
function nusoap_wsdlcache($cache_dir='.', $cache_lifetime=0) {
function __construct($cache_dir='.', $cache_lifetime=0) {
$this->fplock = array();
$this->cache_dir = $cache_dir != '' ? $cache_dir : '.';
$this->cache_lifetime = $cache_lifetime;

@ -1,8 +1,5 @@
<?php
/**
* parses an XML Schema, allows access to it's data, other utility methods.
* imperfect, no validation... yet, but quite functional.
@ -12,8 +9,8 @@
* @version $Id: class.xmlschema.php,v 1.53 2010/04/26 20:15:08 snichol Exp $
* @access public
*/
class nusoap_xmlschema extends nusoap_base {
class nusoap_xmlschema extends nusoap_base
{
// files
var $schema = '';
var $xml = '';
@ -42,7 +39,7 @@ class nusoap_xmlschema extends nusoap_base {
var $depth_array = array();
var $message = array();
var $defaultNamespace = array();
/**
* constructor
*
@ -51,8 +48,8 @@ class nusoap_xmlschema extends nusoap_base {
* @param string $namespaces namespaces defined in enclosing XML
* @access public
*/
function nusoap_xmlschema($schema='',$xml='',$namespaces=array()){
parent::nusoap_base();
function __construct($schema='',$xml='',$namespaces=array()){
parent::__construct();
$this->debug('nusoap_xmlschema class instantiated, inside constructor');
// files
$this->schema = $schema;
@ -142,7 +139,7 @@ class nusoap_xmlschema extends nusoap_base {
$this->debug("XML payload:\n" . $xml);
$this->setError($errstr);
}
xml_parser_free($this->parser);
} else{
$this->debug('no xml passed to parseString()!!');
@ -164,7 +161,7 @@ class nusoap_xmlschema extends nusoap_base {
}
return $scope . $ename . '_ContainedType';
}
/**
* start-element handler
*
@ -174,13 +171,13 @@ class nusoap_xmlschema extends nusoap_base {
* @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 {
@ -194,7 +191,7 @@ class nusoap_xmlschema extends nusoap_base {
} else {
$prefix = '';
}
// loop thru attributes, expanding, and registering namespace declarations
if(count($attrs) > 0){
foreach($attrs as $k => $v){
@ -270,7 +267,7 @@ class nusoap_xmlschema extends nusoap_base {
$aname = $attrs['ref'];
$this->attributes[$attrs['ref']] = $attrs;
}
if($this->currentComplexType){ // This should *always* be
$this->complexTypes[$this->currentComplexType]['attrs'][$aname] = $attrs;
}
@ -563,8 +560,8 @@ class nusoap_xmlschema extends nusoap_base {
$xml .= " <$schemaPrefix:import namespace=\"" . $ns . "\" />\n";
}
}
}
}
}
}
// complex types
foreach($this->complexTypes as $typeName => $attrs){
$contentStr = '';
@ -861,12 +858,12 @@ class nusoap_xmlschema extends nusoap_base {
}
return $buffer;
}
/**
* adds a complex type to the schema
*
*
* example: array
*
*
* addType(
* 'ArrayOfstring',
* 'complexType',
@ -876,9 +873,9 @@ class nusoap_xmlschema extends nusoap_base {
* array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'string[]'),
* 'xsd:string'
* );
*
*
* example: PHP associative array ( SOAP Struct )
*
*
* addType(
* 'SOAPStruct',
* 'complexType',
@ -886,7 +883,7 @@ class nusoap_xmlschema extends nusoap_base {
* '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)
@ -914,11 +911,11 @@ class nusoap_xmlschema extends nusoap_base {
'attrs' => $attrs,
'arrayType' => $arrayType
);
$this->xdebug("addComplexType $name:");
$this->appendDebug($this->varDump($this->complexTypes[$name]));
}
/**
* adds a simple type to the schema
*
@ -939,7 +936,7 @@ class nusoap_xmlschema extends nusoap_base {
'type' => $restrictionBase,
'enumeration' => $enumeration
);
$this->xdebug("addSimpleType $name:");
$this->appendDebug($this->varDump($this->simpleTypes[$name]));
}
@ -957,7 +954,7 @@ class nusoap_xmlschema extends nusoap_base {
}
$this->elements[ $attrs['name'] ] = $attrs;
$this->elements[ $attrs['name'] ]['typeClass'] = 'element';
$this->xdebug("addElement " . $attrs['name']);
$this->appendDebug($this->varDump($this->elements[ $attrs['name'] ]));
}

@ -69,7 +69,7 @@ class nusoap_client_mime extends nusoap_client {
* @access private
*/
var $mimeContentType;
/**
* adds a MIME attachment to the current request.
*
@ -94,7 +94,7 @@ class nusoap_client_mime extends nusoap_client {
$info['filename'] = $filename;
$info['contenttype'] = $contenttype;
$info['cid'] = $cid;
$this->requestAttachments[] = $info;
return $cid;
@ -140,7 +140,7 @@ class nusoap_client_mime extends nusoap_client {
$params['encoding'] = '8bit';
$params['charset'] = $this->soap_defencoding;
$mimeMessage->addSubpart($soapmsg, $params);
foreach ($this->requestAttachments as $att) {
unset($params);
@ -165,7 +165,7 @@ class nusoap_client_mime extends nusoap_client {
$output = $mimeMessage->encode();
$mimeHeaders = $output['headers'];
foreach ($mimeHeaders as $k => $v) {
$this->debug("MIME header $k: $v");
if (strtolower($k) == 'content-type') {
@ -174,13 +174,13 @@ class nusoap_client_mime extends nusoap_client {
$this->mimeContentType = str_replace("\r\n", " ", $v);
}
}
return $output['body'];
}
return parent::getHTTPBody($soapmsg);
}
/**
* gets the HTTP content type for the current request.
*
@ -195,7 +195,7 @@ class nusoap_client_mime extends nusoap_client {
}
return parent::getHTTPContentType();
}
/**
* gets the HTTP content type charset for the current request.
* returns false for non-text content types.
@ -233,7 +233,7 @@ class nusoap_client_mime extends nusoap_client {
$params['include_bodies'] = true;
$params['decode_bodies'] = true;
$params['decode_headers'] = true;
$structure = Mail_mimeDecode::decode($params);
foreach ($structure->parts as $part) {
@ -250,12 +250,12 @@ class nusoap_client_mime extends nusoap_client {
$this->responseAttachments[] = $info;
}
}
if (isset($return)) {
$this->responseData = $root;
return $return;
}
$this->setError('No root part found in multipart/related content');
return '';
}
@ -299,7 +299,7 @@ class nusoap_server_mime extends nusoap_server {
* @access private
*/
var $mimeContentType;
/**
* adds a MIME attachment to the current response.
*
@ -324,7 +324,7 @@ class nusoap_server_mime extends nusoap_server {
$info['filename'] = $filename;
$info['contenttype'] = $contenttype;
$info['cid'] = $cid;
$this->responseAttachments[] = $info;
return $cid;
@ -370,7 +370,7 @@ class nusoap_server_mime extends nusoap_server {
$params['encoding'] = '8bit';
$params['charset'] = $this->soap_defencoding;
$mimeMessage->addSubpart($soapmsg, $params);
foreach ($this->responseAttachments as $att) {
unset($params);
@ -395,7 +395,7 @@ class nusoap_server_mime extends nusoap_server {
$output = $mimeMessage->encode();
$mimeHeaders = $output['headers'];
foreach ($mimeHeaders as $k => $v) {
$this->debug("MIME header $k: $v");
if (strtolower($k) == 'content-type') {
@ -404,13 +404,13 @@ class nusoap_server_mime extends nusoap_server {
$this->mimeContentType = str_replace("\r\n", " ", $v);
}
}
return $output['body'];
}
return parent::getHTTPBody($soapmsg);
}
/**
* gets the HTTP content type for the current response.
*
@ -425,7 +425,7 @@ class nusoap_server_mime extends nusoap_server {
}
return parent::getHTTPContentType();
}
/**
* gets the HTTP content type charset for the current response.
* returns false for non-text content types.
@ -463,7 +463,7 @@ class nusoap_server_mime extends nusoap_server {
$params['include_bodies'] = true;
$params['decode_bodies'] = true;
$params['decode_headers'] = true;
$structure = Mail_mimeDecode::decode($params);
foreach ($structure->parts as $part) {
@ -479,11 +479,11 @@ class nusoap_server_mime extends nusoap_server {
$this->requestAttachments[] = $info;
}
}
if (isset($return)) {
return $return;
}
$this->setError('No root part found in multipart/related content');
return;
}
@ -497,5 +497,3 @@ class nusoap_server_mime extends nusoap_server {
*/
class nusoapservermime extends nusoap_server_mime {
}
?>

Loading…
Cancel
Save