From d9f9602110bcc495331b19bfe10a4cca09729787 Mon Sep 17 00:00:00 2001 From: Germ van Ek Date: Thu, 15 Oct 2015 14:43:20 +0200 Subject: [PATCH 1/5] Fixed some minor typos/bugs --- src/Aw/Nusoap/NusoapClient.php | 2 +- src/Aw/Nusoap/NusoapParser.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Aw/Nusoap/NusoapClient.php b/src/Aw/Nusoap/NusoapClient.php index 8a35e14..44c6b1e 100644 --- a/src/Aw/Nusoap/NusoapClient.php +++ b/src/Aw/Nusoap/NusoapClient.php @@ -109,7 +109,7 @@ function __construct($endpoint,$wsdl = false,$proxyhost = false,$proxyport = fal // make values if($wsdl){ - if (is_object($endpoint) && (get_class($endpoint) == 'Aw\Nusoa\Wsdl')) { + if (is_object($endpoint) && (get_class($endpoint) == 'Aw\Nusoap\Wsdl')) { $this->wsdl = $endpoint; $this->endpoint = $this->wsdl->wsdl; $this->wsdlFile = $this->endpoint; diff --git a/src/Aw/Nusoap/NusoapParser.php b/src/Aw/Nusoap/NusoapParser.php index fc5a482..9657343 100644 --- a/src/Aw/Nusoap/NusoapParser.php +++ b/src/Aw/Nusoap/NusoapParser.php @@ -117,7 +117,11 @@ function __construct($xml,$encoding='UTF-8',$method='',$decode_utf8=true){ $this->appendDebug($this->varDump($this->message)); $this->debug('parsed successfully, found root struct: '.$this->root_struct.' of name '.$this->root_struct_name); // get final value - $this->soapresponse = $this->message[$this->root_struct]['result']; + if( $this->message[$this->root_struct]['nil'] ) { + $this->soapresponse = null; + } else { + $this->soapresponse = $this->message[$this->root_struct]['result']; + } // get header value if($this->root_header != '' && isset($this->message[$this->root_header]['result'])){ $this->soapheader = $this->message[$this->root_header]['result']; From 4c8f2f0e3e8a9c6c6bc9d83c695235b05bcf9ad6 Mon Sep 17 00:00:00 2001 From: Germ van Ek Date: Fri, 16 Oct 2015 14:52:56 +0200 Subject: [PATCH 2/5] Added/fixed license and changed minimum stability --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 3ed35b3..f9c6940 100644 --- a/composer.json +++ b/composer.json @@ -4,7 +4,8 @@ "description": "PHP5 library for SOAP.", "keywords": ["SOAP", "nuSOAP", "asistenteweb"], "homepage": "https://github.com/AsistenteWeb/nuSOAP", - "license": "GNU", + "license": "LGPL-2.1", + "minimum-stability" : "stable", "authors": [ { "name": "Asistente Web", From 0d523324c75b83a2fe550cc7e8541abc3f7ea927 Mon Sep 17 00:00:00 2001 From: Germ van Ek Date: Fri, 16 Oct 2015 15:05:53 +0200 Subject: [PATCH 3/5] Revert "Added/fixed license and changed minimum stability" This reverts commit 4c8f2f0e3e8a9c6c6bc9d83c695235b05bcf9ad6. --- composer.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/composer.json b/composer.json index f9c6940..3ed35b3 100644 --- a/composer.json +++ b/composer.json @@ -4,8 +4,7 @@ "description": "PHP5 library for SOAP.", "keywords": ["SOAP", "nuSOAP", "asistenteweb"], "homepage": "https://github.com/AsistenteWeb/nuSOAP", - "license": "LGPL-2.1", - "minimum-stability" : "stable", + "license": "GNU", "authors": [ { "name": "Asistente Web", From 866f1b04fcd2a46a28fbff0977c04dd41a50dd5c Mon Sep 17 00:00:00 2001 From: Germ van Ek Date: Mon, 19 Oct 2015 13:45:17 +0200 Subject: [PATCH 4/5] Renamed Aw\Nusoap to Esyst\Nusoap --- Readme.md | 18 +++++++++--------- composer.json | 12 ++++++++---- src/{Aw => Esyst}/Nusoap/NusoapBase.php | 10 +++++----- src/{Aw => Esyst}/Nusoap/NusoapClient.php | 4 ++-- src/{Aw => Esyst}/Nusoap/NusoapClientMime.php | 2 +- src/{Aw => Esyst}/Nusoap/NusoapFault.php | 2 +- src/{Aw => Esyst}/Nusoap/NusoapParser.php | 2 +- src/{Aw => Esyst}/Nusoap/NusoapServer.php | 8 ++++---- src/{Aw => Esyst}/Nusoap/NusoapWsdlcache.php | 2 +- src/{Aw => Esyst}/Nusoap/NusoapXmlschema.php | 4 ++-- src/{Aw => Esyst}/Nusoap/SoapServer.php | 4 ++-- src/{Aw => Esyst}/Nusoap/SoapTransportHttp.php | 2 +- src/{Aw => Esyst}/Nusoap/Soapval.php | 4 ++-- src/{Aw => Esyst}/Nusoap/Wsdl.php | 6 +++--- src/{Aw => Esyst}/Nusoap/changelog | 0 src/autoload.php | 2 +- 16 files changed, 43 insertions(+), 39 deletions(-) rename src/{Aw => Esyst}/Nusoap/NusoapBase.php (95%) rename src/{Aw => Esyst}/Nusoap/NusoapClient.php (96%) rename src/{Aw => Esyst}/Nusoap/NusoapClientMime.php (96%) rename src/{Aw => Esyst}/Nusoap/NusoapFault.php (95%) rename src/{Aw => Esyst}/Nusoap/NusoapParser.php (97%) rename src/{Aw => Esyst}/Nusoap/NusoapServer.php (96%) rename src/{Aw => Esyst}/Nusoap/NusoapWsdlcache.php (95%) rename src/{Aw => Esyst}/Nusoap/NusoapXmlschema.php (97%) rename src/{Aw => Esyst}/Nusoap/SoapServer.php (76%) rename src/{Aw => Esyst}/Nusoap/SoapTransportHttp.php (97%) rename src/{Aw => Esyst}/Nusoap/Soapval.php (94%) rename src/{Aw => Esyst}/Nusoap/Wsdl.php (97%) rename src/{Aw => Esyst}/Nusoap/changelog (100%) diff --git a/Readme.md b/Readme.md index 49e609c..5e28e85 100644 --- a/Readme.md +++ b/Readme.md @@ -1,10 +1,11 @@ -AsistenteWeb - nuSOAP +Esyst - NuSOAP ===================== -AsistenteWeb/nuSOAP based in NuSphere NuSOAP. +Esyst/nusoap based on NuSphere NuSOAP. -It is a set of PHP classes. -No PHP extensions required!!! +This is a fork of AsistenteWeb/NuSOAP with some bugs fixed, unfortunately my pull requests were not responded to. + +See also: https://github.com/Esyst/PHP-Soap for a library that makes NuSoap compatible with the native Soapclient API (drop in replacement). Create and consume web services based on: - SOAP 1.1 @@ -16,12 +17,11 @@ Instalation ``` json { "require": { - "asistenteweb/nusoap": "dev-master" - + "esyst/nusoap": "0.1.1" } } ``` -To actually install AsistenteWeb/nuSOAP in your project, download the composer binary and run it: +To actually install Esyst/nusoap in your project, download the composer binary and run it: ``` bash wget http://getcomposer.org/composer.phar @@ -34,7 +34,7 @@ php composer.phar install Use it ------ ``` php -use Aw\Nusoap\NusoapClient; +use Esyst\Nusoap\NusoapClient; $client = new NusoapClient("https://yourserver.org?wsdl", true); $result = $client->call('method', $variables); @@ -56,4 +56,4 @@ TODO ---- - Rewrite Documentation - Rewrite Samples -- Test \ No newline at end of file +- Test diff --git a/composer.json b/composer.json index 3ed35b3..3930395 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,15 @@ { - "name": "asistenteweb/nusoap", + "name": "esyst/nusoap", "type": "library", "description": "PHP5 library for SOAP.", - "keywords": ["SOAP", "nuSOAP", "asistenteweb"], - "homepage": "https://github.com/AsistenteWeb/nuSOAP", + "keywords": ["SOAP", "nuSOAP", "esyst"], + "homepage": "https://github.com/gerben-van-eck/NuSOAP", "license": "GNU", "authors": [ + { + "name": "Esyst", + "homepage" : "http://www.esyst.nl" + }, { "name": "Asistente Web", "homepage": "http://www.asistenteweb.com" @@ -24,7 +28,7 @@ }, "autoload": { "psr-0": { - "Aw\\Nusoap": "src/" + "Esyst\\Nusoap": "src/" } } } diff --git a/src/Aw/Nusoap/NusoapBase.php b/src/Esyst/Nusoap/NusoapBase.php similarity index 95% rename from src/Aw/Nusoap/NusoapBase.php rename to src/Esyst/Nusoap/NusoapBase.php index 767bdc4..da09fb0 100644 --- a/src/Aw/Nusoap/NusoapBase.php +++ b/src/Esyst/Nusoap/NusoapBase.php @@ -1,5 +1,5 @@ appendDebug('value=' . $this->varDump($val)); $this->appendDebug('attributes=' . $this->varDump($attributes)); - if (is_object($val) && get_class($val) == 'Aw\Nusoap\Soapval' && (! $soapval)) { + if (is_object($val) && get_class($val) == 'Esyst\Nusoap\Soapval' && (! $soapval)) { $this->debug("serialize_val: serialize soapval"); $xml = $val->serialize($use); $this->appendDebug($val->getDebug()); @@ -532,7 +532,7 @@ function serialize_val($val,$name=false,$type=false,$name_ns=false,$type_ns=fals break; case is_object($val): $this->debug("serialize_val: serialize object"); - if (get_class($val) == 'Aw\Nusoap\Soapval') { + if (get_class($val) == 'Esyst\Nusoap\Soapval') { $this->debug("serialize_val: serialize soapval object"); $pXml = $val->serialize($use); $this->appendDebug($val->getDebug()); @@ -568,7 +568,7 @@ function serialize_val($val,$name=false,$type=false,$name_ns=false,$type_ns=fals $i = 0; if(is_array($val) && count($val)> 0){ foreach($val as $v){ - if(is_object($v) && get_class($v) == 'Aw\Nusoap\Soapval'){ + if(is_object($v) && get_class($v) == 'Esyst\Nusoap\Soapval'){ $tt_ns = $v->type_ns; $tt = $v->type; } elseif (is_array($v)) { @@ -697,7 +697,7 @@ function serializeEnvelope($body,$headers=false,$namespaces=array(),$style='rpc' if (is_array($headers)) { $xml = ''; foreach ($headers as $k => $v) { - if (is_object($v) && get_class($v) == 'Aw\Nusoap\Soapval') { + if (is_object($v) && get_class($v) == 'Esyst\Nusoap\Soapval') { $xml .= $this->serialize_val($v, false, false, false, false, false, $use); } else { $xml .= $this->serialize_val($v, $k, false, false, false, false, $use); diff --git a/src/Aw/Nusoap/NusoapClient.php b/src/Esyst/Nusoap/NusoapClient.php similarity index 96% rename from src/Aw/Nusoap/NusoapClient.php rename to src/Esyst/Nusoap/NusoapClient.php index 44c6b1e..0615b3c 100644 --- a/src/Aw/Nusoap/NusoapClient.php +++ b/src/Esyst/Nusoap/NusoapClient.php @@ -1,5 +1,5 @@ wsdl = $endpoint; $this->endpoint = $this->wsdl->wsdl; $this->wsdlFile = $this->endpoint; diff --git a/src/Aw/Nusoap/NusoapClientMime.php b/src/Esyst/Nusoap/NusoapClientMime.php similarity index 96% rename from src/Aw/Nusoap/NusoapClientMime.php rename to src/Esyst/Nusoap/NusoapClientMime.php index 1f3955c..023eb8c 100644 --- a/src/Aw/Nusoap/NusoapClientMime.php +++ b/src/Esyst/Nusoap/NusoapClientMime.php @@ -1,5 +1,5 @@ debug("In NusoapServer, WSDL is specified"); - if (is_object($wsdl) && (get_class($wsdl) == 'Aw\Nusoap\Wsdl')) { + if (is_object($wsdl) && (get_class($wsdl) == 'Esyst\Nusoap\Wsdl')) { $this->wsdl = $wsdl; $this->externalWSDLURL = $this->wsdl->wsdl; $this->debug('Use existing wsdl instance from ' . $this->externalWSDLURL); @@ -648,7 +648,7 @@ function invoke_method() { function serialize_return() { $this->debug('Entering serialize_return methodname: ' . $this->methodname . ' methodURI: ' . $this->methodURI); // if fault - if (isset($this->methodreturn) && is_object($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'Aw\Nusoap\NusoapFault'))) { + if (isset($this->methodreturn) && is_object($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'Esyst\Nusoap\NusoapFault'))) { $this->debug('got a fault object from method'); $this->fault = $this->methodreturn; return; @@ -1113,4 +1113,4 @@ function configureWSDL($serviceName,$namespace = false,$endpoint = false,$style= 'location'=>$endpoint, 'bindingType'=>'http://schemas.xmlsoap.org/wsdl/soap/'); } -} \ No newline at end of file +} diff --git a/src/Aw/Nusoap/NusoapWsdlcache.php b/src/Esyst/Nusoap/NusoapWsdlcache.php similarity index 95% rename from src/Aw/Nusoap/NusoapWsdlcache.php rename to src/Esyst/Nusoap/NusoapWsdlcache.php index 26976f3..2a88635 100644 --- a/src/Aw/Nusoap/NusoapWsdlcache.php +++ b/src/Esyst/Nusoap/NusoapWsdlcache.php @@ -1,5 +1,5 @@ \ No newline at end of file +?> diff --git a/src/Aw/Nusoap/SoapServer.php b/src/Esyst/Nusoap/SoapServer.php similarity index 76% rename from src/Aw/Nusoap/SoapServer.php rename to src/Esyst/Nusoap/SoapServer.php index 4e14b1d..3fb0152 100644 --- a/src/Aw/Nusoap/SoapServer.php +++ b/src/Esyst/Nusoap/SoapServer.php @@ -1,10 +1,10 @@ \ No newline at end of file +?> diff --git a/src/Aw/Nusoap/Wsdl.php b/src/Esyst/Nusoap/Wsdl.php similarity index 97% rename from src/Aw/Nusoap/Wsdl.php rename to src/Esyst/Nusoap/Wsdl.php index 71431e2..c1e6467 100644 --- a/src/Aw/Nusoap/Wsdl.php +++ b/src/Esyst/Nusoap/Wsdl.php @@ -1,5 +1,5 @@ type_ns) { $type = $value->type_ns . ':' . $value->type; $forceType = true; @@ -1936,4 +1936,4 @@ function addOperation($name, $in = false, $out = false, $namespace = false, $soa } } -?> \ No newline at end of file +?> diff --git a/src/Aw/Nusoap/changelog b/src/Esyst/Nusoap/changelog similarity index 100% rename from src/Aw/Nusoap/changelog rename to src/Esyst/Nusoap/changelog diff --git a/src/autoload.php b/src/autoload.php index 5bf8434..22ac597 100644 --- a/src/autoload.php +++ b/src/autoload.php @@ -8,7 +8,7 @@ * @see https://wiki.php.net/rfc/splclassloader#example_implementation */ spl_autoload_register(function($className) { - $package = 'Aw\\Nusoap'; + $package = 'Esyst\\Nusoap'; $className = ltrim($className, '\\'); if (0 === strpos($className, $package)) { $fileName = __DIR__ . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $className) . '.php'; From 64400d47a9b769502cdcdbd6a759f8eddf1bfa8d Mon Sep 17 00:00:00 2001 From: Germ van Ek Date: Mon, 19 Oct 2015 14:39:59 +0200 Subject: [PATCH 5/5] Bugfix, check if variable is set before using it --- src/Esyst/Nusoap/NusoapParser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Esyst/Nusoap/NusoapParser.php b/src/Esyst/Nusoap/NusoapParser.php index fb63d33..2542ca4 100644 --- a/src/Esyst/Nusoap/NusoapParser.php +++ b/src/Esyst/Nusoap/NusoapParser.php @@ -117,7 +117,7 @@ function __construct($xml,$encoding='UTF-8',$method='',$decode_utf8=true){ $this->appendDebug($this->varDump($this->message)); $this->debug('parsed successfully, found root struct: '.$this->root_struct.' of name '.$this->root_struct_name); // get final value - if( $this->message[$this->root_struct]['nil'] ) { + if( isset($this->message[$this->root_struct]['nil']) && $this->message[$this->root_struct]['nil'] ) { $this->soapresponse = null; } else { $this->soapresponse = $this->message[$this->root_struct]['result'];