Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/class.nusoap_base.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class nusoap_base {
* @access public
*/
var $XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema';

/**
* charset encoding for outgoing messages
*
Expand Down Expand Up @@ -222,7 +222,7 @@ class nusoap_base {
*
* @access public
*/
function nusoap_base() {
function __construct() {
$this->debugLevel = $GLOBALS['_transient']['static']['nusoap_base']['globalDebugLevel'];
}

Expand Down Expand Up @@ -408,7 +408,7 @@ function serialize_val($val,$name=false,$type=false,$name_ns=false,$type_ns=fals
$this->debug("in serialize_val: name=$name, type=$type, name_ns=$name_ns, type_ns=$type_ns, use=$use, soapval=$soapval");
$this->appendDebug('value=' . $this->varDump($val));
$this->appendDebug('attributes=' . $this->varDump($attributes));

if (is_object($val) && get_class($val) == 'soapval' && (! $soapval)) {
$this->debug("serialize_val: serialize soapval");
$xml = $val->serialize($use);
Expand Down Expand Up @@ -982,7 +982,7 @@ function iso8601_to_timestamp($datestr){
function usleepWindows($usec)
{
$start = gettimeofday();

do
{
$stop = gettimeofday();
Expand All @@ -993,4 +993,4 @@ function usleepWindows($usec)
}


?>
?>
4 changes: 2 additions & 2 deletions lib/class.soap_fault.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ 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=''){
function __construct($faultcode,$faultactor='',$faultstring='',$faultdetail=''){
parent::nusoap_base();
$this->faultcode = $faultcode;
$this->faultactor = $faultactor;
Expand Down Expand Up @@ -87,4 +87,4 @@ class soap_fault extends nusoap_fault {
}


?>
?>
2 changes: 1 addition & 1 deletion lib/class.soap_transport_http.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ function connect($connection_timeout=0,$response_timeout=30){
if (isset($this->certRequest['verifyhost'])) {
$this->setCurlOption(CURLOPT_SSL_VERIFYHOST, $this->certRequest['verifyhost']);
} else {
$this->setCurlOption(CURLOPT_SSL_VERIFYHOST, 2);
$this->setCurlOption(CURLOPT_SSL_VERIFYHOST, 1);
}
if (isset($this->certRequest['sslcertfile'])) {
$this->setCurlOption(CURLOPT_SSLCERT, $this->certRequest['sslcertfile']);
Expand Down
27 changes: 12 additions & 15 deletions lib/class.soapclient.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ 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 = ''){
function __construct($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;
Expand Down Expand Up @@ -164,7 +164,7 @@ function call($operation,$params=array(),$namespace='http://tempuri.org',$soapAc
$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));
Expand Down Expand Up @@ -235,7 +235,7 @@ function call($operation,$params=array(),$namespace='http://tempuri.org',$soapAc
// no WSDL
//$this->namespaces['ns1'] = $namespace;
$nsPrefix = 'ns' . rand(1000, 9999);
// serialize
// serialize
$payload = '';
if ($use = 'literal wrapped') {
// 'literal wrapped' is only sensible (and defined) for 'document'.
Expand Down Expand Up @@ -316,18 +316,15 @@ function call($operation,$params=array(),$namespace='http://tempuri.org',$soapAc
$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');
$this->setError($return['faultcode'].': '.$return['faultstring']);
$this->fault = true;
foreach($return as $k => $v){
$this->$k = $v;
if(is_scalar($v))
$this->debug("$k = $v<br>");
else
$this->debug("$k = ".print_r($v, true)."<br>");
$this->debug("$k = $v<br>");
}
return $return;
} elseif ($style == 'document') {
Expand Down Expand Up @@ -488,7 +485,7 @@ function send($msg, $soapaction = '', $timeout=0, $response_timeout=30) {
$this->persistentConnection = $http;
}
}

if($err = $http->getError()){
$this->setError('HTTP Error: '.$err);
return false;
Expand Down Expand Up @@ -652,7 +649,7 @@ function setCredentials($username, $password, $authtype = 'basic', $certRequest
$this->authtype = $authtype;
$this->certRequest = $certRequest;
}

/**
* use HTTP encoding
*
Expand All @@ -663,7 +660,7 @@ function setHTTPEncoding($enc='gzip, deflate'){
$this->debug("setHTTPEncoding(\"$enc\")");
$this->http_encoding = $enc;
}

/**
* Set whether to try to use cURL connections if possible
*
Expand All @@ -684,7 +681,7 @@ function useHTTPPersistentConnection(){
$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.
Expand Down Expand Up @@ -714,7 +711,7 @@ function getDefaultRpcParams() {
function setDefaultRpcParams($rpcParams) {
$this->defaultRpcParams = $rpcParams;
}

/**
* dynamically creates an instance of a proxy class,
* allowing user to directly call methods from wsdl
Expand Down Expand Up @@ -844,7 +841,7 @@ function getProxyClassCode() {
function getHTTPBody($soapmsg) {
return $soapmsg;
}

/**
* gets the HTTP content type for the current request.
*
Expand All @@ -856,7 +853,7 @@ function getHTTPBody($soapmsg) {
function getHTTPContentType() {
return 'text/xml';
}

/**
* gets the HTTP content type charset for the current request.
* returns false for non-text content types.
Expand Down
Loading