GithubHelp home page GithubHelp logo

nusoap's Introduction

NuSOAP

NuSOAP is a rewrite of SOAPx4, provided by NuSphere and Dietrich Ayala. It is a set of PHP classes - no PHP extensions required - that allow developers to create and consume web services based on SOAP 1.1, WSDL 1.1 and HTTP 1.0/1.1.

🕹 f3l1x.io | 💻 f3l1x | 🐦 @xf3l1x

All credits belongs to official authors, take a look at sourceforge.net/projects/nusoap/


Info

Installation

To install this library use Composer.

composer require econea/nusoap

Usage

// Config
$client = new nusoap_client('example.com/api/v1', 'wsdl');
$client->soap_defencoding = 'UTF-8';
$client->decode_utf8 = FALSE;

// Calls
$result = $client->call($action, $data);

Development

See how to contribute to this package.

This package is currently maintained by these authors.


Consider to support f3l1x. Also thank you for using this package.

nusoap's People

Contributors

alamellama avatar baru avatar ccarnivore avatar erikn69 avatar f3l1x avatar fredsal avatar hbrecht avatar imsop avatar joan-ricart avatar lordealeister avatar matheusantunesnandi avatar milandusek avatar milansulc avatar msilvapor avatar nawaitesidah avatar nicolacorvo90 avatar paolaruby avatar pawelsuwinski avatar perschebo avatar s-renier-taonix-fr avatar szepeviktor avatar tenzap avatar thomasgoirand avatar vincentv92 avatar voku avatar volch avatar yipeecaiey avatar zawaruddin avatar ziyun avatar zorac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nusoap's Issues

Notice: Undefined index: content-type in nusoap.php on line 7775

Hello.
As title. I got an error when I was using proxy. But It worked without proxy.
I try to compare the distinct between this two condition.
And I found that There was one more header which was returned by proxy.

response with proxy

HTTP/1.1 200 Connection established

HTTP/1.1 100 Continue

HTTP/1.1 200 OK
Server: nginx
.
.
.

response without proxy

HTTP/1.1 100 Continue

HTTP/1.1 200 OK
Server: nginx
.
.
.

And I found relative code at nusoap.php line 2819

/**
     * Test if the given string starts with a header that is to be skipped.
     * Skippable headers result from chunked transfer and proxy requests.
     *
     * @param    string $data The string to check.
     * @returns    boolean    Whether a skippable header was found.
     * @access    private
     */
    function isSkippableCurlHeader(&$data)
    {
        $skipHeaders = array('HTTP/1.1 100',
            'HTTP/1.0 301',
            'HTTP/1.1 301',
            'HTTP/1.0 302',
            'HTTP/1.1 302',
            'HTTP/1.0 401',
            'HTTP/1.1 401',
            'HTTP/1.0 200 Connection established');
        foreach ($skipHeaders as $hd) {
            $prefix = substr($data, 0, strlen($hd));
            if ($prefix == $hd) return TRUE;
        }

        return FALSE;
    }

It only filter HTTP/1.0 200 Connection established.
Why the header HTTP/1.1 200 Connection established should be reserve?

unexpected element type - string instead of QName on PHP 7.1. It works fine on PHP 5.6

Hello,

thank you for the library. It definitely fixed issues with PHP 5.6. When I tried to run it on PHP7.1 - looks like PHP7 chose diferent type and I got this exception on the Java service that talks to my PHP service:

