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 8a35e14..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 @@ 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( 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']; + } // get header value if($this->root_header != '' && isset($this->message[$this->root_header]['result'])){ $this->soapheader = $this->message[$this->root_header]['result']; diff --git a/src/Aw/Nusoap/NusoapServer.php b/src/Esyst/Nusoap/NusoapServer.php similarity index 96% rename from src/Aw/Nusoap/NusoapServer.php rename to src/Esyst/Nusoap/NusoapServer.php index 88fafa7..1fc0a4b 100644 --- a/src/Aw/Nusoap/NusoapServer.php +++ b/src/Esyst/Nusoap/NusoapServer.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';