I'm developing a web service in PHP, using nosoap. this is my file, webservice.php
<?php
require_once "nusoap/nusoap.php";
$namespace = "urn:mywsdl";
$server = new soap_server();
$server->configureWSDL('myWS', $namespace);
$server->wsdl->schemaTargetNamespace = $namespace;
$server->wsdl->addComplexType('datosBasicos', 'complexType', 'struct', 'all', '', array(
'codigo' => array(
'name' => 'codigo',
'type' => 'xsd:string'
),
'nombre' => array(
'name' => 'nombre',
'type' => 'xsd:string'
)
));
$server->wsdl->addComplexType('arraydatosBasicos', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array(
array('ref' => 'SOAP-ENC:arrayType',
'wsdl:arrayType' => 'tns:datosBasicos[]')
), 'tns:datosBasicos'
);
$server->register('saludar', array('nombre' => 'xsd:string'), array('return' => 'tns:arraydatosBasicos'), $namespace);
function saludar($nombre) {
$array[] = array('codigo' => '123', 'nombre' => 'test');
$array[] = array('codigo' => '5745', 'nombre' => 'probando');
$datos[] = $array[1];
return $datos;
}
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>
But, when I deploy the web service, with SOAPUI, I get this error:
<b>Notice</b>: Array to string conversion in <b>C:\xampp\htdocs\nusoap\nusoap\nusoap.php</b> on line <b>6132</b><br />
What am I doing wrong?