wsclient.WSClient (WSClient.java:88) - Error, Webservice result: java.rmi.RemoteException: Runtime exception; nested exception is: unexpected element type: expected={http://www.w3.org/2001/XMLSchema}QName, actual={http://www.w3.org/2001/XMLSchema}string

Thanks!

Use passphrase and local keystore when initialising

In PHP's in built soapclient I can add a local_cert, and passphrase as options. This feature is not possible at all in nusoap as far as I could determine. Will that be available in future releases. Unfortunately I had to fall back on php soapclient again

Example
$local_cert = '/directory/path/to/password.pfx';
$passphrase = 'password';
$options = [
    'keep_alive'    => true,
    'trace'         => false,
    'local_cert'    => $local_cert,
    'passphrase'    => $passphrase,
    'cache_wsdl'    => WSDL_CACHE_NONE,
];
$soapcli = new SoapClient($WSDL, $options);

No publication on packagist

Hi there,

Thanks a lot for merging #51 but now I run into the issue that it's not published on packagist for some reason.
I believe this has to do with some webhooks not running to packagist or requires a manual trigger.

If you need help with this, please let me know so I can help out with this

Problem with NUSOAP server Response.

Hello.
I need to make a Web Service Server to comunicate with a application. I use PHP and discover de NUSOAP to help me to do the Web Service.
I create a method with the name «NewInitialDocForLocalApp» and the class NUSOAP generate a WSDL Request and Response with a message «NewInitialDocForLocalAppRequest» and «NewInitialDocForLocalAppResponse».

The application that receive my response has a validation (in Data Power) that need it «NewInitialDocForLocalAppInput» and «NewInitialDocForLocalAppOutput» instead. So it blocks my response because don't has the structure they want.

How I could solve this problem with NUSOAP class?

I register my method with this code:

$server->register( 
'NewInitialDocForLocalApp', // method name 
array( 
'idApp' => 'xsd:string', 
'idProcApp' => 'xsd:string', 
'nIF' => 'xsd:string', 
'codServico' => 'xsd:string', 
'idDocFileNet' => 'xsd:string', 
'tipoDocFileNet' => 'xsd:string', 
'idTipoDoc' => 'xsd:string', 
'dataRegisto' => 'xsd:string', 
'dataDocumento' => 'xsd:string', 
'idProcessoGPS' => 'xsd:string', 
'classNacional' => 'xsd:string', 
'nomeContribuinte' => 'xsd:string', 
'nIFApresentante' => 'xsd:string', 
'nomeApresentante' => 'xsd:string', 
'nIFEntExterna' => 'xsd:string', 
'nomeEntExterna' => 'xsd:string', 
'assunto' => 'xsd:string', 
'referencia' => 'xsd:string', 
'codServOrigem' => 'xsd:string', 
'observacoes' => 'xsd:string'	
), // input 
array( 
'codResultado' => 'xsd:string', 
'codDetalheResultado' => 'xsd:string', 
'descResultado' => 'xsd:string', 
'idProcApp' => 'xsd:string', 
'idFuncionario' => 'xsd:string' 
), // output 
$namespace, // namespace 
$namespace.'#NewInitialDocForLocalApp', 
'rpc', // style 
'literal', // 'encoded', // use 
'' // documentation 
); 

and XML WSDL response is (That is block it):

<SOAP-ENV:Body> 
<ns1:NewInitialDocForLocalAppResponse xmlns:ns1="http://sugar101.ritta.local/COMUM/ws/"> 
<codResultado>0</codResultado> 
<codDetalheResultado>0 - Associado</codDetalheResultado> 
<descResultado/> 
<idProcApp>104-2017-D</idProcApp> 
<idFuncionario/> 
</ns1:NewInitialDocForLocalAppResponse> 
</SOAP-ENV:Body> 

Response need it will be:

<SOAP-ENV:Body> 
<ns1:NewInitialDocForLocalAppOutput xmlns:ns1="http://sugar101.ritta.local/COMUM/ws/"> 
<codResultado>0</codResultado> 
<codDetalheResultado>0 - Associado</codDetalheResultado> 
<descResultado/> 
<idProcApp>104-2017-D</idProcApp> 
<idFuncionario/> 
</ns1:NewInitialDocForLocalAppOutput> 
</SOAP-ENV:Body> 

Thanks for your help.

Depreciated Error in Laravel 5.5

I am getting this message when I call the class 'soapclient'.
Methods with the same name as their class will not be constructors in a future version of PHP; nusoap_client has a deprecated constructor
I am using Laravel 5.5 with PHP 7.0. What do I need to do to fix this ?

Issue on Windows servers with Content-Length

Hi,

for some reasons, Windows servers have always had trouble with using Content-Length and zipping content within NuSoap. No matter the settings in Apache, the content comes messed. A quick workaround is to comment out lines 4345 to 4377, starting with comment "//begin code to compress payload - by John" and ending with $this->outgoing_headers[] = "Content-Length: " . strlen($payload);
Confirmed on Windows server 2012 R2 with multiple NuSoap versions, yours included. Adding mode_deflate to Apache did not help, neither did setting PHP global compression to deflate or none. Can you please look into it?

Setting of the proxy port does nothing

After calling
setHTTPProxy('192.168.1.100', 3128);
soap client still connects to port 80.
In the connect() method:

 if (!is_array($this->proxy)) {
        $host = $this->host;
        $port = $this->port;
} else {
        $host = $this->proxy['host'];
        $port = $this->proxy['port'];
}

But $port variable is not used anywhere in the method. Instead, connection always is set to $host and $this->port :
$this->fp = @fsockopen($host, $this->port, $this->errno, $this->error_str, $connection_timeout);

call() function throws warning

image
This error is thrown when nusoap function call is called. Since $params is an array and it is passed to varDump function after trying to use the parameter in strip_tags function it breaks.
$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));

