f00b4r / nusoap

:smirk: Fixed NuSOAP for PHP 5.6 - 8.2
https://f00b4r.github.io/nusoap/
320 stars 356 forks source link

Creation of dynamic property wsdl::$schemaTargetNamespace is deprecated #126

Open syntaxerror opened 1 week ago

syntaxerror commented 1 week ago

I was running a script on PHP 8.2 who includes this code:

`require_once('lib/nusoap.php');

$NAMESPACE = 'https://localhost/MyIntegrationWS';

$server = new soap_server;

$server->debug_flag=false; $server->configureWSDL('MyIntegrationWSPHP', $NAMESPACE); $server->wsdl->schemaTargetNamespace = $NAMESPACE;`

Which is returning a 'Creation of dynamic property wsdl::$schemaTargetNamespace is deprecated' php error.

ChatGPT recommends to add the following property declaration inside the wsdl class:

class wsdl { public $schemaTargetNamespace; // Other existing properties and methods... }

ChatGPT's explanation is that by declaring public $schemaTargetNamespace; in the wsdl class, you prevent PHP from generating a dynamic property, which eliminates the deprecation warning.