`function varDump($data)
{
ob_start();
var_dump($this->sanitize($data));
$ret_val = ob_get_contents();
ob_end_clean();
return $ret_val;
}

function sanitize($value) {
    return htmlspecialchars(strip_tags($value), ENT_COMPAT, 'utf-8');
}`

Nested ComplexType

Hi,

I have an issue with a nuSoap client (using a WSDL) where one of the params is being sent as empty, which i think is because I don't know how to define which complexType to send the params as. So for example:

$TelephoneNumberAvailabilityRequest = [
            'MACCode'           => new soapval("MACCode", "xsd:nil", null),
            'PerformMPFACCheck' => 'No',
            'Postcode'          => 'NW1 4DJ',
            'ProxyCLI'          => false,
            'TelephoneNumber'   => '0123456789',
        ];

$payload = [
            'request' => [
                'AccessCircuit' => ['string' => ['All', 'FTTP']],
                'RequestDetails' => [
//                    'AvailabilityRequest' => [
                        'TelephoneNumberAvailabilityRequest' => $TelephoneNumberAvailabilityRequest,
//                    ],
                ],
            ],
        ];

$result = $client->call($method,[$payload]);

this gets sent to the server as:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns7756="http://tempuri.org">
 <SOAP-ENV:Body>
  <GetAvailability xmlns="http://xxxxxxxxxxx">
   <request>
    <AccessCircuit>
     <string>All</string>
     <string>FTTP</string>
    </AccessCircuit>
    <RequestDetails>   <!--    WHY IS THIS EMPTY :-(     -->
    </RequestDetails>
   </request>
  </GetAvailability>
 </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I've tried lots of combinations of defining the payload, such as

'RequestDetails' => [
            'MACCode'           => new soapval("MACCode", "xsd:nil", null),
            'PerformMPFACCheck' => 'No',
            'Postcode'          => 'NW1 4DJ',
            'ProxyCLI'          => false,
            'TelephoneNumber'   => '0123456789',
        ],

What I am trying to acheive is to send:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:net="http://xxxxxxxx/NetworkProductAvailabilityCheckerService" xmlns:arr="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <soapenv:Header/>
    <soapenv:Body>
        <net:GetAvailability>
            <net:request>
                <net:AccessCircuit>
                    <arr:string>All</arr:string>
                </net:AccessCircuit>
                <net:NominatedCLIRequestDetails>
                    <net:CLI>0123456789</net:CLI>
                    <net:NumberRetentionCode>0</net:NumberRetentionCode>
                    <net:Retain>Yes</net:Retain>
                </net:NominatedCLIRequestDetails>
                <net:RequestDetails xsi:type="net:TelephoneNumberAvailabilityRequest" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
                    <net:MACCode xsi:nil="true" />
                    <net:PerformMPFACCheck>No</net:PerformMPFACCheck>
                    <net:Postcode>NW1 4DJ</net:Postcode>
                    <net:ProxyCLI>false</net:ProxyCLI>
                    <net:TelephoneNumber>0123456789</net:TelephoneNumber>
                </net:RequestDetails>
                <net:UserConsent>Yes</net:UserConsent>
            </net:request>
        </net:GetAvailability>
    </soapenv:Body>
</soapenv:Envelope>

but just does not want to work???

  • any advise gratefuly received :-)

Php Error Warning

PHP message: PHP Notice: Array to string conversion in /***/nusoap.php on line 7425" while reading response header from upstream, client: 35.234.102.98, server: ***, request: "GET ** HTTP/1.1", upstream: "fastcgi://127.0.0.1:9002", host: "***" 2018/06/07 15:10:47 [error] 21264#21264: *24189 FastCGI sent in stderr: "PHP message: PHP Warning: Use of undefined constant SOAP_RPC - assumed 'SOAP_RPC' (this will throw an Error in a future version of PHP) in ***.php on line 159 PHP message: PHP Warning: Use of undefined constant SOAP_ENCODED - assumed 'SOAP_ENCODED' (this will throw an Error in a future version of PHP) in ***.php on line 160 PHP message: PHP Warning: Use of undefined constant SOAP_1_1 - assumed 'SOAP_1_1' (this will throw an Error in a future version of PHP) in ***.php on line 161 PHP message: PHP Warning: Use of undefined constant WSDL_CACHE_NONE - assumed 'WSDL_CACHE_NONE' (this will throw an Error in a future version of PHP) in **.php on line 162

Centos OS 7
Php 7.2
Nginx + Php fpm

`
$default = array(' My option value ');
$params = array_merge($default, $params);

    $client                   = new nusoap_client($this->config->get('SoapUrl'), true);
    $client->soap_defencoding = 'UTF-8';
    $client->decode_utf8      = false;

    $error = $client->getError();
    if ($error) {
        $this->logger->addInfo("Constructor error $error");
    }

    $result = $client->call($function, $params);

    if ($client->fault) {
        $this->logger->addInfo("Fault", (array) $result);
    } elseif ($error = $client->getError()) {
        $this->logger->addInfo("Error $function $error");
    } else {
        return $result;
    }`

Creating default object from empty value

After update to Latest version 0.9.10 into my Laravel 7 webservice my client has the next issue:

ErrorException
Creating default object from empty value

\vendor\econea\nusoap\src\nusoap.php:4842

The line 4842 is: $this->schemas[$ns][$ns2]->imports[$ns2][$ii]['loaded'] = true;

Any suggest?

NuSOAP SERVER returns 500 Internal Server Error when run in PHP 7.0.22

On localhost running PHP 7.0.22, NuSOAP Server returns NuSOAP SOAP Response header of HTTP/1.0 500 Internal Server Error...with "error in msg parsing:\nxml was empty, didn't parse!" contained in faultstring node.

The same NuSOAP server code running in production on PHP 5.5.38 successfully returns SOAP results as expected. So I'm currently testing NuSOAP Server compatibility with PHP 7.0.22 in my localhost environment.

If anyone could perhaps point me in the right direction, it would be much appreciated!

UPDATE: This error was resolved by updating how I accessed HTTP POST data in the WSDL.

No memory error

Hello,
Recently I have been having problems with parsing some XML files using nusoap, these problems happen because the sent envelopes are too large.

Since this is legacy software, any kind of change has a monster impact.

I noticed that by changing a parameter within the nusoap lib this error stops occurring.

According to my understanding this piece of code just breaks the XML file into several smaller parts so that the parser process can be done.

nusoap.php line : 6793

 $chunkSize = 256;
  for($pointer = 0; $pointer < strlen($xml) && empty($parseErrors); $pointer += $chunkSize) {
   $xmlString = substr($xml, $pointer, $chunkSize);
   if(!xml_parse($this->parser, $xmlString, false)) {
    $parseErrors['lineNumber'] = xml_get_current_line_number($this->parser);
    $parseErrors['errorString'] = xml_error_string(xml_get_error_code($this->parser));
   };
  }

Arrays in param is converted to empty XML

Hi Im sending an array of params like this and WebService receives emtpy the elements that are arrays...

[params] => Array
        (
            [token] => 4b36f529065d34ec28b7ffcb83b0c3f6
            [id] => 0
            [provider_id] => 321
            [number] => A0FC60D7C
            [orders] => Array
                (
                    [0] => 15665
                )
            [bodies] => Array
                (
                    [0] => Array
                        (
                            [id] => 6803
                            [DecVal1] => 16
                        )
                )
        )

This is the xml that Nusoap is going to send.. What could it be?
<InformeRecepcion_Guarda xmlns="http://mapplics.com/"><token>4b36f529065d34ec28b7ffcb83b0c3f6</token><id>0</id><provider_id>321</provider_id><number>A0FC60D7C</number>**<orders></orders><bodies></bodies>**</InformeRecepcion_Guarda>

can't install stable version

Hello,

I'm trying to install the stable version:

composer require econea/nusoap: ~0.9.5.4

But I got this error:

[InvalidArgumentException]
  Could not find a matching version of package ~0.9.5.4. Check the package spelling, your version constraint and that the package is available in a stability which matches your minimum-stability (stable).

How do i assign $this->method() ?

I declared soap_server inside a class method, and i want to bind receiver method to the one inside the class.

class Gateway extends ControllerPublic_Abstract
{
         public function messageReceiver() {
                     $this->abc();
         }
	public function actionSms()
	{
		$server = new soap_server();
		$server->configureWSDL('MOReceiver', 'urn:MOReceiver', 'http://domain.com/gateway/sms');
		// $server->wsdl->schemaTargetNamespace=$ns;
		$server->soap_defencoding = 'UTF-8';
		$server->register(
			'Gateway.messageReceiver',

PointK_ControllerPublic_GateWay.messageReceiver doesn't work

Inifinite recursion in `nusoap_base->varDump`

PR #58 introduced a call to sanitise inside varDump here: 4215f54#diff-848ba0c3b184cd1507cdf73646ee4e30

This is incorrect, because sanitise expects a string, but varDump allows arrays and objects. If given another object extending from nusoap_base, this results in an infinite recursion, because sanitise will trigger a call to __toString, which calls varDump again.

sanitise should either be called on the return value at the end of this function, or, preferably, only called when the data is actually being output (escaping should always be based on output context).

Sample backtrace:

#238 strip_tags() called at [vendor/econea/nusoap/src/nusoap.php:919]
#239 nusoap_base->sanitize() called at [vendor/econea/nusoap/src/nusoap.php:912]
#240 nusoap_base->varDump() called at [vendor/econea/nusoap/src/nusoap.php:930]
#241 nusoap_base->__toString()
#242 strip_tags() called at [vendor/econea/nusoap/src/nusoap.php:919]
#243 nusoap_base->sanitize() called at [vendor/econea/nusoap/src/nusoap.php:912]
#244 nusoap_base->varDump() called at [vendor/econea/nusoap/src/nusoap.php:930]
#245 nusoap_base->__toString()
#246 strip_tags() called at [vendor/econea/nusoap/src/nusoap.php:919]
#247 nusoap_base->sanitize() called at [vendor/econea/nusoap/src/nusoap.php:912]
#248 nusoap_base->varDump() called at [vendor/econea/nusoap/src/nusoap.php:4205]
#249 nusoap_server->invoke_method() called at [vendor/econea/nusoap/src/nusoap.php:3843]

Deprecation warning on PHP 8

PHP 8 generates a deprecation warning:

PHP Deprecated:  Required parameter $cookies follows optional parameter $timeout in src/nusoap.php on line 2683

There's a fix in #68 along with test and documentation updates for PHP 8.

With Laravel way to call function inside register from a controller method

$server = new \nusoap_server();
$server->configureWSDL('TestService', false, url('ws/connect'));

$server->register('test',
            [
                'input' => 'xsd:string'
            ],
            [
                'output' => 'xsd:string'
            ],
            'http://192.168.0.21:88/wms/public/ws/',
            'outcome',
            "rpc",
            "encoded",
            "Cotizacion de un vehiculo");

$rawPostData = file_get_contents("php://input");

return \Response::make($server->service($rawPostData), 200, array('Content-Type' => 'text/xml; charset=ISO-8859-1'));

**Is there a way to place test inside the controller?? **

Server Samples

There are a million client samples. How about some server samples?

Undefined variable: tt_ns

ErrorException
Undefined variable: tt_ns
vendor/econea/nusoap/src/nusoap.php:621

When i change line 621 from:
if ($tt_ns != '' && $tt_ns == $this->namespaces['xsd']) {
to:
if (isset($tt_ns) && $tt_ns != '' && $tt_ns == $this->namespaces['xsd']) {

And line 623 from:
} elseif ($tt_ns) {

To:
} elseif (isset($tt_ns)) {

All seems fixed.

Cannot redeclare timestamp_to_iso8601

Fatal error: Cannot redeclare timestamp_to_iso8601() (previously declared in D:\xampp\htdocs\soap_database_mysql\lib\nusoap.php:943) in D:\xampp\htdocs\soap_database_mysql\lib\nusoap.php on line 943

Windows 10
PHP 7.4.29
XAMPP 3.3.0
Nusoap 0.9.12

Occurs on: nusoap_client -> call()

Testing

Are there any tests as in Unit Tests?

As you claim that this library has been "tested" for PHP 7.2.

Considerable reference:
#4

Roadmap 1.0.0

Hi guys!

I want to make things clear and set some expections to this library. Let's make some updates and plan for v1.0.0.

All changes gonna be in develop branch to keep things working in master branch.

Roadmap:

  • split nusoap.php into 1-class-1-file
  • introduce new namespace (maybe Nusoap/*?)
    • change internal usage
  • reformat all classes (I'm using PhpStorm)
  • write working example
  • write some unit tests
  • setup QA
    • Travis CI - test 5.6, 7.0, 7.1, 7.2
    • codesniffer

I would be happy if some wanna share effort on this library and help me do all this stuff.

Thanks.

nuSoap PHP 7.2 gives Deprecated error on OpenCart

I used PHP 5.6 for a long time and after I change it to PHP 7.2 I get this error

[Sat Aug 22 23:23:02.457412 2020] [proxy_fcgi:error] [pid ****:tid ****] [client ****] AH01071: Got error 'PHP message: PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; nusoap_base has a deprecated constructor in /home/site/domains/mysite.com/public_html/system/library/nuSoap/nusoap.php on line 85\nPHP message: PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; nusoap_fault has a deprecated constructor in /home/site/domains/mysite.com/public_html/system/library/nuSoap/nusoap.php on line 1007\nPHP message: PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; nusoap_xmlschema has a deprecated constructor in /home/site/domains/mysite.com/public_html/system/library/nuSoap/nusoap.php on line 1095\nPHP message: PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; soapval has a deprecated constructor in /home/site/domains/mysite.com/public_html/system/library/nuSoap/nusoap.php on line 2067\nPHP message: PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; soap_transport_http has a deprecated constructor in /home/site/domains/mysite.com/public_html/system/library/nuSoap/nusoap.php on line 2169\nPHP message: PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; nusoap_server has a deprecated constructor in /home/site/domains/mysite.com/public_html/system/library/nuSoap/nusoap.php on line 3474\nPHP message: PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; wsdl has a deprecated constructor in /home/site/domains/mysite.com/public_html/system/library/nuSoap/nusoap.php on line 4597\nPHP message: PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; nusoap_parser has a deprecated constructor in /home/site/domains/mysite.com/public_html/system/library/nuSoap/nusoap.php on line 6532\nPHP message: PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; nusoap_client has a deprecated constructor in /home/site/domains/mysite.com/public_html/system/library/nuSoap/nusoap.php on line 7183\n'

I use OpenCart 3.0.2.0
Will replacing this nuSoap file with my own fix my problem?

Thanks

How to send empty response from nusoap server

Hi, i need to send only headers, and if everything goes well, need to send empty response, where Content-Length is 0

How can i do ?

Just now i am returning something like this:

HTTP/1.1 200 OK
Date: Thu, 22 Sep 2022 15:55:02 GMT
Server: Apache/2.4.54 (Ubuntu)
X-SOAP-Server: NuSOAP/0.9.11 (1.123)
Vary: Accept-Encoding
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body></SOAP-ENV:Body></SOAP-ENV:Envelope>

I need only return this:

HTTP/1.1 200 OK
Date: Thu, 22 Sep 2022 15:55:02 GMT
Server: Apache/2.4.54 (Ubuntu)
X-SOAP-Server: NuSOAP/0.9.11 (1.123)
Vary: Accept-Encoding
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: text/xml; charset=UTF-8

Function parseRequest($headers, $data) without return

When you get requestSOAP, that return NULL value.

On "function parse_request", remove the headers at line 4058 $this->parseRequest($this->headers, $data); but the function parseRequest haven't return sentence.

To solve it, i add "return $data;" at line 4491

Notice: Undefined variable: prefix

in the line 5048 if (preg_match('/:/', $name)) {
variables $prefix and $namespace has no default value before it, so it showing error

Notice: Undefined variable: prefix in ..\vendor\econea\nusoap\src\nusoap.php on line 5095

Notice: Undefined variable: namespace in ..\vendor\econea\nusoap\src\nusoap.php on line 5142

Notice: Undefined variable: namespace in ..\vendor\econea\nusoap\src\nusoap.php on line 5143

Notice: Trying to access array offset on value of type bool in nusoap.php on line 5697

Fix for that:

--- nusoap.php.orig	2020-04-14 15:10:57.172872019 +0200
+++ nusoap.php	2020-04-14 15:12:43.172875702 +0200
@@ -5694,7 +5694,7 @@
                         $ns = $this->getNamespaceFromPrefix($typePrefix);
                         $localPart = $this->getLocalPart($partType);
                         $typeDef = $this->getTypeDef($localPart, $ns);
-                        if ($typeDef['typeClass'] == 'element') {
+                        if (isset($typeDef['typeClass']) && $typeDef['typeClass'] == 'element') {
                             $elementortype = 'element';
                             if (substr($localPart, -1) == '^') {
                                 $localPart = substr($localPart, 0, -1);

Issue of using $typeDef without checking is it array or boolean (getTypeDef: bool|array).

$this->portTypes[$bindingData['portType']][$operation]['output'] is undefined in One-way service

The service receives a message. The operation therefore has a single input element. The grammar for a one-way operation is −

<wsdl:definitions .... > 
   <wsdl:portType .... > *
      <wsdl:operation name = "nmtoken">
         <wsdl:input name = "nmtoken"? message = "qname"/>
      </wsdl:operation>
   </wsdl:portType >
</wsdl:definitions>

On this way we have an error in PHP8 on line 4930
$this->portTypes[$bindingData['portType']][$operation]['output']

nusoap_client controller

How to load nusoap_client controller for test client on web.
I am using codeignater structure for controllers, & all library controllers are included into library folder, used like "$this->load->library('nusoap_controller');",same syntax worked for nusoap_base or nusoap_server class

Error (when upgrade from 0.9.51 to 0.9.10) wsdl: is not a supported type.

Recently I update my project on laravel from 5.8 to 8 and nusoap to the last version, 0.9.10, but y got and erro when call a soap service that was working normally before the upgrade

my code:

//llamar a SOAP tigo:
$lcUrl="My URL soap service";
$client = new \nusoap_client($lcUrl, 'wsdl');
$client->soap_defencoding = 'UTF-8';
$client->decode_utf8 = FALSE;

//parametros q envio
$param = array(
'key' => SecurityKey::SecurityKeyIdentification,
'parametros' => $tcParametros
);
//llamando al método y pasándole el array con los parámetros
$lcRespuestaTigo = $client->call('consultarEstado', $param);

        // Check for a fault
        if ($client->fault) {
            var_dump($lcRespuestaTigo);
        } else {
            // Check for errors
            $err = $client->getError();
            if ($err) {
                // Display the error
                var_dump($err);
               // echo '<h2>Error</h2><pre>' . $err . '</pre>';
            } else {
                // Display the result
                var_dump($lcRespuestaTigo);
            }
        }

and i got the error:
"wsdl error: "My URL"/:consultarEstado^ (consultarEstado^) is not a supported type."

how to use on windows need help me

hi,
i am use nusoap in php 5 but now php upgarede to php7 old nusoap not working and this version not working or i dont know how to use it
please help me to how to use in windows

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.